-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
85 lines (66 loc) · 2.28 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
GIT_SHA = $(shell git rev-parse --short HEAD)
BUILD_TS = $(shell date +%Y-%m-%dT%H:%M:%S)
BINARY = els
################################################################################
# TFT
# ------------------------------------------------------------------------------
#
# Set the TFT to the display used. Some ILITEK ICs use a non-standard 556 16-bit
# colorspace.
#
# You can define the TFT and COLORS in Makefile.tft if needed.
#
################################################################################
-include Makefile.tft
TFT ?= ILI9481 # supported values ILI9481, ILI9486, ILI9488
COLORS ?= TFT_RGB_565
SRCS = $(wildcard src/*.c) $(wildcard src/tft/*.c) $(wildcard src/tft/fonts/*.c)
SRCS += $(wildcard src/bitmaps/*.c)
ifneq (, $(findstring ILI9481, $(TFT)))
SRCS += $(wildcard src/tft/drivers/ili948x.c)
CFLAGS += -DTFT_ILI9481 -D$(COLORS)
endif
ifneq (, $(findstring ILI9486, $(TFT)))
SRCS += $(wildcard src/tft/drivers/ili948x.c)
CFLAGS += -DTFT_ILI9486 -D$(COLORS)
endif
ifneq (, $(findstring ILI9488, $(TFT)))
SRCS += $(wildcard src/tft/drivers/ili948x.c)
CFLAGS += -DTFT_ILI9488 -D$(COLORS)
endif
-include Makefile.defines
OBJS = $(addprefix obj/, $(SRCS:.c=.o))
VERBOSE ?= 0
STLINK ?= 0
STM32F446 = 1
CFLAGS += -DGIT_SHA=\"$(GIT_SHA)\" -DBUILD_TS=\"$(BUILD_TS)\"
CFLAGS += -Isrc -DVERBOSE=$(VERBOSE)
CFLAGS += -std=gnu99 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16
CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Os
#CFLAGS += -DELS_DEBUG=1
#CFLAGS += -ffast-math
#CFLAGS += -frounding-math -fsignaling-nans -ffloat-store -ffp-contract=off
LDFLAGS += -u _printf_float -lnosys --specs=nano.specs
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
LDLIBS += -lm
V ?= 1
STM32F4xx = 1
CFLAGS += -DSTM32F446 -DSTM32F4xx
LDSCRIPT = linker/stm32f446re.ld
include Makefile.include
.DEFAULT_GOAL := default
default: $(BINARY).hex size
ifeq ($(STLINK), 1)
flash: $(BINARY).hex
st-flash --freq=4m --format=ihex write $(BINARY).hex
else
flash: $(BINARY).hex
JLinkExe -if swd -device stm32f446re -speed 4000 jlink/flash.cmd
endif
ifneq ($(STLINK), 1)
reset:
JLinkExe -if swd -device stm32f446re -speed 4000 jlink/reset.cmd
endif
size: $(BINARY).elf
$(SIZE) $<
.PHONY: flash size default