Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | mjames | 1 | ############################################################################## |
| 2 | # Build global options |
||
| 3 | # NOTE: Can be overridden externally. |
||
| 4 | # |
||
| 5 | |||
| 6 | # Compiler options here. |
||
| 7 | ifeq ($(USE_OPT),) |
||
| 8 | USE_OPT = -O0 -g -ggdb -fomit-frame-pointer -falign-functions=16 |
||
| 9 | endif |
||
| 10 | |||
| 11 | |||
| 12 | # C specific options here (added to USE_OPT). |
||
| 13 | ifeq ($(USE_COPT),) |
||
| 14 | USE_COPT = |
||
| 15 | endif |
||
| 16 | |||
| 17 | # C++ specific options here (added to USE_OPT). |
||
| 18 | ifeq ($(USE_CPPOPT),) |
||
| 19 | USE_CPPOPT = -fno-rtti |
||
| 20 | endif |
||
| 21 | |||
| 22 | # Enable this if you want the linker to remove unused code and data |
||
| 23 | ifeq ($(USE_LINK_GC),) |
||
| 24 | USE_LINK_GC = yes |
||
| 25 | endif |
||
| 26 | |||
| 27 | # Linker extra options here. |
||
| 28 | ifeq ($(USE_LDOPT),) |
||
| 29 | USE_LDOPT = |
||
| 30 | endif |
||
| 31 | |||
| 32 | # Enable this if you want link time optimizations (LTO) |
||
| 33 | ifeq ($(USE_LTO),) |
||
| 34 | USE_LTO = yes |
||
| 35 | endif |
||
| 36 | |||
| 37 | # If enabled, this option allows to compile the application in THUMB mode. |
||
| 38 | ifeq ($(USE_THUMB),) |
||
| 39 | USE_THUMB = yes |
||
| 40 | endif |
||
| 41 | |||
| 42 | # Enable this if you want to see the full log while compiling. |
||
| 43 | ifeq ($(USE_VERBOSE_COMPILE),) |
||
| 44 | USE_VERBOSE_COMPILE = no |
||
| 45 | endif |
||
| 46 | |||
| 47 | # If enabled, this option makes the build process faster by not compiling |
||
| 48 | # modules not used in the current configuration. |
||
| 49 | ifeq ($(USE_SMART_BUILD),) |
||
| 50 | USE_SMART_BUILD = yes |
||
| 51 | endif |
||
| 52 | |||
| 53 | |||
| 54 | # |
||
| 55 | # Build global options |
||
| 56 | ############################################################################## |
||
| 57 | |||
| 58 | ############################################################################## |
||
| 59 | # Architecture or project specific options |
||
| 60 | # |
||
| 61 | |||
| 62 | # Stack size to be allocated to the Cortex-M process stack. This stack is |
||
| 63 | # the stack used by the main() thread. |
||
| 64 | ifeq ($(USE_PROCESS_STACKSIZE),) |
||
| 65 | USE_PROCESS_STACKSIZE = 0x400 |
||
| 66 | endif |
||
| 67 | |||
| 68 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This |
||
| 69 | # stack is used for processing interrupts and exceptions. |
||
| 70 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) |
||
| 71 | USE_EXCEPTIONS_STACKSIZE = 0x400 |
||
| 72 | endif |
||
| 73 | |||
| 74 | # Enables the use of FPU (no, softfp, hard). |
||
| 75 | ifeq ($(USE_FPU),) |
||
| 76 | USE_FPU = no |
||
| 77 | endif |
||
| 78 | |||
| 79 | # Enable this if you really want to use the STM FWLib. |
||
| 80 | ifeq ($(USE_FWLIB),) |
||
| 81 | USE_FWLIB = no |
||
| 82 | endif |
||
| 83 | |||
| 84 | # |
||
| 85 | # Architecture or project specific options |
||
| 86 | ############################################################################## |
||
| 87 | |||
| 88 | ############################################################################## |
||
| 89 | # Project, sources and paths |
||
| 90 | # |
||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | # Define project name here |
||
| 95 | PROJECT = ChibiGauge |
||
| 96 | #define board |
||
| 97 | BOARD = ST_bluePillF103 |
||
| 98 | |||
| 99 | CHIBIOS = c:/Projects/ChibiOS |
||
| 100 | CHIBIOS_CONTRIB = c:/Projects/ChibiOS/community |
||
| 101 | # Licensing files. |
||
| 102 | include $(CHIBIOS)/os/license/license.mk |
||
| 103 | # Startup files. |
||
| 104 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
||
| 105 | # HAL-OSAL files (optional). |
||
| 106 | include $(CHIBIOS_CONTRIB)/os/hal/hal.mk |
||
| 107 | include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F1xx/platform.mk |
||
| 108 | # board pinout file changed from chibiOS |
||
| 109 | include ./chibios/board/board.mk |
||
| 110 | include $(CHIBIOS)/os/hal/osal/rt/osal.mk |
||
| 111 | # RTOS files (optional). |
||
| 112 | include $(CHIBIOS)/os/rt/rt.mk |
||
| 113 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
||
| 114 | # Other files (optional). |
||
| 115 | include $(CHIBIOS)/test/lib/test.mk |
||
| 116 | include $(CHIBIOS)/test/rt/rt_test.mk |
||
| 117 | include $(CHIBIOS)/test/oslib/oslib_test.mk |
||
| 118 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk |
||
| 119 | include $(CHIBIOS)/os/various/shell/shell.mk |
||
| 120 | |||
| 121 | # Define linker script file here |
||
| 122 | LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld |
||
| 123 | |||
| 124 | |||
| 125 | ALLINC+= ./inc |
||
| 126 | |||
| 127 | ALLCSRC+= ./src/useAdc.c |
||
| 128 | |||
| 129 | # C sources that can be compiled in ARM or THUMB mode depending on the global |
||
| 130 | # setting. |
||
| 131 | CSRC = $(ALLCSRC) \ |
||
| 132 | usbcfg.c \ |
||
| 133 | shellCmds.c \ |
||
| 134 | main.c |
||
| 135 | |||
| 136 | VL53L0X = ../VL53L0X_1.0.2 |
||
| 137 | include $(VL53L0X)/vl53l0x.mk |
||
| 138 | |||
| 139 | |||
| 140 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global |
||
| 141 | # setting. |
||
| 142 | CPPSRC = $(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. |
||
| 147 | ACSRC = |
||
| 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. |
||
| 152 | ACPPSRC = |
||
| 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. |
||
| 157 | TCSRC = |
||
| 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. |
||
| 162 | TCPPSRC = |
||
| 163 | |||
| 164 | # List ASM source files here |
||
| 165 | ASMSRC = $(ALLASMSRC) |
||
| 166 | ASMXSRC = $(ALLXASMSRC) |
||
| 167 | |||
| 168 | |||
| 169 | INCDIR = $(ALLINC) \ |
||
| 170 | $(CHIBIOS)/os/various |
||
| 171 | |||
| 172 | # |
||
| 173 | # Project, sources and paths |
||
| 174 | ############################################################################## |
||
| 175 | |||
| 176 | ############################################################################## |
||
| 177 | # Compiler settings |
||
| 178 | # |
||
| 179 | |||
| 180 | MCU = cortex-m3 |
||
| 181 | |||
| 182 | #TRGT = arm-elf- |
||
| 183 | TRGT = arm-none-eabi- |
||
| 184 | CC = $(TRGT)gcc |
||
| 185 | CPPC = $(TRGT)g++ |
||
| 186 | # Enable loading with g++ only if you need C++ runtime support. |
||
| 187 | # NOTE: You can use C++ even without C++ support if you are careful. C++ |
||
| 188 | # runtime support makes code size explode. |
||
| 189 | LD = $(TRGT)gcc |
||
| 190 | #LD = $(TRGT)g++ |
||
| 191 | CP = $(TRGT)objcopy |
||
| 192 | AS = $(TRGT)gcc -x assembler-with-cpp |
||
| 193 | OD = $(TRGT)objdump |
||
| 194 | HEX = $(CP) -O ihex |
||
| 195 | BIN = $(CP) -O binary |
||
| 196 | SZ = touch |
||
| 197 | |||
| 198 | # ARM-specific options here |
||
| 199 | AOPT = |
||
| 200 | |||
| 201 | # THUMB-specific options here |
||
| 202 | TOPT = -mthumb -DTHUMB |
||
| 203 | |||
| 204 | # Define C warning options here |
||
| 205 | CWARN = -Wall -Wextra -Wstrict-prototypes |
||
| 206 | |||
| 207 | # Define C++ warning options here |
||
| 208 | CPPWARN = -Wall -Wextra |
||
| 209 | |||
| 210 | # |
||
| 211 | # Compiler settings |
||
| 212 | ############################################################################## |
||
| 213 | |||
| 214 | ############################################################################## |
||
| 215 | # Start of default section |
||
| 216 | # |
||
| 217 | |||
| 218 | # List all default C defines here, like -D_DEBUG=1 |
||
| 219 | DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2 |
||
| 220 | |||
| 221 | # List all default ASM defines here, like -D_DEBUG=1 |
||
| 222 | DADEFS = |
||
| 223 | |||
| 224 | # List all default directories to look for include files here |
||
| 225 | DINCDIR = |
||
| 226 | |||
| 227 | # List the default directory to look for the libraries here |
||
| 228 | DLIBDIR = |
||
| 229 | |||
| 230 | # List all default libraries here |
||
| 231 | DLIBS = |
||
| 232 | |||
| 233 | # |
||
| 234 | # End of default section |
||
| 235 | ############################################################################## |
||
| 236 | |||
| 237 | ############################################################################## |
||
| 238 | # Start of user section |
||
| 239 | # |
||
| 240 | |||
| 241 | # List all user C define here, like -D_DEBUG=1 |
||
| 242 | UDEFS = |
||
| 243 | |||
| 244 | # Define ASM defines here |
||
| 245 | UADEFS = |
||
| 246 | |||
| 247 | # List all user directories here |
||
| 248 | UINCDIR = |
||
| 249 | |||
| 250 | # List the user directory to look for the libraries here |
||
| 251 | ULIBDIR = |
||
| 252 | |||
| 253 | # List all user libraries here |
||
| 254 | ULIBS = -lm |
||
| 255 | |||
| 256 | # |
||
| 257 | # End of user defines |
||
| 258 | ############################################################################## |
||
| 259 | |||
| 260 | ifeq ($(USE_FWLIB),yes) |
||
| 261 | include $(CHIBIOS)/ext/stm32lib/stm32lib.mk |
||
| 262 | CSRC += $(STM32SRC) |
||
| 263 | INCDIR += $(STM32INC) |
||
| 264 | USE_OPT += -DUSE_STDPERIPH_DRIVER |
||
| 265 | endif |
||
| 266 | |||
| 267 | |||
| 268 | ############################################################################## |
||
| 269 | |||
| 270 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC |
||
| 271 | include $(RULESPATH)/rules.mk |
||
| 272 |