aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/demos/NRF51/MICROBIT/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/demos/NRF51/MICROBIT/Makefile')
-rw-r--r--lib/chibios-contrib/demos/NRF51/MICROBIT/Makefile217
1 files changed, 217 insertions, 0 deletions
diff --git a/lib/chibios-contrib/demos/NRF51/MICROBIT/Makefile b/lib/chibios-contrib/demos/NRF51/MICROBIT/Makefile
new file mode 100644
index 000000000..dba9f0a1d
--- /dev/null
+++ b/lib/chibios-contrib/demos/NRF51/MICROBIT/Makefile
@@ -0,0 +1,217 @@
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 -std=c11
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 = yes
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 Cortex-M process stack. This stack is
61# the stack used by the main() thread.
62ifeq ($(USE_PROCESS_STACKSIZE),)
63 USE_PROCESS_STACKSIZE = 0x200
64endif
65
66# Stack size to the allocated to the Cortex-M main/exceptions stack. This
67# stack is used for processing interrupts and exceptions.
68ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
69 USE_EXCEPTIONS_STACKSIZE = 0x400
70endif
71
72# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
73ifeq ($(USE_FPU),)
74 USE_FPU = no
75endif
76
77#
78# Architecture or project specific options
79##############################################################################
80
81##############################################################################
82# Project, sources and paths
83#
84
85# Define project name here
86PROJECT = ch
87
88# Imported source files and paths
89CHIBIOS = ../../../../ChibiOS
90CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
91# Licensing files.
92include $(CHIBIOS)/os/license/license.mk
93# Startup files.
94include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
95# HAL-OSAL files (optional).
96include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
97include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
98include $(CHIBIOS_CONTRIB)/os/hal/boards/MICROBIT/board.mk
99include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
100include $(CHIBIOS)/os/hal/lib/streams/streams.mk
101# RTOS files (optional).
102include $(CHIBIOS)/os/rt/rt.mk
103include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
104# Other files (optional).
105include $(CHIBIOS)/test/lib/test.mk
106include $(CHIBIOS)/test/rt/rt_test.mk
107include $(CHIBIOS)/test/oslib/oslib_test.mk
108
109# Define linker script file here
110LDSCRIPT= $(STARTUPLD_CONTRIB)/NRF51822.ld
111
112# C sources that can be compiled in ARM or THUMB mode depending on the global
113# setting.
114CSRC = $(ALLCSRC) \
115 $(TESTSRC) \
116 main.c
117
118# C++ sources that can be compiled in ARM or THUMB mode depending on the global
119# setting.
120CPPSRC = $(ALLCPPSRC)
121
122# C sources to be compiled in ARM mode regardless of the global setting.
123# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
124# option that results in lower performance and larger code size.
125ACSRC =
126
127# C++ sources to be compiled in ARM mode regardless of the global setting.
128# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
129# option that results in lower performance and larger code size.
130ACPPSRC =
131
132# C sources to be compiled in THUMB mode regardless of the global setting.
133# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
134# option that results in lower performance and larger code size.
135TCSRC =
136
137# C sources to be compiled in THUMB mode regardless of the global setting.
138# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
139# option that results in lower performance and larger code size.
140TCPPSRC =
141
142# List ASM source files here
143ASMSRC = $(ALLASMSRC)
144ASMXSRC = $(ALLXASMSRC)
145
146INCDIR = $(ALLINC) $(TESTINC) \
147 $(TESTHAL)
148
149#
150# Project, sources and paths
151##############################################################################
152
153##############################################################################
154# Compiler settings
155#
156
157MCU = cortex-m0
158
159TRGT = arm-none-eabi-
160CC = $(TRGT)gcc
161CPPC = $(TRGT)g++
162# Enable loading with g++ only if you need C++ runtime support.
163# NOTE: You can use C++ even without C++ support if you are careful. C++
164# runtime support makes code size explode.
165LD = $(TRGT)gcc
166#LD = $(TRGT)g++
167CP = $(TRGT)objcopy
168AS = $(TRGT)gcc -x assembler-with-cpp
169AR = $(TRGT)ar
170OD = $(TRGT)objdump
171SZ = $(TRGT)size
172HEX = $(CP) -O ihex
173BIN = $(CP) -O binary
174SREC = $(CP) -O srec
175
176# ARM-specific options here
177AOPT =
178
179# THUMB-specific options here
180TOPT = -mthumb -DTHUMB
181
182# Define C warning options here
183CWARN = -Wall -Wextra -Wstrict-prototypes
184
185# Define C++ warning options here
186CPPWARN = -Wall -Wextra
187
188#
189# Compiler settings
190##############################################################################
191
192##############################################################################
193# Start of user section
194#
195
196# List all user C define here, like -D_DEBUG=1
197UDEFS =
198
199# Define ASM defines here
200UADEFS =
201
202# List all user directories here
203UINCDIR =
204
205# List the user directory to look for the libraries here
206ULIBDIR =
207
208# List all user libraries here
209ULIBS =
210
211#
212# End of user defines
213##############################################################################
214
215RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk
216include $(RULESPATH)/rules.mk
217