a500kbd

diff Makefile @ 0:8e8e17a0f88e

initial commit: serial comms up, kbd doesn't respond
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 12 Oct 2017 04:08:48 +0300
parents
children 3228a731d4db
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Thu Oct 12 04:08:48 2017 +0300
     1.3 @@ -0,0 +1,38 @@
     1.4 +src = $(wildcard src/*.c)
     1.5 +obj = $(src:.c=.o)
     1.6 +bin = a500kbd
     1.7 +hex = $(bin).hex
     1.8 +eep = $(bin).eep
     1.9 +
    1.10 +mcu_gcc = atmega88
    1.11 +mcu_dude = m88
    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:0xe6:m -U hfuse:w:0xdf:m -U efuse:w:0xf9: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