pimp Makefiles to use more global settings
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Thu, 13 Sep 2012 19:29:50 +0000 (21:29 +0200)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Thu, 13 Sep 2012 21:10:50 +0000 (21:10 +0000)
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Makefile.inc
firmware/Makefile
updater/Makefile

index b260853..e531a69 100644 (file)
@@ -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
 
index fb1db72..a9a1c40 100644 (file)
@@ -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
index e1b1fbb..de347cd 100644 (file)
@@ -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) "."