-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (43 loc) · 1.29 KB
/
Makefile
File metadata and controls
58 lines (43 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Makefile to build libtft
#
# Simplified version from: https://github.com/hexagon5un/AVR-Programming
# https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html
# avr-gcc -mmcu=atmega328p -print-multi-directory
# MCU = avr5
# avr-gcc -mmcu=avr64ea28 -print-multi-directory
MCU = avrxmega2
MAIN = libtft.c
SRC = font.c hack.c unifont.c
CC = avr-gcc
AR = avr-ar
OBJDUMP = avr-objdump
CFLAGS = -mmcu=$(MCU)
CFLAGS += -O2 -I.
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -Wall -Wstrict-prototypes
CFLAGS += -g -ggdb
CFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections -mrelax
CFLAGS += -std=gnu99
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
# CFLAGS += --param=min-pagesize=0
CFLAGS += -c
ARFLAGS = rcs
MAKEFLAGS += -r
TARGET = $(strip $(basename $(MAIN)))
SRC += $(TARGET).c
OBJ = $(SRC:.c=.o)
OBJ = $(SRC:.S=.o)
$(TARGET).o: libtft.h font.h hack.h unifont.h types.h utils.h Makefile
all: $(TARGET).a
%.a: %.o
$(AR) $(ARFLAGS) $(TARGET).a $(TARGET).o font.o hack.o unifont.o
%.o: $(SRC)
$(CC) $(CFLAGS) $(SRC)
disasm: $(TARGET).lst
%.lst: %.o
$(OBJDUMP) -S $< > $@
clean:
rm -f $(TARGET).a $(TARGET).hex $(TARGET).obj \
$(TARGET).o $(TARGET).d $(TARGET).eep $(TARGET).lst \
$(TARGET).lss $(TARGET).sym $(TARGET).map $(TARGET)~ \
$(TARGET).eeprom