Rename flight mode (#12983)
[betaflight.git] / mk / mcu / SITL.mk
blobc8dcd76f332ee33efceb21ae4717d8145ed7d67f
2 INCLUDE_DIRS := $(INCLUDE_DIRS) \
3 $(ROOT)/lib/main/dyad
5 MCU_COMMON_SRC := $(ROOT)/lib/main/dyad/dyad.c
7 #Flags
8 ARCH_FLAGS =
9 DEVICE_FLAGS =
10 LD_SCRIPT = src/main/target/SITL/pg.ld
11 STARTUP_SRC =
13 MCU_FLASH_SIZE := 2048
15 ARM_SDK_PREFIX =
17 MCU_EXCLUDES = \
18 drivers/adc.c \
19 drivers/bus_i2c.c \
20 drivers/bus_i2c_config.c \
21 drivers/bus_spi.c \
22 drivers/bus_spi_config.c \
23 drivers/bus_spi_pinconfig.c \
24 drivers/dma.c \
25 drivers/pwm_output.c \
26 drivers/timer.c \
27 drivers/system.c \
28 drivers/rcc.c \
29 drivers/serial_escserial.c \
30 drivers/serial_pinconfig.c \
31 drivers/serial_uart.c \
32 drivers/serial_uart_init.c \
33 drivers/serial_uart_pinconfig.c \
34 drivers/rx/rx_xn297.c \
35 drivers/display_ug2864hsweg01.c \
36 telemetry/crsf.c \
37 telemetry/ghst.c \
38 telemetry/srxl.c \
39 io/displayport_oled.c
41 TARGET_MAP = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).map
43 LD_FLAGS := \
44 -lm \
45 -lpthread \
46 -lc \
47 -lrt \
48 $(ARCH_FLAGS) \
49 $(LTO_FLAGS) \
50 $(DEBUG_FLAGS) \
51 -Wl,-gc-sections,-Map,$(TARGET_MAP) \
52 -Wl,-L$(LINKER_DIR) \
53 -Wl,--cref \
54 -T$(LD_SCRIPT)
56 ifneq ($(filter SITL_STATIC,$(OPTIONS)),)
57 LD_FLAGS += \
58 -static \
59 -static-libgcc
60 endif
62 ifneq ($(DEBUG),GDB)
63 OPTIMISE_DEFAULT := -Ofast
64 OPTIMISE_SPEED := -Ofast
65 OPTIMISE_SIZE := -Os
67 LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
68 endif