forked from ReservedField/evic-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (44 loc) · 1.21 KB
/
Makefile
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
59
TARGET = libevicsdk
NUVOSDK = $(EVICSDK)/nuvoton-sdk/Library
OBJS = $(NUVOSDK)/Device/Nuvoton/M451Series/Source/system_M451Series.o \
$(NUVOSDK)/StdDriver/src/clk.o \
$(NUVOSDK)/StdDriver/src/fmc.o \
$(NUVOSDK)/StdDriver/src/gpio.o \
$(NUVOSDK)/StdDriver/src/spi.o \
$(NUVOSDK)/StdDriver/src/sys.o \
$(NUVOSDK)/StdDriver/src/timer.o \
src/startup/init.o \
src/dataflash/Dataflash.o \
src/display/Display_SSD.o \
src/display/Display_SSD1306.o \
src/display/Display_SSD1327.o \
src/display/Display.o \
src/timer/Timer.o \
src/font/Font_DejaVuSansMono_8pt.o
OUTDIR = lib
DOCDIR = doc
CPU = cortex-m4
CC = arm-none-eabi-gcc
AS = arm-none-eabi-as
AR = arm-none-eabi-ar
OBJCOPY = arm-none-eabi-objcopy
INCDIRS = -I$(NUVOSDK)/CMSIS/Include
INCDIRS += -I$(NUVOSDK)/Device/Nuvoton/M451Series/Include
INCDIRS += -I$(NUVOSDK)/StdDriver/inc
INCDIRS += -Iinclude
CFLAGS = -Wall -mcpu=$(CPU) -mthumb -Os
CFLAGS += $(INCDIRS)
ASFLAGS = -mcpu=$(CPU)
all: $(TARGET).a
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(TARGET).a: $(OBJS)
mkdir -p $(OUTDIR)
$(AR) -rv $(OUTDIR)/$(TARGET).a $(OBJS)
docs:
doxygen
clean:
rm -rf $(OBJS) $(OUTDIR)/$(TARGET).a $(OUTDIR) $(DOCDIR)
.PHONY: all clean docs