rgbyteclock-code/Makefile

60 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2014-03-01 03:50:09 +01:00
PRG = rgbyteclock
2014-03-18 01:04:18 +01:00
OBJ = rgbyteclock.o timer.o lcd.o main.o rtc.o spi.o ringbuffer.o crc.o ledcontroller.o led1642gw.o
MCU_TARGET = atmega164a
2014-03-01 03:50:09 +01:00
OPTIMIZE = -Os
DEFS =
LIBS =
CC = avr-gcc
override CFLAGS = -g -Wall $(OPTIMIZE) -DF_CPU=20000000UL -std=gnu99 -mmcu=$(MCU_TARGET) $(DEFS)
2014-03-01 03:50:09 +01:00
override LDFLAGS = -Wl,-Map,$(PRG).map
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size -A
2014-03-06 23:43:32 +01:00
all: $(PRG).hex $(PRG).bin
2014-03-01 03:50:09 +01:00
$(PRG).elf: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
@echo
@$(SIZE) $@
@echo
# dependency:
2014-03-02 07:18:48 +01:00
rgbyteclock.o: timer.o lcd.o rgbyteclock.h rtc.o spi.o ledcontroller.o
2014-03-03 05:01:36 +01:00
main.o: rgbyteclock.o lcd.o spi.o ledcontroller.o rtc.o timer.o
2014-03-18 01:04:18 +01:00
ledcontroller.o: led1642gw.o
led1642gw.o: led1642gw.h led1642gw_config.h
2014-03-01 23:52:49 +01:00
timer.o: timer.h
lcd.o: lcd.h timer.o
2014-03-01 04:11:40 +01:00
rtc.o: rtc.h
2014-03-01 23:52:49 +01:00
spi.o: spi.h crc.o ringbuffer.o
ringbuffer.o: ringbuffer.h
crc.o: crc.h
2014-03-02 07:18:48 +01:00
ledcontroller.o: ledcontroller.h
2014-03-01 03:50:09 +01:00
clean:
2014-03-13 20:34:54 +01:00
rm -rf *.o $(PRG).elf $(PRG).bin $(PRG).hex *.eps *.png *.pdf *.bak
2014-03-01 03:50:09 +01:00
rm -rf *.lst *.map $(EXTRA_CLEAN_FILES)
hex: $(PRG).hex
2014-03-06 23:43:32 +01:00
bin: $(PRG).bin
2014-03-01 03:50:09 +01:00
%.hex: %.elf
$(OBJCOPY) -j .text -j .data -O ihex $< $@
%.bin: %.elf
$(OBJCOPY) -j .text -j .data -O binary $< $@
2014-03-08 23:52:30 +01:00
prg: $(PRG).bin
#python2 megaHidProg.py -C -c 1000 -t 4 -b $(PRG).bin
python2 ./megaHidProg.py -C -c 3000 -t 15 -b $(PRG).bin -T 15 -V $(PRG).bin
setfuses:
python2 megaHidProg.py -C -S -c 125 -L be -H d9 -E FC