$make will show avr-size once and only once whether or not a build needs to occur.

This commit is contained in:
dak664 2010-12-22 21:13:09 +00:00
parent 5b8e62ef4f
commit 95982b40ba
2 changed files with 5 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile.avr,v 1.26 2010/11/12 17:15:00 dak664 Exp $ # $Id: Makefile.avr,v 1.27 2010/12/22 21:13:09 dak664 Exp $
### Check if we are running under Windows ### Check if we are running under Windows
@ -133,7 +133,10 @@ $(OBJECTDIR)/%.o: %.c
%.elf: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a symbols.o %.elf: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a symbols.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(LDLIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(LDLIBS)
#Allow top-level makefile to always show size even when build is up to date
ifndef NOAVRSIZE
avr-size -C --mcu=$(MCU) $@ avr-size -C --mcu=$(MCU) $@
endif
%.hex: %.out %.hex: %.out
$(OBJCOPY) $^ -O ihex $@ $(OBJCOPY) $^ -O ihex $@

View file

@ -5,7 +5,7 @@ else
endif endif
all: all:
${MAKE} -f Makefile.webserver TARGET=avr-raven webserver6.elf ${MAKE} -f Makefile.webserver TARGET=avr-raven NOAVRSIZE=1 webserver6.elf
#can't just rename, webserver6 may be open in debugger #can't just rename, webserver6 may be open in debugger
@if [ $(OUTFILE) != "webserver6" ]; then cp webserver6.elf $(OUTFILE).elf;fi @if [ $(OUTFILE) != "webserver6" ]; then cp webserver6.elf $(OUTFILE).elf;fi
avr-objcopy -O ihex -R .eeprom -R .fuse -R .signature $(OUTFILE).elf $(OUTFILE).hex avr-objcopy -O ihex -R .eeprom -R .fuse -R .signature $(OUTFILE).elf $(OUTFILE).hex