rgbyteclock-code/Makefile

43 lines
846 B
Makefile
Raw Normal View History

2014-03-01 03:50:09 +01:00
PRG = rgbyteclock
2014-03-01 04:11:40 +01:00
OBJ = rgbyteclock.o timer.o lcd.o main.o rtc.o
2014-03-01 03:50:09 +01:00
MCU_TARGET = atmega16
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-01 04:11:40 +01:00
rgbyteclock.o: timer.o lcd.o rgbyteclock.h rtc.o
2014-03-01 03:50:09 +01:00
main.o: rgbyteclock.o
timer.o:timer.h
lcd.o: lcd.h
2014-03-01 04:11:40 +01:00
rtc.o: rtc.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 $< $@