rgbyteclock-code/Makefile

47 lines
1.0 KiB
Makefile
Raw Normal View History

2014-03-01 03:50:09 +01:00
PRG = rgbyteclock
2014-03-02 07:18:48 +01:00
OBJ = rgbyteclock.o timer.o lcd.o main.o rtc.o spi.o ringbuffer.o crc.o ledcontroller.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=16000000UL -std=gnu99 -mmcu=$(MCU_TARGET) $(DEFS)
override LDFLAGS = -Wl,-Map,$(PRG).map
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size -A
all: $(PRG).hex
$(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-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:
rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak
rm -rf *.lst *.map $(EXTRA_CLEAN_FILES)
hex: $(PRG).hex
%.hex: %.elf
$(OBJCOPY) -j .text -j .data -O ihex $< $@