Makefile angelegt; Grundfunktionen erweitert

This commit is contained in:
neoraider 2007-04-13 17:58:03 +00:00
parent e26a1dc733
commit 7da669b97e
13 changed files with 229 additions and 36 deletions

31
Makefile Normal file
View file

@ -0,0 +1,31 @@
FILES := $(patsubst %.cpp,%,$(wildcard *.cpp))
all: robocup.elf;
include $(FILES:%=%.d)
robocup.hex: robocup.elf
avr-objcopy -O ihex -R .eeprom $< $@
robocup.elf: $(FILES:%=%.o)
avr-g++ -mmcu=atmega32 -o $@ $^
%.o: %.cpp
avr-g++ -c -mmcu=atmega32 -o $@ $<
%.d: %.cpp
@set -e; rm -f $@; \
avr-g++ -M -mmcu=atmega32 -MF $@.$$$$ $<; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
program: robocup.hex
sudo avrdude -P usb -c avrisp2 -p m32 -U $<
clean:
rm -f robocup.hex robocup.elf $(FILES:%=%.o) $(FILES:%=%.d)
.PHONY: clean