Allow other (compatible) AVR targets

This commit is contained in:
dak664 2011-02-07 13:37:43 -05:00
parent 62b894e560
commit ee65d0d887
2 changed files with 35 additions and 6 deletions

View File

@ -1,19 +1,29 @@
ifndef TARGET
TARGET=avr-raven
MCU=atmega1284p
endif
ifndef WEBDIR
OUTFILE=webserver6
OUTFILE=webserver6-$(TARGET)
else
OUTFILE=webserver6-$(WEBDIR)
OUTFILE=webserver6-$(WEBDIR)-$(TARGET)
endif
ifndef MCU
#TODO:extract MCU from platform
MCU=atmega128rfa1
endif
all:
${MAKE} -f Makefile.webserver TARGET=avr-raven NOAVRSIZE=1 webserver6.elf
${MAKE} -f Makefile.webserver TARGET=$(TARGET) NOAVRSIZE=1 webserver6.elf
#can't just rename, webserver6 may be open in debugger
@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-size -C --mcu=atmega1284p $(OUTFILE).elf
# avr-size -C --mcu=atmega1284p $(OUTFILE).elf
avr-size -C --mcu=$(MCU) $(OUTFILE).elf
clean:
${MAKE} -f Makefile.webserver TARGET=avr-raven clean
${MAKE} -f Makefile.webserver TARGET=$(TARGET) clean
# Delete httpd-fsdata.c only if your toolchain includes perl
# rm ../../platform/avr-raven/apps/raven-webserver/httpd-fsdata.c
rm symbols.c symbols.h webserver6.elf webserver6.hex
rm symbols.c symbols.h webserver6.elf $(OUTFILE).elf $(OUTFILE).hex
rm -rf obj_avr-raven

View File

@ -23,3 +23,22 @@ should be done to ensure all c source is on the same page (ahem).
Future plans are for $make COFFEE_FILES=2 or 4 for a full coffee file system.
A bare $make will use the avr-raven platform. Alternate compatible platforms can
be specified, e.g. $make TARGET=avr-atmega128rfa1. In that case the webserver
source and content located in that platform directory will be used.
webserver6.elf is always generated. It is copied to e.g. webserver6-avr-raven.elf
or webserver6-avr-atmega128rfa1.elf depending on the platform. If alternate
web content is specified the output file will be named accordingly, e.g.
$make WEBDIR=huginn
(builds webserver6.elf and webserver6-huginn-avr-raven.elf)
$make WEBDIR=muninn TARGET=avr-atmega128rfa1
(builds webserver6.elf and webserver6-muninn-avr-atmega128rfa1.elf)
$make clean affects only the specified target and webdir:
$make clean WEBDIR=huginn TARGET=avr-atmega128rfa1
deletes the avr-atmega128rfa1 objects and webserver6-huginn-avr-atmega128rfa1.elf
$make clean
deletes the avr-raven objects and webserver6-avr-raven.elf