avr-game
diff Makefile @ 0:9db99968b55e
initial commit, screen test working
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 09 Sep 2014 04:40:47 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Tue Sep 09 04:40:47 2014 +0300 1.3 @@ -0,0 +1,34 @@ 1.4 +src = $(wildcard *.c) 1.5 +obj = $(src:.c=.o) 1.6 +bin = avrgame 1.7 +hex = $(bin).hex 1.8 +eep = $(bin).eep 1.9 + 1.10 +mcu_gcc = atmega328p 1.11 +mcu_dude = m328p 1.12 + 1.13 +CC = avr-gcc 1.14 +OBJCOPY = avr-objcopy 1.15 + 1.16 +CFLAGS = -O2 -pedantic -Wall -mmcu=$(mcu_gcc) -DF_CPU=1000000 1.17 +LDFLAGS = -Wl,-Map,$(bin).map -mmcu=$(mcu_gcc)# -Wl,-u,vfprintf -lprintf_flt -lm 1.18 + 1.19 +.PHONY: all 1.20 +all: $(hex) $(eep) 1.21 + 1.22 +$(bin): $(obj) 1.23 + $(CC) -o $@ $(obj) $(LDFLAGS) 1.24 + 1.25 +$(hex): $(bin) 1.26 + $(OBJCOPY) -j .text -j .data -O ihex -R .eeprom $< $@ 1.27 + 1.28 +$(eep): $(bin) 1.29 + $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@ 1.30 + 1.31 +.PHONY: program 1.32 +program: $(hex) 1.33 + avrdude -c usbtiny -p $(mcu_dude) -e -U flash:w:$(hex) 1.34 + 1.35 +.PHONY: clean 1.36 +clean: 1.37 + rm -f $(bin) $(obj) $(hex) $(eep) $(bin).map