Merge pull request #11270 from haslinghuis/rename_attr
[betaflight.git] / make / mcu / SITL.mk
blob32ad3f445a7e45e9687f918986070ae09a44cc0c
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 TARGET_FLAGS = -D$(TARGET)
14 MCU_FLASH_SIZE := 2048
16 ARM_SDK_PREFIX =
18 MCU_EXCLUDES = \
19 drivers/adc.c \
20 drivers/bus_i2c.c \
21 drivers/bus_i2c_config.c \
22 drivers/bus_spi.c \
23 drivers/bus_spi_config.c \
24 drivers/bus_spi_pinconfig.c \
25 drivers/dma.c \
26 drivers/pwm_output.c \
27 drivers/timer.c \
28 drivers/system.c \
29 drivers/rcc.c \
30 drivers/serial_escserial.c \
31 drivers/serial_pinconfig.c \
32 drivers/serial_uart.c \
33 drivers/serial_uart_init.c \
34 drivers/serial_uart_pinconfig.c \
35 drivers/rx/rx_xn297.c \
36 drivers/display_ug2864hsweg01.c \
37 telemetry/crsf.c \
38 telemetry/ghst.c \
39 telemetry/srxl.c \
40 io/displayport_oled.c
42 TARGET_MAP = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).map
44 LD_FLAGS := \
45 -lm \
46 -lpthread \
47 -lc \
48 -lrt \
49 $(ARCH_FLAGS) \
50 $(LTO_FLAGS) \
51 $(DEBUG_FLAGS) \
52 -Wl,-gc-sections,-Map,$(TARGET_MAP) \
53 -Wl,-L$(LINKER_DIR) \
54 -Wl,--cref \
55 -T$(LD_SCRIPT)
57 ifneq ($(filter SITL_STATIC,$(OPTIONS)),)
58 LD_FLAGS += \
59 -static \
60 -static-libgcc
61 endif
63 ifneq ($(DEBUG),GDB)
64 OPTIMISE_DEFAULT := -Ofast
65 OPTIMISE_SPEED := -Ofast
66 OPTIMISE_SIZE := -Os
68 LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
69 endif