Add PID and Rate profile names, osd elements and cli config (#7696)
[betaflight.git] / make / source.mk
blob0e2c9098e970aba782f89332d8515b1c7fa41bae
1 COMMON_SRC = \
2 build/build_config.c \
3 build/debug.c \
4 build/version.c \
5 $(TARGET_DIR_SRC) \
6 main.c \
7 $(addprefix pg/,$(notdir $(wildcard $(SRC_DIR)/pg/*.c))) \
8 $(addprefix common/,$(notdir $(wildcard $(SRC_DIR)/common/*.c))) \
9 $(addprefix config/,$(notdir $(wildcard $(SRC_DIR)/config/*.c))) \
10 cli/cli.c \
11 cli/settings.c \
12 drivers/adc.c \
13 drivers/buf_writer.c \
14 drivers/bus.c \
15 drivers/bus_i2c_config.c \
16 drivers/bus_i2c_busdev.c \
17 drivers/bus_i2c_soft.c \
18 drivers/bus_spi.c \
19 drivers/bus_spi_config.c \
20 drivers/bus_spi_pinconfig.c \
21 drivers/buttons.c \
22 drivers/display.c \
23 drivers/dma_reqmap.c \
24 drivers/exti.c \
25 drivers/io.c \
26 drivers/light_led.c \
27 drivers/mco.c \
28 drivers/pinio.c \
29 drivers/resource.c \
30 drivers/rcc.c \
31 drivers/serial.c \
32 drivers/serial_pinconfig.c \
33 drivers/serial_uart.c \
34 drivers/serial_uart_pinconfig.c \
35 drivers/sound_beeper.c \
36 drivers/stack_check.c \
37 drivers/system.c \
38 drivers/timer_common.c \
39 drivers/timer.c \
40 drivers/transponder_ir_arcitimer.c \
41 drivers/transponder_ir_ilap.c \
42 drivers/transponder_ir_erlt.c \
43 fc/board_info.c \
44 fc/config.c \
45 fc/dispatch.c \
46 fc/hardfaults.c \
47 fc/tasks.c \
48 fc/runtime_config.c \
49 fc/stats.c \
50 io/beeper.c \
51 io/piniobox.c \
52 io/serial.c \
53 io/smartaudio_protocol.c \
54 io/statusindicator.c \
55 io/tramp_protocol.c \
56 io/transponder_ir.c \
57 io/usb_cdc_hid.c \
58 io/usb_msc.c \
59 msp/msp.c \
60 msp/msp_box.c \
61 msp/msp_serial.c \
62 scheduler/scheduler.c \
63 sensors/adcinternal.c \
64 sensors/battery.c \
65 sensors/current.c \
66 sensors/voltage.c \
67 target/config_helper.c \
68 fc/init.c \
69 fc/controlrate_profile.c \
70 drivers/camera_control.c \
71 drivers/accgyro/gyro_sync.c \
72 drivers/pwm_esc_detect.c \
73 drivers/pwm_output.c \
74 drivers/rx/rx_spi.c \
75 drivers/rx/rx_xn297.c \
76 drivers/rx/rx_pwm.c \
77 drivers/serial_softserial.c \
78 fc/core.c \
79 fc/rc.c \
80 fc/rc_adjustments.c \
81 fc/rc_controls.c \
82 fc/rc_modes.c \
83 flight/position.c \
84 flight/failsafe.c \
85 flight/gps_rescue.c \
86 flight/gyroanalyse.c \
87 flight/imu.c \
88 flight/mixer.c \
89 flight/mixer_tricopter.c \
90 flight/pid.c \
91 flight/rpm_filter.c \
92 flight/servos.c \
93 flight/servos_tricopter.c \
94 io/serial_4way.c \
95 io/serial_4way_avrootloader.c \
96 io/serial_4way_stk500v2.c \
97 rx/ibus.c \
98 rx/jetiexbus.c \
99 rx/msp.c \
100 rx/pwm.c \
101 rx/rx.c \
102 rx/rx_spi.c \
103 rx/rx_spi_common.c \
104 rx/crsf.c \
105 rx/sbus.c \
106 rx/sbus_channels.c \
107 rx/spektrum.c \
108 io/spektrum_vtx_control.c \
109 io/spektrum_rssi.c \
110 rx/sumd.c \
111 rx/sumh.c \
112 rx/xbus.c \
113 rx/fport.c \
114 sensors/acceleration.c \
115 sensors/boardalignment.c \
116 sensors/compass.c \
117 sensors/gyro.c \
118 sensors/initialisation.c \
119 blackbox/blackbox.c \
120 blackbox/blackbox_encoding.c \
121 blackbox/blackbox_io.c \
122 cms/cms.c \
123 cms/cms_menu_blackbox.c \
124 cms/cms_menu_builtin.c \
125 cms/cms_menu_failsafe.c \
126 cms/cms_menu_gps_rescue.c\
127 cms/cms_menu_imu.c \
128 cms/cms_menu_ledstrip.c \
129 cms/cms_menu_misc.c \
130 cms/cms_menu_osd.c \
131 cms/cms_menu_power.c \
132 cms/cms_menu_saveexit.c \
133 cms/cms_menu_vtx_rtc6705.c \
134 cms/cms_menu_vtx_smartaudio.c \
135 cms/cms_menu_vtx_tramp.c \
136 drivers/display_ug2864hsweg01.c \
137 drivers/light_ws2811strip.c \
138 drivers/rangefinder/rangefinder_hcsr04.c \
139 drivers/rangefinder/rangefinder_lidartf.c \
140 drivers/serial_escserial.c \
141 drivers/vtx_common.c \
142 drivers/vtx_table.c \
143 io/dashboard.c \
144 io/displayport_max7456.c \
145 io/displayport_msp.c \
146 io/displayport_oled.c \
147 io/displayport_srxl.c \
148 io/displayport_crsf.c \
149 io/displayport_hott.c \
150 io/rcdevice_cam.c \
151 io/rcdevice.c \
152 io/gps.c \
153 io/ledstrip.c \
154 io/pidaudio.c \
155 osd/osd.c \
156 osd/osd_elements.c \
157 sensors/barometer.c \
158 sensors/rangefinder.c \
159 telemetry/telemetry.c \
160 telemetry/crsf.c \
161 telemetry/srxl.c \
162 telemetry/frsky_hub.c \
163 telemetry/hott.c \
164 telemetry/jetiexbus.c \
165 telemetry/smartport.c \
166 telemetry/ltm.c \
167 telemetry/mavlink.c \
168 telemetry/msp_shared.c \
169 telemetry/ibus.c \
170 telemetry/ibus_shared.c \
171 sensors/esc_sensor.c \
172 io/vtx_string.c \
173 io/vtx.c \
174 io/vtx_rtc6705.c \
175 io/vtx_smartaudio.c \
176 io/vtx_tramp.c \
177 io/vtx_control.c
179 COMMON_DEVICE_SRC = \
180 $(CMSIS_SRC) \
181 $(DEVICE_STDPERIPH_SRC)
183 COMMON_SRC := $(COMMON_SRC) $(COMMON_DEVICE_SRC)
185 ifeq ($(SIMULATOR_BUILD),yes)
186 TARGET_FLAGS := -DSIMULATOR_BUILD $(TARGET_FLAGS)
187 endif
189 SPEED_OPTIMISED_SRC := ""
190 SIZE_OPTIMISED_SRC := ""
192 ifneq ($(TARGET),$(filter $(TARGET),$(F1_TARGETS)))
193 SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
194 common/encoding.c \
195 common/filter.c \
196 common/maths.c \
197 common/typeconversion.c \
198 drivers/accgyro/accgyro_fake.c \
199 drivers/accgyro/accgyro_mpu.c \
200 drivers/accgyro/accgyro_mpu3050.c \
201 drivers/accgyro/accgyro_mpu6050.c \
202 drivers/accgyro/accgyro_mpu6500.c \
203 drivers/accgyro/accgyro_spi_bmi160.c \
204 drivers/accgyro/accgyro_spi_icm20689.c \
205 drivers/accgyro/accgyro_spi_mpu6000.c \
206 drivers/accgyro/accgyro_spi_mpu6500.c \
207 drivers/accgyro/accgyro_spi_mpu9250.c \
208 drivers/accgyro_legacy/accgyro_adxl345.c \
209 drivers/accgyro_legacy/accgyro_bma280.c \
210 drivers/accgyro_legacy/accgyro_l3g4200d.c \
211 drivers/accgyro_legacy/accgyro_l3gd20.c \
212 drivers/accgyro_legacy/accgyro_lsm303dlhc.c \
213 drivers/accgyro_legacy/accgyro_mma845x.c \
214 drivers/adc.c \
215 drivers/buf_writer.c \
216 drivers/bus.c \
217 drivers/bus_spi.c \
218 drivers/exti.c \
219 drivers/io.c \
220 drivers/pwm_output.c \
221 drivers/rcc.c \
222 drivers/serial.c \
223 drivers/serial_uart.c \
224 drivers/system.c \
225 drivers/timer.c \
226 fc/core.c \
227 fc/tasks.c \
228 fc/rc.c \
229 fc/rc_controls.c \
230 fc/runtime_config.c \
231 flight/gyroanalyse.c \
232 flight/imu.c \
233 flight/mixer.c \
234 flight/pid.c \
235 flight/rpm_filter.c \
236 rx/ibus.c \
237 rx/rx.c \
238 rx/rx_spi.c \
239 rx/crsf.c \
240 rx/sbus.c \
241 rx/sbus_channels.c \
242 rx/spektrum.c \
243 rx/sumd.c \
244 rx/xbus.c \
245 rx/fport.c \
246 scheduler/scheduler.c \
247 sensors/acceleration.c \
248 sensors/boardalignment.c \
249 sensors/gyro.c \
250 $(CMSIS_SRC) \
251 $(DEVICE_STDPERIPH_SRC) \
253 SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
254 bus_bst_stm32f30x.c \
255 cli/cli.c \
256 cli/settings.c \
257 drivers/barometer/barometer_bmp085.c \
258 drivers/barometer/barometer_bmp280.c \
259 drivers/barometer/barometer_fake.c \
260 drivers/barometer/barometer_ms5611.c \
261 drivers/barometer/barometer_lps.c \
262 drivers/barometer/barometer_qmp6988.c \
263 drivers/bus_i2c_config.c \
264 drivers/bus_spi_config.c \
265 drivers/bus_spi_pinconfig.c \
266 drivers/compass/compass_ak8963.c \
267 drivers/compass/compass_ak8975.c \
268 drivers/compass/compass_fake.c \
269 drivers/compass/compass_hmc5883l.c \
270 drivers/compass/compass_qmc5883l.c \
271 drivers/compass/compass_lis3mdl.c \
272 drivers/display_ug2864hsweg01.c \
273 drivers/inverter.c \
274 drivers/light_ws2811strip.c \
275 drivers/light_ws2811strip_hal.c \
276 drivers/light_ws2811strip_stdperiph.c \
277 drivers/serial_escserial.c \
278 drivers/serial_pinconfig.c \
279 drivers/serial_tcp.c \
280 drivers/serial_uart_init.c \
281 drivers/serial_uart_pinconfig.c \
282 drivers/serial_usb_vcp.c \
283 drivers/transponder_ir_io_hal.c \
284 drivers/transponder_ir_io_stdperiph.c \
285 drivers/vtx_rtc6705_soft_spi.c \
286 drivers/vtx_rtc6705.c \
287 drivers/vtx_common.c \
288 fc/init.c \
289 fc/board_info.c \
290 config/config_eeprom.c \
291 config/feature.c \
292 config/config_streamer.c \
293 i2c_bst.c \
294 io/dashboard.c \
295 io/serial.c \
296 io/serial_4way.c \
297 io/serial_4way_avrootloader.c \
298 io/serial_4way_stk500v2.c \
299 io/transponder_ir.c \
300 io/usb_cdc_hid.c \
301 msp/msp_serial.c \
302 cms/cms.c \
303 cms/cms_menu_blackbox.c \
304 cms/cms_menu_builtin.c \
305 cms/cms_menu_failsafe.c \
306 cms/cms_menu_gps_rescue.c\
307 cms/cms_menu_imu.c \
308 cms/cms_menu_ledstrip.c \
309 cms/cms_menu_misc.c \
310 cms/cms_menu_osd.c \
311 cms/cms_menu_power.c \
312 cms/cms_menu_saveexit.c \
313 cms/cms_menu_vtx_rtc6705.c \
314 cms/cms_menu_vtx_smartaudio.c \
315 cms/cms_menu_vtx_tramp.c \
316 io/vtx_string.c \
317 io/vtx.c \
318 io/vtx_rtc6705.c \
319 io/vtx_smartaudio.c \
320 io/vtx_tramp.c \
321 io/vtx_control.c \
322 io/spektrum_vtx_control.c \
323 osd/osd.c \
324 osd/osd_elements.c \
325 pg/pg.h
327 # F4 and F7 optimizations
328 ifneq ($(TARGET),$(filter $(TARGET),$(F3_TARGETS)))
329 SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
330 drivers/bus_i2c_hal.c \
331 drivers/bus_spi_ll.c \
332 drivers/max7456.c \
333 drivers/pwm_output_dshot.c \
334 drivers/pwm_output_dshot_shared.c \
335 drivers/pwm_output_dshot_hal.c
336 endif #!F3
337 endif #!F1
339 # check if target.mk supplied
340 SRC := $(STARTUP_SRC) $(MCU_COMMON_SRC) $(TARGET_SRC) $(VARIANT_SRC)
342 # Files that should not be optimized, useful for debugging IMPRECISE cpu faults.
343 # Specify FULL PATH, e.g. "./lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_sdmmc.c"
344 NOT_OPTIMISED_SRC := $(NOT_OPTIMISED_SRC) \
346 ifneq ($(DSP_LIB),)
348 INCLUDE_DIRS += $(DSP_LIB)/Include
350 SRC += $(DSP_LIB)/Source/BasicMathFunctions/arm_mult_f32.c
351 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_rfft_fast_f32.c
352 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_cfft_f32.c
353 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_rfft_fast_init_f32.c
354 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_cfft_radix8_f32.c
355 SRC += $(DSP_LIB)/Source/CommonTables/arm_common_tables.c
357 SRC += $(DSP_LIB)/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c
358 SRC += $(DSP_LIB)/Source/StatisticsFunctions/arm_max_f32.c
360 SRC += $(wildcard $(DSP_LIB)/Source/*/*.S)
361 endif
363 ifneq ($(filter ONBOARDFLASH,$(FEATURES)),)
364 SRC += \
365 drivers/flash.c \
366 drivers/flash_m25p16.c \
367 drivers/flash_w25m.c \
368 io/flashfs.c \
369 pg/flash.c \
370 $(MSC_SRC)
371 endif
373 SRC += $(COMMON_SRC)
375 #excludes
376 SRC := $(filter-out $(MCU_EXCLUDES), $(SRC))
378 ifneq ($(filter SDCARD_SPI,$(FEATURES)),)
379 SRC += \
380 drivers/sdcard.c \
381 drivers/sdcard_spi.c \
382 drivers/sdcard_standard.c \
383 io/asyncfatfs/asyncfatfs.c \
384 io/asyncfatfs/fat_standard.c \
385 $(MSC_SRC)
386 endif
388 ifneq ($(filter SDCARD_SDIO,$(FEATURES)),)
389 SRC += \
390 drivers/sdcard.c \
391 drivers/sdcard_sdio_baremetal.c \
392 drivers/sdcard_standard.c \
393 io/asyncfatfs/asyncfatfs.c \
394 io/asyncfatfs/fat_standard.c \
395 pg/sdio.c \
396 $(MSC_SRC)
397 endif
399 ifneq ($(filter VCP,$(FEATURES)),)
400 SRC += $(VCP_SRC)
401 endif
403 ifneq ($(filter MSC,$(FEATURES)),)
404 SRC += $(MSC_SRC)
405 endif
406 # end target specific make file checks
408 # Search path and source files for the ST stdperiph library
409 VPATH := $(VPATH):$(STDPERIPH_DIR)/src