test_simm30_dram

diff Makefile @ 0:c47d05df0667

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 07 Mar 2017 23:50:45 +0200
parents
children 318a758ede82
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Tue Mar 07 23:50:45 2017 +0200
     1.3 @@ -0,0 +1,38 @@
     1.4 +src = $(wildcard *.c)
     1.5 +obj = $(src:.c=.o)
     1.6 +bin = test_ftdi
     1.7 +hex = $(bin).hex
     1.8 +eep = $(bin).eep
     1.9 +
    1.10 +mcu_gcc = atmega644p
    1.11 +mcu_dude = m644p
    1.12 +
    1.13 +CC = avr-gcc
    1.14 +OBJCOPY = avr-objcopy
    1.15 +
    1.16 +CFLAGS = -Os -pedantic -Wall -mmcu=$(mcu_gcc) -DXTAL=14745600
    1.17 +LDFLAGS = -Wl,-Map,$(bin).map -mmcu=$(mcu_gcc) -lprintf_min
    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: fuses
    1.32 +fuses:
    1.33 +	avrdude -c usbtiny -p $(mcu_dude) -U lfuse:w:0xf7:m -U hfuse:w:0x99:m -U efuse:w:0xff:m
    1.34 +
    1.35 +.PHONY: program
    1.36 +program: $(hex)
    1.37 +	avrdude -c usbtiny -p $(mcu_dude) -e -U flash:w:$(hex)
    1.38 +
    1.39 +.PHONY: clean
    1.40 +clean:
    1.41 +	rm -f $(bin) $(obj) $(hex) $(eep) $(bin).map