avr_test_simm72_dram

view Makefile @ 2:42d26388b709

memory detection works
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 09 Mar 2017 01:40:31 +0200
parents c47d05df0667
children
line source
1 src = $(wildcard *.c)
2 obj = $(src:.c=.o)
3 bin = test_simm72_dram
4 hex = $(bin).hex
5 eep = $(bin).eep
7 mcu_gcc = atmega644p
8 mcu_dude = m644p
10 CC = avr-gcc
11 OBJCOPY = avr-objcopy
13 CFLAGS = -Os -pedantic -Wall -mmcu=$(mcu_gcc) -DXTAL=14745600
14 LDFLAGS = -Wl,-Map,$(bin).map -mmcu=$(mcu_gcc) -lprintf_min
16 .PHONY: all
17 all: $(hex) $(eep)
19 $(bin): $(obj)
20 $(CC) -o $@ $(obj) $(LDFLAGS)
22 $(hex): $(bin)
23 $(OBJCOPY) -j .text -j .data -O ihex -R .eeprom $< $@
25 $(eep): $(bin)
26 $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@
28 .PHONY: fuses
29 fuses:
30 avrdude -c usbtiny -p $(mcu_dude) -U lfuse:w:0xf7:m -U hfuse:w:0x99:m -U efuse:w:0xff:m
32 .PHONY: program
33 program: $(hex)
34 avrdude -c usbtiny -p $(mcu_dude) -e -U flash:w:$(hex)
36 .PHONY: clean
37 clean:
38 rm -f $(bin) $(obj) $(hex) $(eep) $(bin).map