update serTcpOpen declaration to fix compile errors (#14113)
[betaflight.git] / mk / source.mk
blobc28a739577216317f05404b3f7ea3ab5b2bdf034
1 PG_SRC = \
2 pg/adc.c \
3 pg/alt_hold.c \
4 pg/autopilot.c \
5 pg/beeper.c \
6 pg/beeper_dev.c \
7 pg/board.c \
8 pg/bus_i2c.c \
9 pg/bus_quadspi.c \
10 pg/bus_spi.c \
11 pg/dashboard.c \
12 pg/displayport_profiles.c \
13 pg/dyn_notch.c \
14 pg/flash.c \
15 pg/gimbal.c \
16 pg/gps.c \
17 pg/gps_lap_timer.c \
18 pg/gps_rescue.c \
19 pg/gyrodev.c \
20 pg/max7456.c \
21 pg/mco.c \
22 pg/motor.c \
23 pg/msp.c \
24 pg/pg.c \
25 pg/pilot.c \
26 pg/piniobox.c \
27 pg/pinio.c \
28 pg/pin_pull_up_down.c \
29 pg/pos_hold.c \
30 pg/rcdevice.c \
31 pg/rpm_filter.c \
32 pg/rx.c \
33 pg/rx_pwm.c \
34 pg/rx_spi.c \
35 pg/rx_spi_cc2500.c \
36 pg/rx_spi_expresslrs.c \
37 pg/scheduler.c \
38 pg/sdcard.c \
39 pg/sdio.c \
40 pg/serial_uart.c \
41 pg/stats.c \
42 pg/timerio.c \
43 pg/timerup.c \
44 pg/usb.c \
45 pg/vcd.c \
46 pg/vtx_io.c \
47 pg/vtx_table.c
49 COMMON_SRC = \
50 build/build_config.c \
51 build/debug.c \
52 build/debug_pin.c \
53 build/version.c \
54 main.c \
55 $(PG_SRC) \
56 common/bitarray.c \
57 common/colorconversion.c \
58 common/crc.c \
59 common/encoding.c \
60 common/explog_approx.c \
61 common/filter.c \
62 common/gps_conversion.c \
63 common/huffman.c \
64 common/huffman_table.c \
65 common/maths.c \
66 common/printf.c \
67 common/printf_serial.c \
68 common/pwl.c \
69 common/sdft.c \
70 common/sensor_alignment.c \
71 common/stopwatch.c \
72 common/streambuf.c \
73 common/string_light.c \
74 common/strtol.c \
75 common/time.c \
76 common/typeconversion.c \
77 common/uvarint.c \
78 common/vector.c \
79 config/config.c \
80 config/config_eeprom.c \
81 config/config_streamer.c \
82 config/feature.c \
83 config/simplified_tuning.c \
84 cli/cli.c \
85 cli/settings.c \
86 config/config.c \
87 drivers/dshot.c \
88 drivers/dshot_dpwm.c \
89 drivers/dshot_command.c \
90 drivers/buf_writer.c \
91 drivers/bus.c \
92 drivers/bus_i2c_busdev.c \
93 drivers/bus_i2c_utils.c \
94 drivers/bus_i2c_soft.c \
95 drivers/bus_octospi.c \
96 drivers/bus_quadspi.c \
97 drivers/buttons.c \
98 drivers/camera_control.c \
99 drivers/display.c \
100 drivers/display_canvas.c \
101 drivers/dma_common.c \
102 drivers/io.c \
103 drivers/light_led.c \
104 drivers/mco.c \
105 drivers/motor.c \
106 drivers/pinio.c \
107 drivers/pin_pull_up_down.c \
108 drivers/resource.c \
109 drivers/serial.c \
110 drivers/serial_impl.c \
111 drivers/serial_uart_hw.c \
112 drivers/sound_beeper.c \
113 drivers/stack_check.c \
114 drivers/timer_common.c \
115 drivers/transponder_ir_arcitimer.c \
116 drivers/transponder_ir_ilap.c \
117 drivers/transponder_ir_erlt.c \
118 fc/board_info.c \
119 fc/dispatch.c \
120 fc/hardfaults.c \
121 fc/tasks.c \
122 fc/runtime_config.c \
123 fc/stats.c \
124 io/beeper.c \
125 io/piniobox.c \
126 io/serial.c \
127 io/serial_resource.c \
128 io/smartaudio_protocol.c \
129 io/statusindicator.c \
130 io/tramp_protocol.c \
131 io/transponder_ir.c \
132 io/usb_cdc_hid.c \
133 io/usb_msc.c \
134 msp/msp.c \
135 msp/msp_box.c \
136 msp/msp_build_info.c \
137 msp/msp_serial.c \
138 scheduler/scheduler.c \
139 sensors/adcinternal.c \
140 sensors/battery.c \
141 sensors/current.c \
142 sensors/voltage.c \
143 target/config_helper.c \
144 fc/init.c \
145 fc/controlrate_profile.c \
146 drivers/accgyro/gyro_sync.c \
147 drivers/rx/rx_spi.c \
148 drivers/rx/rx_xn297.c \
149 drivers/rx/rx_pwm.c \
150 drivers/serial_softserial.c \
151 fc/core.c \
152 fc/gps_lap_timer.c \
153 fc/rc.c \
154 fc/rc_adjustments.c \
155 fc/rc_controls.c \
156 fc/rc_modes.c \
157 flight/alt_hold.c \
158 flight/autopilot.c \
159 flight/dyn_notch_filter.c \
160 flight/failsafe.c \
161 flight/gps_rescue.c \
162 flight/imu.c \
163 flight/mixer.c \
164 flight/mixer_init.c \
165 flight/mixer_tricopter.c \
166 flight/pid.c \
167 flight/pid_init.c \
168 flight/position.c \
169 flight/pos_hold.c \
170 flight/rpm_filter.c \
171 flight/servos.c \
172 flight/servos_tricopter.c \
173 io/serial_4way.c \
174 io/serial_4way_avrootloader.c \
175 io/serial_4way_stk500v2.c \
176 rx/ibus.c \
177 rx/jetiexbus.c \
178 rx/msp.c \
179 rx/pwm.c \
180 rx/frsky_crc.c \
181 rx/rc_stats.c \
182 rx/rx.c \
183 rx/rx_bind.c \
184 rx/rx_spi.c \
185 rx/rx_spi_common.c \
186 rx/crsf.c \
187 rx/ghst.c \
188 rx/sbus.c \
189 rx/sbus_channels.c \
190 rx/spektrum.c \
191 rx/srxl2.c \
192 io/spektrum_vtx_control.c \
193 io/spektrum_rssi.c \
194 rx/sumd.c \
195 rx/sumh.c \
196 rx/xbus.c \
197 rx/fport.c \
198 rx/msp_override.c \
199 sensors/acceleration.c \
200 sensors/acceleration_init.c \
201 sensors/boardalignment.c \
202 sensors/compass.c \
203 sensors/gyro.c \
204 sensors/gyro_init.c \
205 sensors/initialisation.c \
206 blackbox/blackbox.c \
207 blackbox/blackbox_encoding.c \
208 blackbox/blackbox_io.c \
209 cms/cms.c \
210 cms/cms_menu_blackbox.c \
211 cms/cms_menu_failsafe.c \
212 cms/cms_menu_firmware.c \
213 cms/cms_menu_gps_rescue.c \
214 cms/cms_menu_gps_lap_timer.c \
215 cms/cms_menu_imu.c \
216 cms/cms_menu_ledstrip.c \
217 cms/cms_menu_main.c \
218 cms/cms_menu_misc.c \
219 cms/cms_menu_osd.c \
220 cms/cms_menu_power.c \
221 cms/cms_menu_saveexit.c \
222 cms/cms_menu_vtx_common.c \
223 cms/cms_menu_vtx_rtc6705.c \
224 cms/cms_menu_vtx_smartaudio.c \
225 cms/cms_menu_vtx_tramp.c \
226 cms/cms_menu_persistent_stats.c \
227 cms/cms_menu_rpm_limit.c \
228 cms/cms_menu_quick.c \
229 drivers/display_ug2864hsweg01.c \
230 drivers/light_ws2811strip.c \
231 drivers/rangefinder/rangefinder_hcsr04.c \
232 drivers/rangefinder/rangefinder_lidartf.c \
233 drivers/rangefinder/rangefinder_lidarmt.c \
234 drivers/vtx_common.c \
235 drivers/vtx_table.c \
236 io/dashboard.c \
237 io/displayport_frsky_osd.c \
238 io/displayport_max7456.c \
239 io/displayport_msp.c \
240 io/displayport_oled.c \
241 io/displayport_srxl.c \
242 io/displayport_crsf.c \
243 io/displayport_hott.c \
244 io/frsky_osd.c \
245 io/gimbal_control.c \
246 io/rcdevice_cam.c \
247 io/rcdevice.c \
248 io/gps.c \
249 io/ledstrip.c \
250 io/pidaudio.c \
251 osd/osd.c \
252 osd/osd_elements.c \
253 osd/osd_warnings.c \
254 sensors/barometer.c \
255 sensors/rangefinder.c \
256 sensors/opticalflow.c \
257 telemetry/telemetry.c \
258 telemetry/crsf.c \
259 telemetry/ghst.c \
260 telemetry/srxl.c \
261 telemetry/frsky_hub.c \
262 telemetry/hott.c \
263 telemetry/jetiexbus.c \
264 telemetry/smartport.c \
265 telemetry/ltm.c \
266 telemetry/mavlink.c \
267 telemetry/msp_shared.c \
268 telemetry/ibus.c \
269 telemetry/ibus_shared.c \
270 sensors/esc_sensor.c \
271 io/vtx.c \
272 io/vtx_rtc6705.c \
273 io/vtx_smartaudio.c \
274 io/vtx_tramp.c \
275 io/vtx_control.c \
276 io/vtx_msp.c \
277 cms/cms_menu_vtx_msp.c
279 ifneq ($(SIMULATOR_BUILD),yes)
281 COMMON_SRC += \
282 drivers/bus_spi.c \
283 drivers/serial_uart.c \
284 drivers/accgyro/accgyro_mpu3050.c \
285 drivers/accgyro/accgyro_mpu6050.c \
286 drivers/accgyro/accgyro_mpu6500.c \
287 drivers/accgyro/accgyro_mpu.c \
288 drivers/accgyro/accgyro_spi_bmi160.c \
289 drivers/accgyro/accgyro_spi_bmi270.c \
290 drivers/accgyro/accgyro_spi_icm20649.c \
291 drivers/accgyro/accgyro_spi_icm20689.c \
292 drivers/accgyro/accgyro_spi_icm426xx.c \
293 drivers/accgyro/accgyro_spi_l3gd20.c \
294 drivers/accgyro/accgyro_spi_lsm6dso.c \
295 drivers/accgyro/accgyro_spi_lsm6dso_init.c \
296 drivers/accgyro/accgyro_spi_lsm6dsv16x.c \
297 drivers/accgyro/accgyro_spi_mpu6000.c \
298 drivers/accgyro/accgyro_spi_mpu6500.c \
299 drivers/accgyro/accgyro_spi_mpu9250.c \
300 drivers/accgyro/accgyro_virtual.c \
301 drivers/accgyro/gyro_sync.c \
302 BoschSensortec/BMI270-Sensor-API/bmi270_maximum_fifo.c \
303 drivers/barometer/barometer_2smpb_02b.c \
304 drivers/barometer/barometer_bmp085.c \
305 drivers/barometer/barometer_bmp280.c \
306 drivers/barometer/barometer_bmp388.c \
307 drivers/barometer/barometer_dps310.c \
308 drivers/barometer/barometer_lps22df.c \
309 drivers/barometer/barometer_lps.c \
310 drivers/barometer/barometer_ms5611.c \
311 drivers/barometer/barometer_qmp6988.c \
312 drivers/barometer/barometer_virtual.c \
313 drivers/compass/compass_ak8963.c \
314 drivers/compass/compass_ak8975.c \
315 drivers/compass/compass_hmc5883l.c \
316 drivers/compass/compass_ist8310.c \
317 drivers/compass/compass_lis2mdl.c \
318 drivers/compass/compass_lis3mdl.c \
319 drivers/compass/compass_mpu925x_ak8963.c \
320 drivers/compass/compass_qmc5883l.c \
321 drivers/compass/compass_virtual.c \
322 drivers/max7456.c \
323 drivers/vtx_rtc6705.c \
324 drivers/vtx_rtc6705_soft_spi.c
326 ifneq ($(GYRO_DEFINE),)
328 LEGACY_GYRO_DEFINES := USE_GYRO_L3GD20
329 ifneq ($(findstring $(GYRO_DEFINE),$(LEGACY_GYRO_DEFINES)),)
331 LEGACY_SRC := \
332 drivers/accgyro/legacy/accgyro_adxl345.c \
333 drivers/accgyro/legacy/accgyro_bma280.c \
334 drivers/accgyro/legacy/accgyro_l3g4200d.c \
335 drivers/accgyro/legacy/accgyro_lsm303dlhc.c \
336 drivers/accgyro/legacy/accgyro_mma845x.c
338 COMMON_SRC += $(LEGACY_SRC)
339 SPEED_OPTIMISED_SRC += $(LEGACY_SRC)
341 endif
342 endif
344 RX_SRC = \
345 drivers/rx/expresslrs_driver.c \
346 drivers/rx/rx_a7105.c \
347 drivers/rx/rx_cc2500.c \
348 drivers/rx/rx_cyrf6936.c \
349 drivers/rx/rx_nrf24l01.c \
350 drivers/rx/rx_pwm.c \
351 drivers/rx/rx_spi.c \
352 drivers/rx/rx_sx127x.c \
353 drivers/rx/rx_sx1280.c \
354 drivers/rx/rx_xn297.c \
355 rx/cc2500_common.c \
356 rx/cc2500_frsky_shared.c \
357 rx/cc2500_frsky_d.c \
358 rx/cc2500_frsky_x.c \
359 rx/cc2500_sfhss.c \
360 rx/cc2500_redpine.c \
361 rx/a7105_flysky.c \
362 rx/cyrf6936_spektrum.c \
363 rx/expresslrs.c \
364 rx/expresslrs_common.c \
365 rx/expresslrs_telemetry.c
367 FLASH_SRC += \
368 drivers/flash/flash.c \
369 drivers/flash/flash_m25p16.c \
370 drivers/flash/flash_w25m.c \
371 drivers/flash/flash_w25n.c \
372 drivers/flash/flash_w25q128fv.c \
373 io/flashfs.c
375 SDCARD_SRC += \
376 drivers/sdcard.c \
377 drivers/sdcard_spi.c \
378 drivers/sdcard_sdio_baremetal.c \
379 drivers/sdcard_standard.c \
380 io/asyncfatfs/asyncfatfs.c \
381 io/asyncfatfs/fat_standard.c
383 INCLUDE_DIRS := $(INCLUDE_DIRS) \
384 $(FATFS_DIR)
385 VPATH := $(VPATH):$(FATFS_DIR)
387 # Gyro driver files that only contain initialization and configuration code - not runtime code
388 SIZE_OPTIMISED_SRC += \
389 drivers/accgyro/accgyro_mpu6050.c \
390 drivers/accgyro/accgyro_mpu6500.c \
391 drivers/accgyro/accgyro_spi_mpu6000.c \
392 drivers/accgyro/accgyro_spi_mpu6500.c \
393 drivers/accgyro/accgyro_spi_mpu9250.c \
394 drivers/accgyro/accgyro_spi_icm20689.c \
395 drivers/accgyro/accgyro_spi_icm426xx.c \
396 drivers/accgyro/accgyro_spi_lsm6dso_init.c \
397 drivers/barometer/barometer_bmp085.c \
398 drivers/barometer/barometer_bmp280.c \
399 drivers/barometer/barometer_ms5611.c \
400 drivers/barometer/barometer_lps.c \
401 drivers/barometer/barometer_qmp6988.c \
402 drivers/barometer/barometer_2smpb_02b.c \
403 drivers/compass/compass_ak8963.c \
404 drivers/compass/compass_ak8975.c \
405 drivers/compass/compass_hmc5883l.c \
406 drivers/compass/compass_qmc5883l.c \
407 drivers/compass/compass_lis2mdl.c \
408 drivers/compass/compass_lis3mdl.c \
409 drivers/compass/compass_ist8310.c \
410 drivers/display_ug2864hsweg01.c \
411 drivers/vtx_rtc6705_soft_spi.c \
412 drivers/vtx_rtc6705.c
415 SPEED_OPTIMISED_SRC += \
416 drivers/bus_spi.c \
417 drivers/serial_uart.c \
418 drivers/accgyro/accgyro_mpu.c \
419 drivers/accgyro/accgyro_mpu3050.c \
420 drivers/accgyro/accgyro_spi_bmi160.c \
421 drivers/accgyro/accgyro_spi_bmi270.c \
422 drivers/accgyro/accgyro_spi_lsm6dso.c
424 endif
426 COMMON_DEVICE_SRC = \
427 $(CMSIS_SRC) \
428 $(DEVICE_STDPERIPH_SRC)
430 COMMON_SRC := $(COMMON_SRC) $(COMMON_DEVICE_SRC) $(RX_SRC)
432 ifeq ($(EXST),yes)
433 TARGET_FLAGS := -DUSE_EXST $(TARGET_FLAGS)
434 endif
436 ifeq ($(RAM_BASED),yes)
437 TARGET_FLAGS := -DUSE_EXST -DCONFIG_IN_RAM -DRAMBASED $(TARGET_FLAGS)
438 endif
440 ifeq ($(SIMULATOR_BUILD),yes)
441 TARGET_FLAGS := -DSIMULATOR_BUILD $(TARGET_FLAGS)
442 endif
444 SPEED_OPTIMISED_SRC += \
445 common/encoding.c \
446 common/filter.c \
447 common/maths.c \
448 common/pwl.c \
449 common/sdft.c \
450 common/stopwatch.c \
451 common/typeconversion.c \
452 common/vector.c \
453 drivers/buf_writer.c \
454 drivers/bus.c \
455 drivers/bus_quadspi.c \
456 drivers/io.c \
457 drivers/serial.c \
458 fc/core.c \
459 fc/tasks.c \
460 fc/rc.c \
461 fc/rc_controls.c \
462 fc/runtime_config.c \
463 flight/dyn_notch_filter.c \
464 flight/imu.c \
465 flight/mixer.c \
466 flight/pid.c \
467 flight/rpm_filter.c \
468 rx/ibus.c \
469 rx/rc_stats.c \
470 rx/rx.c \
471 rx/rx_spi.c \
472 rx/crsf.c \
473 rx/frsky_crc.c \
474 rx/sbus.c \
475 rx/sbus_channels.c \
476 rx/spektrum.c \
477 rx/srxl2.c \
478 rx/sumd.c \
479 rx/xbus.c \
480 rx/fport.c \
481 rx/frsky_crc.c \
482 scheduler/scheduler.c \
483 sensors/acceleration.c \
484 sensors/boardalignment.c \
485 sensors/gyro.c \
486 $(CMSIS_SRC) \
487 $(DEVICE_STDPERIPH_SRC) \
489 SIZE_OPTIMISED_SRC += \
490 sensors/gyro_init.c \
491 sensors/acceleration_init.c \
492 flight/pid_init.c \
493 flight/mixer_init.c \
494 cli/cli.c \
495 cli/settings.c \
496 drivers/light_ws2811strip.c \
497 drivers/vtx_common.c \
498 fc/init.c \
499 fc/board_info.c \
500 config/config_eeprom.c \
501 config/feature.c \
502 config/config_streamer.c \
503 config/simplified_tuning.c \
504 io/dashboard.c \
505 io/serial.c \
506 io/serial_4way.c \
507 io/serial_4way_avrootloader.c \
508 io/serial_4way_stk500v2.c \
509 io/transponder_ir.c \
510 io/usb_cdc_hid.c \
511 msp/msp_serial.c \
512 cms/cms.c \
513 cms/cms_menu_blackbox.c \
514 cms/cms_menu_failsafe.c \
515 cms/cms_menu_firmware.c \
516 cms/cms_menu_gps_rescue.c \
517 cms/cms_menu_gps_lap_timer.c \
518 cms/cms_menu_imu.c \
519 cms/cms_menu_ledstrip.c \
520 cms/cms_menu_main.c \
521 cms/cms_menu_misc.c \
522 cms/cms_menu_osd.c \
523 cms/cms_menu_power.c \
524 cms/cms_menu_saveexit.c \
525 cms/cms_menu_vtx_common.c \
526 cms/cms_menu_vtx_rtc6705.c \
527 cms/cms_menu_vtx_smartaudio.c \
528 cms/cms_menu_vtx_tramp.c \
529 cms/cms_menu_persistent_stats.c \
530 cms/cms_menu_rpm_limit.c \
531 cms/cms_menu_quick.c \
532 io/vtx.c \
533 io/vtx_rtc6705.c \
534 io/vtx_smartaudio.c \
535 io/vtx_tramp.c \
536 io/vtx_control.c \
537 io/spektrum_vtx_control.c \
538 osd/osd.c \
539 osd/osd_elements.c \
540 osd/osd_warnings.c \
541 rx/rx_bind.c \
542 io/vtx_msp.c \
543 cms/cms_menu_vtx_msp.c
545 # check if target.mk supplied
546 SRC := $(STARTUP_SRC) $(MCU_COMMON_SRC) $(TARGET_SRC) $(VARIANT_SRC)
548 # Files that should not be optimized, useful for debugging IMPRECISE cpu faults.
549 # Specify FULL PATH, e.g. "./lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_sdmmc.c"
550 NOT_OPTIMISED_SRC := $(NOT_OPTIMISED_SRC) \
552 ifneq ($(DSP_LIB),)
554 INCLUDE_DIRS += $(DSP_LIB)/Include
555 SRC += $(wildcard $(DSP_LIB)/Source/*/*.S)
557 endif
559 SRC += $(FLASH_SRC) $(MSC_SRC) $(SDCARD_SRC) $(COMMON_SRC)
561 #excludes
562 SRC := $(filter-out $(MCU_EXCLUDES), $(SRC))
564 SRC += $(VCP_SRC)
566 # end target specific make file checks
568 # Search path and source files for the Open Location Code library
569 OLC_DIR := google/olc
571 ifneq ($(OLC_DIR),)
572 INCLUDE_DIRS += $(LIB_MAIN_DIR)/$(OLC_DIR)
573 SRC += $(OLC_DIR)/olc.c
574 SIZE_OPTIMISED_SRC += $(OLC_DIR)/olc.c
575 endif