summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-04-13 19:58:03 +0200
committerneoraider <devnull@localhost>2007-04-13 19:58:03 +0200
commit7da669b97ec71f138c74d562b8a3b219d3f98a50 (patch)
tree089226274f422ae1b486cf44d36751de47bca01c /Makefile
parente26a1dc73313098cef235918d237f9b1a6e4cb5f (diff)
downloadrc2007-rescue-7da669b97ec71f138c74d562b8a3b219d3f98a50.tar
rc2007-rescue-7da669b97ec71f138c74d562b8a3b219d3f98a50.zip
Makefile angelegt; Grundfunktionen erweitert
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c7fe375
--- /dev/null
+++ b/Makefile
@@ -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