diff options
author | Karel Kočí <cynerd@email.cz> | 2016-03-20 16:36:04 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-03-20 16:36:04 +0100 |
commit | 1ac3026c039cb15dd8c110c84215096854c3c804 (patch) | |
tree | 7e03927e10d2339cd0b8906e905a4a5871d58e2d /examples/usartecho/Makefile | |
parent | 9b98275f519773177039cbc65d500ddefb0d4831 (diff) | |
download | avr-ioe-1ac3026c039cb15dd8c110c84215096854c3c804.tar.gz avr-ioe-1ac3026c039cb15dd8c110c84215096854c3c804.tar.bz2 avr-ioe-1ac3026c039cb15dd8c110c84215096854c3c804.zip |
Some chages in configuration build
Diffstat (limited to 'examples/usartecho/Makefile')
-rw-r--r-- | examples/usartecho/Makefile | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/examples/usartecho/Makefile b/examples/usartecho/Makefile index 900fe09..6e4e9d5 100644 --- a/examples/usartecho/Makefile +++ b/examples/usartecho/Makefile @@ -4,13 +4,14 @@ PROJNAME = usartecho SRC = echo.c OBJ = $(patsubst %.c,%.o,$(SRC)) # This creates list of *.o files from *.c +Q ?= @ # This can be overwritten to show commands .PHONY: all -ifneq ("$(wildcard config)","") # Checking if configuration exists +ifneq ("$(wildcard .config)","") # Checking if configuration exists all: $(PROJNAME).hex @echo Now you can flash $< to your chip. else -all: help +all: .config endif # Edit here help like you ever want @@ -26,39 +27,43 @@ help: .PHONY: clean clean: @echo " CLEAN OBJ" - @$(RM) $(OBJ) + $(Q)$(RM) $(OBJ) @echo " CLEAN $(PROJNAME).elf $(PROJNAME).hex" - @$(RM) $(PROJNAME).elf $(PROJNAME).hex - @$(MAKE) -C ../.. clean + $(Q)$(RM) $(PROJNAME).elf $(PROJNAME).hex + $(Q)$(MAKE) -C ../.. clean O=examples/$(PROJNAME) # Building targets are available only if configuration is generated -ifneq ("$(wildcard config)","") --include config +ifneq ("$(wildcard .config)","") +-include .config # If you want change some standard CFLAGS, change them in configuration not here. # Add here only options that should not be applied to avr-ioe also. -CFLAGS = -I../../include -mmcu=$(MMCU) -imacros ../../.config.h \ +CFLAGS = -I../../include -mmcu=$(MMCU) -imacros build/config.h \ $(shell echo $(CONFCFLAGS)) $(shell echo -DF_CPU=$(F_CPU)000L) -$(PROJNAME).elf: ../../libioe.a +$(PROJNAME).elf: libioe.a $(PROJNAME).elf: $(OBJ) @echo " LD $@" - @avr-gcc -Os -mmcu=$(MMCU) $^ -o $@ -L../.. -lioe + @avr-gcc -Os -mmcu=$(MMCU) $(filter %.o,$^) -o $@ -L. -lioe $(PROJNAME).hex: $(PROJNAME).elf @echo " OBJCOPY $@" - @avr-objcopy -O ihex -R .eeprom $< $@ + $(Q)avr-objcopy -O ihex -R .eeprom $< $@ -$(OBJ): %.o: %.c ../../libioe.a +$(OBJ): %.o: %.c libioe.a @echo " CC $@" - @avr-gcc $(CFLAGS) -c -o $@ $< + $(Q)avr-gcc $(CFLAGS) -c -o $@ $< -../../libioe.a: config - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. libioe.a +libioe.a: .config + $(Q)$(MAKE) -C ../.. examples/$(PROJNAME)/libioe.a O=examples/$(PROJNAME) endif +.config: + @echo Configuration for this example is missing. Probably deleted... + @exit 1 + config: - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. config + $(Q)$(MAKE) -C ../.. config O=examples/$(PROJNAME) .PHONY: menuconfig menuconfig: - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. menuconfig + $(Q)$(MAKE) -C ../.. menuconfig O=examples/$(PROJNAME) |