Hi, All!
Может, кому-то будет полезно.
В процессе ковыряния со "стандартными" gcc-avr.mak и avreal.mak, включаемыми в makefile проекта, вылезла одна вещь. То дома всё хорошо, а на работе бяки, то наоборот. Оказалось, дома первым под руку попадается make из MSYS (я на него перелез вместо
Ну так вот, оказалось, что WinAVR-овский make при разборе makefile держит взятый из окружения PATH ещё в windows-стиле, и только перед отправкой его ниже конвертирует в unix-стиль. А MSYS-овский make сразу конвертирует в unix-стиль и внутри makefile с переменной PATH надо работать в этом стиле.
Поскольку
a) дома на MSYS уже перелез b) на работе ничего резко менять не хочется (мало ли в каких ещё проектах вылезут особенности другого make.exe) c) с AVR я работаю и там, и там
я подрихтовал сам gcc-avr.mak таким образом, что он работает в обеих вариантах окружения.
#----------------------------------------------------------------------- # Prepare and export PATH # # Add WinAVR compiler directory and, if needed, utilites directory # at start of PATH. # # AVRGCC variable can contain spaces, '/' must be used instead of '', # no slash at the end. # # WinAVR distribution make.exe starts with PATH in windows-style # ( c:\directory ). # Shell and all utilites must be called from WinAVR\utils\bin directory # for comaptibility. # # MSYS (Minimal SYStem) make.exe starts with PATH converted to unix-style # ( /c/directory ). # If MSYS available in system and stay first in the PATH then we can use # sh.exe and all utilites from MSYS distribution. # # We need different PATH processing for this two options.
GCCPATH := $(AVRGCC)/bin UTILPATH := $(AVRGCC)/utils/bin
# Assume: 1) if PATH already in unix-style, then MSYS used. # 2) windows PATH contain more then one directory =>
# separator ';' always present. ifeq (,$(findstring ;,$(PATH))) # ';' not exist in path, assume that MSYS sh.exe available # Only avr-gcc directory need to be added to PATH # Convert GCCPATH to unix-style PATH := $(subst :,,/$(GCCPATH)):$(PATH) else # ';' exist, assume that WinAVR used and add WinAVR/utils/bin # at start of the PATH for prevent conflicts between different # ports and versions of unix utilites. PATH := $(subst /,\,$(UTILPATH);$(GCCPATH));$(PATH) # Use sh.exe from WinAVR distribution. SHELL := $(subst /,\,$(UTILPATH))/sh.exe endif
export PATH
#-----------------------------------------------------------------------
wbr,