From: Stephan Baerwolf Date: Thu, 13 Sep 2012 19:29:50 +0000 (+0200) Subject: pimp Makefiles to use more global settings X-Git-Tag: v0.6~4 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/eca26b3881806aea40726f234df80718581a03ce?ds=inline pimp Makefiles to use more global settings Signed-off-by: Stephan Baerwolf --- diff --git a/Makefile.inc b/Makefile.inc index b260853..e531a69 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -103,11 +103,16 @@ FUSEOPT_328 = -U lfuse:w:0xf7:m -U hfuse:w:0xda:m -U efuse:w:0x03:m ############################################################################### # Tools: +AVRPATH = AVRDUDE = @echo avrdude $(PROGRAMMER) -p $(DEVICE) -CC=@avr-gcc + +ECHO=@echo GCC=@gcc MAKE=@make RM=@rm -f -OBC=@avr-objcopy -ECHO=@echo + +CC=@$(AVRPATH)avr-gcc +OBC=@$(AVRPATH)avr-objcopy +OBD=@$(AVRPATH)avr-objdump +SIZ=@$(AVRPATH)avr-size diff --git a/firmware/Makefile b/firmware/Makefile index fb1db72..a9a1c40 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -71,11 +71,11 @@ main.bin: $(OBJECTS) main.hex: main.bin rm -f main.hex main.eep.hex - avr-objcopy -j .text -j .data -O ihex main.bin main.hex - avr-size main.bin + $(OBC) -j .text -j .data -O ihex main.bin main.hex + $(SIZ) main.bin disasm: main.bin - avr-objdump -d main.bin + $(OBD) -d main.bin cpp: $(CC) $(CFLAGS) -E main.c @@ -88,7 +88,7 @@ ALLHEXFILES = hexfiles/mega8_12mhz.hex hexfiles/mega8_15mhz.hex hexfiles/mega8_1 allhexfiles: $(ALLHEXFILES) $(MAKE) clean - avr-size hexfiles/*.hex + $(SIZ) hexfiles/*.hex $(ALLHEXFILES): @[ -d hexfiles ] || mkdir hexfiles diff --git a/updater/Makefile b/updater/Makefile index e1b1fbb..de347cd 100644 --- a/updater/Makefile +++ b/updater/Makefile @@ -48,7 +48,7 @@ updater.elf: updater.o updater.hex: updater.elf $(OBC) -j .text -j .data -O ihex updater.elf updater.hex $(ECHO) "." - avr-size updater.elf + $(SIZ) updater.elf $(ECHO) "." $(AVRDUDE) -D -U flash:w:updater.hex:i $(ECHO) "."