a500kbd
annotate Makefile @ 1:3228a731d4db
translate scancodes
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Oct 2017 07:23:47 +0300 |
parents | 8e8e17a0f88e |
children | a4fd9c5a6655 |
rev | line source |
---|---|
nuclear@0 | 1 src = $(wildcard src/*.c) |
nuclear@0 | 2 obj = $(src:.c=.o) |
nuclear@0 | 3 bin = a500kbd |
nuclear@0 | 4 hex = $(bin).hex |
nuclear@0 | 5 eep = $(bin).eep |
nuclear@0 | 6 |
nuclear@1 | 7 mcu_gcc = atmega168 |
nuclear@1 | 8 mcu_dude = m168 |
nuclear@0 | 9 |
nuclear@0 | 10 CC = avr-gcc |
nuclear@0 | 11 OBJCOPY = avr-objcopy |
nuclear@0 | 12 |
nuclear@0 | 13 CFLAGS = -Os -pedantic -Wall -mmcu=$(mcu_gcc) -DXTAL=14745600 |
nuclear@0 | 14 LDFLAGS = -Wl,-Map,$(bin).map -mmcu=$(mcu_gcc) -lprintf_min |
nuclear@0 | 15 |
nuclear@0 | 16 .PHONY: all |
nuclear@0 | 17 all: $(hex) $(eep) |
nuclear@0 | 18 |
nuclear@0 | 19 $(bin): $(obj) |
nuclear@0 | 20 $(CC) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 21 |
nuclear@0 | 22 $(hex): $(bin) |
nuclear@0 | 23 $(OBJCOPY) -j .text -j .data -O ihex -R .eeprom $< $@ |
nuclear@0 | 24 |
nuclear@0 | 25 $(eep): $(bin) |
nuclear@0 | 26 $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@ |
nuclear@0 | 27 |
nuclear@0 | 28 .PHONY: fuses |
nuclear@0 | 29 fuses: |
nuclear@0 | 30 avrdude -c usbtiny -p $(mcu_dude) -U lfuse:w:0xe6:m -U hfuse:w:0xdf:m -U efuse:w:0xf9:m |
nuclear@0 | 31 |
nuclear@0 | 32 .PHONY: program |
nuclear@0 | 33 program: $(hex) |
nuclear@0 | 34 avrdude -c usbtiny -p $(mcu_dude) -e -U flash:w:$(hex) |
nuclear@0 | 35 |
nuclear@0 | 36 .PHONY: clean |
nuclear@0 | 37 clean: |
nuclear@0 | 38 rm -f $(bin) $(obj) $(hex) $(eep) $(bin).map |