aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/demos/various/RT-ARM7-GENERIC/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/demos/various/RT-ARM7-GENERIC/Makefile')
-rw-r--r--lib/chibios/demos/various/RT-ARM7-GENERIC/Makefile243
1 files changed, 243 insertions, 0 deletions
diff --git a/lib/chibios/demos/various/RT-ARM7-GENERIC/Makefile b/lib/chibios/demos/various/RT-ARM7-GENERIC/Makefile
new file mode 100644
index 000000000..ffbf049ad
--- /dev/null
+++ b/lib/chibios/demos/various/RT-ARM7-GENERIC/Makefile
@@ -0,0 +1,243 @@
1##############################################################################
2# Build global options
3# NOTE: Can be overridden externally.
4#
5
6# Compiler options here.
7ifeq ($(USE_OPT),)
8 USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
9endif
10
11# C specific options here (added to USE_OPT).
12ifeq ($(USE_COPT),)
13 USE_COPT =
14endif
15
16# C++ specific options here (added to USE_OPT).
17ifeq ($(USE_CPPOPT),)
18 USE_CPPOPT = -fno-rtti
19endif
20
21# Enable this if you want the linker to remove unused code and data
22ifeq ($(USE_LINK_GC),)
23 USE_LINK_GC = yes
24endif
25
26# Linker extra options here.
27ifeq ($(USE_LDOPT),)
28 USE_LDOPT =
29endif
30
31# Enable this if you want link time optimizations (LTO)
32ifeq ($(USE_LTO),)
33 USE_LTO = yes
34endif
35
36# If enabled, this option allows to compile the application in THUMB mode.
37ifeq ($(USE_THUMB),)
38 USE_THUMB = no
39endif
40
41# Enable this if you want to see the full log while compiling.
42ifeq ($(USE_VERBOSE_COMPILE),)
43 USE_VERBOSE_COMPILE = no
44endif
45
46# If enabled, this option makes the build process faster by not compiling
47# modules not used in the current configuration.
48ifeq ($(USE_SMART_BUILD),)
49 USE_SMART_BUILD = yes
50endif
51
52#
53# Build global options
54##############################################################################
55
56##############################################################################
57# Architecture or project specific options
58#
59
60# Stack size to be allocated to the ARM System/User stack. This
61# stack is the stack used by the main() thread.
62ifeq ($(USE_SYSTEM_STACKSIZE),)
63 USE_SYSTEM_STACKSIZE = 0x400
64endif
65
66# Stack size to the allocated to the ARM IRQ stack. This
67# stack is used for processing interrupts and exceptions.
68ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
69 USE_IRQ_STACKSIZE = 0x400
70endif
71
72# Stack size to the allocated to the ARM FIQ stack. This
73# stack is used for processing interrupts and exceptions.
74ifeq ($(USE_FIQ_STACKSIZE),)
75 USE_FIQ_STACKSIZE = 64
76endif
77
78# Stack size to the allocated to the ARM Supervisor stack. This
79# stack is used for processing interrupts and exceptions.
80ifeq ($(USE_SUPERVISOR_STACKSIZE),)
81 USE_SUPERVISOR_STACKSIZE = 8
82endif
83
84# Stack size to the allocated to the ARM Undefined stack. This
85# stack is used for processing interrupts and exceptions.
86ifeq ($(USE_UND_STACKSIZE),)
87 USE_UND_STACKSIZE = 8
88endif
89
90# Stack size to the allocated to the ARM Abort stack. This
91# stack is used for processing interrupts and exceptions.
92ifeq ($(USE_ABT_STACKSIZE),)
93 USE_ABT_STACKSIZE = 8
94endif
95
96# Enables the use of FPU.
97ifeq ($(USE_FPU),)
98 USE_FPU = no
99endif
100
101#
102# Architecture or project specific options
103##############################################################################
104
105##############################################################################
106# Project, sources and paths
107#
108
109# Define project name here
110PROJECT = ch
111
112# Imported source files and paths
113CHIBIOS = ../../..
114# Licensing files.
115include $(CHIBIOS)/os/license/license.mk
116# Startup files.
117include $(CHIBIOS)/os/common/startup/ARM/compilers/GCC/mk/startup_lpc214x.mk
118# HAL-OSAL files (optional).
119#include $(CHIBIOS)/os/hal/hal.mk
120#include $(CHIBIOS)/os/hal/ports/LPC/LPC214x/platform.mk
121#include $(CHIBIOS)/os/hal/boards/OLIMEX_LPC_P2148/board.mk
122#include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
123# RTOS files (optional).
124include $(CHIBIOS)/os/rt/rt.mk
125include $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/mk/port_generic.mk
126# Other files (optional).
127#include $(CHIBIOS)/test/lib/test.mk
128#include $(CHIBIOS)/test/rt/rt_test.mk
129#include $(CHIBIOS)/test/oslib/oslib_test.mk
130
131# Define linker script file here
132LDSCRIPT= $(STARTUPLD)/LPC2148.ld
133
134# C sources that can be compiled in ARM or THUMB mode depending on the global
135# setting.
136CSRC = $(ALLCSRC) \
137 $(TESTSRC) \
138 main.c
139
140# C++ sources that can be compiled in ARM or THUMB mode depending on the global
141# setting.
142CPPSRC = $(ALLCPPSRC)
143
144# C sources to be compiled in ARM mode regardless of the global setting.
145# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
146# option that results in lower performance and larger code size.
147ACSRC =
148
149# C++ sources to be compiled in ARM mode regardless of the global setting.
150# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
151# option that results in lower performance and larger code size.
152ACPPSRC =
153
154# C sources to be compiled in THUMB mode regardless of the global setting.
155# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
156# option that results in lower performance and larger code size.
157TCSRC =
158
159# C sources to be compiled in THUMB mode regardless of the global setting.
160# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
161# option that results in lower performance and larger code size.
162TCPPSRC =
163
164# List ASM source files here
165ASMSRC = $(ALLASMSRC)
166ASMXSRC = $(ALLXASMSRC)
167
168INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
169
170#
171# Project, sources and paths
172##############################################################################
173
174##############################################################################
175# Compiler settings
176#
177
178MCU = arm7tdmi
179
180#TRGT = arm-elf-
181TRGT = arm-none-eabi-
182CC = $(TRGT)gcc
183CPPC = $(TRGT)g++
184# Enable loading with g++ only if you need C++ runtime support.
185# NOTE: You can use C++ even without C++ support if you are careful. C++
186# runtime support makes code size explode.
187LD = $(TRGT)gcc
188#LD = $(TRGT)g++
189CP = $(TRGT)objcopy
190AS = $(TRGT)gcc -x assembler-with-cpp
191AR = $(TRGT)ar
192OD = $(TRGT)objdump
193SZ = $(TRGT)size
194HEX = $(CP) -O ihex
195BIN = $(CP) -O binary
196
197# ARM-specific options here
198AOPT =
199
200# THUMB-specific options here
201TOPT = -mthumb -DTHUMB
202
203# Define C warning options here
204CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
205
206# Define C++ warning options here
207CPPWARN = -Wall -Wextra -Wundef
208
209#
210# Compiler settings
211##############################################################################
212
213##############################################################################
214# Start of user section
215#
216
217# List all user C define here, like -D_DEBUG=1
218UDEFS =
219
220# Define ASM defines here
221UADEFS =
222
223# List all user directories here
224UINCDIR =
225
226# List the user directory to look for the libraries here
227ULIBDIR =
228
229# List all user libraries here
230ULIBS =
231
232#
233# End of user defines
234##############################################################################
235
236RULESPATH = $(CHIBIOS)/os/common/startup/ARM/compilers/GCC
237include $(RULESPATH)/rules.mk
238
239##############################################################################
240# MISRA check rule, requires PCLint and the setup files, not provided.
241#
242misra:
243 @lint-nt -v -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) &> misra.txt