From 1dcc83391e51890c76fc8e11aeb24300a99412a2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 9 Mar 2011 01:45:35 -0300 Subject: [PATCH] atusb/fw/Makefile: put -mmcu into CFLAGS so that DEPEND uses it, too - Makefile ($(NAME).elf, boot.elf, %.o): don't pass -mmcu explicitly - Makefile (CFLAGS): include -mmcu, so that it's also picked up by $(DEPEND) --- atusb/fw/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/atusb/fw/Makefile b/atusb/fw/Makefile index 0a46ef7..54e394f 100644 --- a/atusb/fw/Makefile +++ b/atusb/fw/Makefile @@ -14,7 +14,8 @@ SHELL = /bin/bash NAME = atusb -CFLAGS = -g -Wall -Wextra -Wshadow -Werror -Wno-unused-parameter \ +CFLAGS = -g -mmcu=$(CHIP) \ + -Wall -Wextra -Wshadow -Werror -Wno-unused-parameter \ -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes CHIP=atmega32u2 @@ -62,10 +63,10 @@ all: $(NAME).bin boot.hex $(NAME).elf: $(OBJS) $(MAKE) version.o - $(CC) $(CFLAGS) -mmcu=$(CHIP) -o $@ $(OBJS) version.o + $(CC) $(CFLAGS) -o $@ $(OBJS) version.o boot.elf: $(BOOT_OBJS) - $(CC) $(CFLAGS) -mmcu=$(CHIP) -o $@ $(BOOT_OBJS) \ + $(CC) $(CFLAGS) -o $@ $(BOOT_OBJS) \ -Wl,--section-start=.text=0x7000 %.bin: %.elf @@ -104,7 +105,7 @@ version.c: # ----- Dependencies ---------------------------------------------------------- %.o: %.c - $(CC) $(CFLAGS) -mmcu=$(CHIP) -Os -c $< + $(CC) $(CFLAGS) -Os -c $< $(DEPEND) $< | \ sed -e \ '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \