Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 7 | Rev 8 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | ############################################################################## |
1 | ############################################################################## |
| 2 | # Build global options |
2 | # Build global options |
| 3 | # NOTE: Can be overridden externally. |
3 | # NOTE: Can be overridden externally. |
| 4 | # |
4 | # |
| 5 | 5 | ||
| - | 6 | ||
| 6 | # Compiler options here. |
7 | # Compiler options here. |
| 7 | ifeq ($(USE_OPT),) |
8 | ifeq ($(USE_OPT),) |
| 8 | USE_OPT = -Os -g -ggdb -fomit-frame-pointer -falign-functions=16 |
9 | USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 |
| 9 | endif |
10 | endif |
| 10 | 11 | ||
| 11 | - | ||
| 12 | # C specific options here (added to USE_OPT). |
12 | # C specific options here (added to USE_OPT). |
| 13 | ifeq ($(USE_COPT),) |
13 | ifeq ($(USE_COPT),) |
| 14 | USE_COPT = |
14 | USE_COPT = |
| 15 | endif |
15 | endif |
| 16 | 16 | ||
| Line 39... | Line 39... | ||
| 39 | USE_THUMB = yes |
39 | USE_THUMB = yes |
| 40 | endif |
40 | endif |
| 41 | 41 | ||
| 42 | # Enable this if you want to see the full log while compiling. |
42 | # Enable this if you want to see the full log while compiling. |
| 43 | ifeq ($(USE_VERBOSE_COMPILE),) |
43 | ifeq ($(USE_VERBOSE_COMPILE),) |
| 44 | USE_VERBOSE_COMPILE = no |
44 | USE_VERBOSE_COMPILE = yes |
| 45 | endif |
45 | endif |
| 46 | 46 | ||
| 47 | # If enabled, this option makes the build process faster by not compiling |
47 | # If enabled, this option makes the build process faster by not compiling |
| 48 | # modules not used in the current configuration. |
48 | # modules not used in the current configuration. |
| 49 | ifeq ($(USE_SMART_BUILD),) |
49 | ifeq ($(USE_SMART_BUILD),) |
| 50 | USE_SMART_BUILD = yes |
50 | USE_SMART_BUILD = yes |
| 51 | endif |
51 | endif |
| 52 | 52 | ||
| 53 | - | ||
| 54 | # |
53 | # |
| 55 | # Build global options |
54 | # Build global options |
| 56 | ############################################################################## |
55 | ############################################################################## |
| 57 | 56 | ||
| 58 | ############################################################################## |
57 | ############################################################################## |
| Line 74... | Line 73... | ||
| 74 | # Enables the use of FPU (no, softfp, hard). |
73 | # Enables the use of FPU (no, softfp, hard). |
| 75 | ifeq ($(USE_FPU),) |
74 | ifeq ($(USE_FPU),) |
| 76 | USE_FPU = no |
75 | USE_FPU = no |
| 77 | endif |
76 | endif |
| 78 | 77 | ||
| - | 78 | ||
| 79 | # Enable this if you really want to use the STM FWLib. |
79 | # Enable this if you really want to use the STM FWLib. |
| 80 | ifeq ($(USE_FWLIB),) |
80 | ifeq ($(USE_FWLIB),) |
| 81 | USE_FWLIB = no |
81 | USE_FWLIB = no |
| 82 | endif |
82 | endif |
| 83 | 83 | ||
| Line 94... | Line 94... | ||
| 94 | # Define project name here |
94 | # Define project name here |
| 95 | PROJECT = ChibiGauge |
95 | PROJECT = ChibiGauge |
| 96 | #define board |
96 | #define board |
| 97 | BOARD = ST_bluePillF103 |
97 | BOARD = ST_bluePillF103 |
| 98 | 98 | ||
| 99 | CHIBIOS = c:/Projects/ChibiOS |
99 | CHIBIOS = c:/Projects/ChibiOS_21.11.4 |
| 100 | CHIBIOS_CONTRIB = c:/Projects/ChibiOS/community |
100 | CHIBIOS_CONTRIB = c:/Projects/ChibiOS_21.11.4/community |
| - | 101 | CONFDIR := ./cfg |
|
| - | 102 | BUILDDIR := ./build |
|
| - | 103 | DEPDIR := ./.dep |
|
| 101 | # Licensing files. |
104 | # Licensing files. |
| 102 | include $(CHIBIOS)/os/license/license.mk |
105 | include $(CHIBIOS)/os/license/license.mk |
| 103 | # Startup files. |
106 | # Startup files. |
| 104 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
107 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
| 105 | # HAL-OSAL files (optional). |
108 | # HAL-OSAL files (optional). |
| 106 | include $(CHIBIOS_CONTRIB)/os/hal/hal.mk |
109 | include $(CHIBIOS)/os/hal/hal.mk |
| 107 | include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F1xx/platform.mk |
110 | include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk |
| 108 | # board pinout file changed from chibiOS |
111 | # board pinout file changed from chibiOS |
| 109 | include ./chibios/board/board.mk |
112 | include ./chibios/board/board.mk |
| 110 | include $(CHIBIOS)/os/hal/osal/rt/osal.mk |
113 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk |
| 111 | # RTOS files (optional). |
114 | # RTOS files (optional). |
| 112 | include $(CHIBIOS)/os/rt/rt.mk |
115 | include $(CHIBIOS)/os/rt/rt.mk |
| 113 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
116 | include $(CHIBIOS)/os/common/ports/ARMv7-M/compilers/GCC/mk/port.mk |
| - | 117 | # Auto-build files in ./source recursively. |
|
| - | 118 | include $(CHIBIOS)/tools/mk/autobuild.mk |
|
| 114 | # Other files (optional). |
119 | # Other files (optional). |
| 115 | include $(CHIBIOS)/test/lib/test.mk |
120 | include $(CHIBIOS)/os/test/test.mk |
| 116 | include $(CHIBIOS)/test/rt/rt_test.mk |
121 | include $(CHIBIOS)/test/rt/rt_test.mk |
| 117 | include $(CHIBIOS)/test/oslib/oslib_test.mk |
122 | include $(CHIBIOS)/test/oslib/oslib_test.mk |
| 118 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk |
123 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk |
| - | 124 | include $(CHIBIOS)/test/rt/rt_test.mk |
|
| 119 | include $(CHIBIOS)/os/various/shell/shell.mk |
125 | include $(CHIBIOS)/os/various/shell/shell.mk |
| 120 | 126 | ||
| 121 | # Define linker script file here |
127 | # Define linker script file here |
| 122 | LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld |
128 | LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld |
| 123 | 129 | ||
| 124 | 130 | ||
| 125 | ALLINC+= ./inc |
131 | ALLINC+= ./inc |
| - | 132 | ALLINC+= $(CONFDIR) |
|
| - | 133 | ALLINC+= $(TESTINC) |
|
| 126 | 134 | ||
| 127 | ALLCSRC+= ./src/useAdc.c |
- | |
| 128 | - | ||
| 129 | ALLCPPSRC+= ./sht21_lib/sht21.cpp |
- | |
| 130 | ALLINC += ./sht21_lib |
- | |
| 131 | 135 | ||
| 132 | # C sources that can be compiled in ARM or THUMB mode depending on the global |
136 | # C sources that can be compiled in ARM or THUMB mode depending on the global |
| 133 | # setting. |
137 | # setting. |
| 134 | CSRC = $(ALLCSRC) \ |
138 | CSRC = $(ALLCSRC) \ |
| 135 | usbcfg.c \ |
- | |
| 136 | shellCmds.c \ |
139 | shellCmds.c \ |
| 137 | useLidar.c \ |
- | |
| 138 | spiInterface.c \ |
140 | spiInterface.c \ |
| 139 | main.c |
141 | main.c |
| 140 | 142 | ||
| 141 | # Get the Lidar library |
- | |
| 142 | VL53L0X = ../VL53L0X_1.0.2 |
- | |
| 143 | include $(VL53L0X)/vl53l0x.mk |
- | |
| 144 | - | ||
| 145 | # Get the SPI OLED library |
143 | # Get the SPI OLED library |
| 146 | SSD1306 = ../SSD1306_lib |
144 | SSD1306 = ../SSD1306_lib |
| 147 | include $(SSD1306)/ssd1306.mk |
145 | include $(SSD1306)/ssd1306.mk |
| 148 | 146 | ||
| 149 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global |
147 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global |
| 150 | # setting. |
148 | # setting. |
| 151 | CPPSRC = $(ALLCPPSRC) |
149 | CPPSRC = $(ALLCPPSRC) |
| 152 | 150 | ||
| Line 200... | Line 198... | ||
| 200 | CP = $(TRGT)objcopy |
198 | CP = $(TRGT)objcopy |
| 201 | AS = $(TRGT)gcc -x assembler-with-cpp |
199 | AS = $(TRGT)gcc -x assembler-with-cpp |
| 202 | OD = $(TRGT)objdump |
200 | OD = $(TRGT)objdump |
| 203 | HEX = $(CP) -O ihex |
201 | HEX = $(CP) -O ihex |
| 204 | BIN = $(CP) -O binary |
202 | BIN = $(CP) -O binary |
| 205 | SZ = touch |
203 | SZ = echo |
| 206 | 204 | ||
| 207 | # ARM-specific options here |
205 | # ARM-specific options here |
| 208 | AOPT = |
206 | AOPT = |
| 209 | 207 | ||
| 210 | # THUMB-specific options here |
208 | # THUMB-specific options here |
| Line 223... | Line 221... | ||
| 223 | ############################################################################## |
221 | ############################################################################## |
| 224 | # Start of default section |
222 | # Start of default section |
| 225 | # |
223 | # |
| 226 | 224 | ||
| 227 | # List all default C defines here, like -D_DEBUG=1 |
225 | # List all default C defines here, like -D_DEBUG=1 |
| 228 | DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2 |
226 | DDEFS = -DSTDOUT_SD=SD1 -DSTDIN_SD=SD1 |
| 229 | 227 | ||
| 230 | # List all default ASM defines here, like -D_DEBUG=1 |
228 | # List all default ASM defines here, like -D_DEBUG=1 |
| 231 | DADEFS = |
229 | DADEFS = |
| 232 | 230 | ||
| 233 | # List all default directories to look for include files here |
231 | # List all default directories to look for include files here |
| Line 274... | Line 272... | ||
| 274 | endif |
272 | endif |
| 275 | 273 | ||
| 276 | 274 | ||
| 277 | ############################################################################## |
275 | ############################################################################## |
| 278 | 276 | ||
| - | 277 | ||
| - | 278 | ||
| 279 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC |
279 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk |
| - | 280 | include $(RULESPATH)/arm-none-eabi.mk |
|
| 280 | include $(RULESPATH)/rules.mk |
281 | include $(RULESPATH)/rules.mk |
| 281 | 282 | ||
| - | 283 | ||