This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-rescue/Makefile
2007-04-13 19:52:00 +00:00

28 lines
504 B
Makefile

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
avr-g++ -M -mmcu=atmega32 -MF $@ -MT $(patsubst %.cpp,%.o,$<) -MT $@ $<
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