Skip to content

Commit 43bcfb1

Browse files
jimmodpgeorge
authored andcommitted
mimxrt/Makefile: Split up SRC_C variables.
This improves clarity a bit, but also ensures that only the required files are added to SRC_QSTR. Signed-off-by: Jim Mussared <[email protected]>
1 parent d6d8722 commit 43bcfb1

File tree

1 file changed

+14
-33
lines changed

1 file changed

+14
-33
lines changed

ports/mimxrt/Makefile

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ SRC_C += \
178178
pendsv.c \
179179
pin.c \
180180
sdcard.c \
181+
systick.c \
182+
ticks.c \
183+
tusb_port.c \
184+
185+
SHARED_SRC_C += \
181186
shared/libc/printf.c \
182187
shared/libc/string0.c \
183188
shared/netutils/dhcpserver.c \
@@ -191,23 +196,17 @@ SRC_C += \
191196
shared/runtime/stdout_helpers.c \
192197
shared/runtime/sys_stdio_mphal.c \
193198
shared/timeutils/timeutils.c \
194-
systick.c \
195-
ticks.c \
196-
tusb_port.c \
197-
$(SRC_TINYUSB_C) \
198-
$(SRC_HAL_IMX_C) \
199-
$(SRC_ETH_C)
200199

201200
# Add sources for respective board flash type
202201
ifeq ($(MICROPY_HW_FLASH_TYPE),$(filter $(MICROPY_HW_FLASH_TYPE),qspi_nor_flash qspi_hyper_flash))
203202
# Add hal/flexspi_nor_flash.c or hal/flashspi_hyper_flash.c respectively
204-
SRC_C += hal/flexspi_$(subst qspi_,,$(MICROPY_HW_FLASH_TYPE)).c
203+
SRC_HAL_C += hal/flexspi_$(subst qspi_,,$(MICROPY_HW_FLASH_TYPE)).c
205204
#
206205
# Add custom (board specific) or default configuration
207206
ifeq ($(MICROPY_HW_BOARD_FLASH_FILES),1)
208-
SRC_C += $(BOARD_DIR)/$(MICROPY_HW_FLASH_TYPE)_config.c
207+
SRC_HAL_C += $(BOARD_DIR)/$(MICROPY_HW_FLASH_TYPE)_config.c
209208
else
210-
SRC_C += hal/$(MICROPY_HW_FLASH_TYPE)_config.c
209+
SRC_HAL_C += hal/$(MICROPY_HW_FLASH_TYPE)_config.c
211210
endif
212211
else
213212
$(error Error: Unknown board flash type $(MICROPY_HW_FLASH_TYPE))
@@ -254,29 +253,7 @@ SRC_S += shared/runtime/gchelper_m3.s \
254253
# =============================================================================
255254

256255
# List of sources for qstr extraction
257-
SRC_QSTR += \
258-
extmod/modonewire.c \
259-
extmod/uos_dupterm.c \
260-
machine_adc.c \
261-
machine_i2s.c \
262-
machine_led.c \
263-
machine_pin.c \
264-
machine_pwm.c \
265-
machine_rtc.c \
266-
machine_sdcard.c \
267-
machine_spi.c \
268-
machine_timer.c \
269-
machine_uart.c \
270-
machine_wdt.c \
271-
mimxrt_flash.c \
272-
modmachine.c \
273-
modmimxrt.c \
274-
modutime.c \
275-
pin.c \
276-
shared/readline/readline.c \
277-
shared/runtime/mpirq.c \
278-
shared/runtime/sys_stdio_mphal.c \
279-
$(GEN_PINS_SRC)
256+
SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(GEN_PINS_SRC)
280257

281258
# =============================================================================
282259
# Compiler Flags
@@ -413,12 +390,16 @@ ifeq ($(MICROPY_FLOAT_IMPL),double)
413390
$(LIBM_O): CFLAGS := $(filter-out -Wdouble-promotion -Wfloat-conversion, $(CFLAGS))
414391
endif
415392

416-
417393
OBJ += $(PY_O)
418394
OBJ += $(LIBM_O)
419395
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
396+
OBJ += $(addprefix $(BUILD)/, $(SHARED_SRC_C:.c=.o))
420397
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
421398
OBJ += $(addprefix $(BUILD)/, $(SRC_SS:.S=.o))
399+
OBJ += $(addprefix $(BUILD)/, $(SRC_TINYUSB_C:.c=.o))
400+
OBJ += $(addprefix $(BUILD)/, $(SRC_HAL_C:.c=.o))
401+
OBJ += $(addprefix $(BUILD)/, $(SRC_HAL_IMX_C:.c=.o))
402+
OBJ += $(addprefix $(BUILD)/, $(SRC_ETH_C:.c=.o))
422403
OBJ += $(GEN_PINS_SRC:.c=.o)
423404

424405
# Workaround for bug in older gcc, warning on "static usbd_device_t _usbd_dev = { 0 };"

0 commit comments

Comments
 (0)