Skip to content

Commit b25087f

Browse files
jimmodpgeorge
authored andcommitted
samd/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 a2aceb5 commit b25087f

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed

ports/samd/Makefile

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,8 @@ SRC_C += \
110110
samd_isr.c \
111111
samd_soc.c \
112112
tusb_port.c \
113-
lib/asf4/$(MCU_SERIES_LOWER)/hal/src/hal_atomic.c \
114-
lib/asf4/$(MCU_SERIES_LOWER)/hal/src/hal_flash.c \
115-
lib/asf4/$(MCU_SERIES_LOWER)/hpl/nvmctrl/hpl_nvmctrl.c \
116-
lib/tinyusb/src/class/cdc/cdc_device.c \
117-
lib/tinyusb/src/common/tusb_fifo.c \
118-
lib/tinyusb/src/device/usbd.c \
119-
lib/tinyusb/src/device/usbd_control.c \
120-
lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \
121-
lib/tinyusb/src/tusb.c \
122-
drivers/bus/softspi.c \
113+
114+
SHARED_SRC_C += \
123115
shared/runtime/mpirq.c \
124116
shared/libc/printf.c \
125117
shared/libc/string0.c \
@@ -132,39 +124,43 @@ SRC_C += \
132124
shared/runtime/sys_stdio_mphal.c \
133125
shared/timeutils/timeutils.c \
134126

135-
LIBM_SRC_C += \
136-
lib/libm/ef_sqrt.c \
137-
lib/libm/fmodf.c \
138-
lib/libm/math.c \
139-
lib/libm/nearbyintf.c \
127+
ASF4_SRC_C += $(addprefix lib/asf4/$(MCU_SERIES_LOWER)/,\
128+
hal/src/hal_atomic.c \
129+
hal/src/hal_flash.c \
130+
hpl/nvmctrl/hpl_nvmctrl.c \
131+
)
132+
133+
LIBM_SRC_C += $(addprefix lib/libm/,\
134+
ef_sqrt.c \
135+
fmodf.c \
136+
math.c \
137+
nearbyintf.c \
138+
)
139+
140+
TINYUSB_SRC_C += $(addprefix lib/tinyusb/src/,\
141+
class/cdc/cdc_device.c \
142+
common/tusb_fifo.c \
143+
device/usbd.c \
144+
device/usbd_control.c \
145+
portable/microchip/samd/dcd_samd.c \
146+
tusb.c \
147+
)
148+
149+
DRIVERS_SRC_C += \
150+
drivers/bus/softspi.c \
140151

141152
# List of sources for qstr extraction
142-
SRC_QSTR += \
143-
machine_adc.c \
144-
machine_dac.c \
145-
machine_i2c.c \
146-
machine_led.c \
147-
machine_pin.c \
148-
machine_pwm.c \
149-
machine_spi.c \
150-
machine_timer.c \
151-
machine_uart.c \
152-
machine_wdt.c \
153-
modutime.c \
154-
modmachine.c \
155-
modsamd.c \
156-
samd_flash.c \
157-
shared/readline/readline.c \
158-
shared/runtime/mpirq.c \
159-
shared/runtime/sys_stdio_mphal.c \
160-
161-
SRC_QSTR += $(SRC_CXX)
153+
SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(SRC_CXX) $(GEN_PINS_SRC)
162154

163155
OBJ += $(PY_O)
164156
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
165157
OBJ += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))
166158
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
159+
OBJ += $(addprefix $(BUILD)/, $(SHARED_SRC_C:.c=.o))
160+
OBJ += $(addprefix $(BUILD)/, $(ASF4_SRC_C:.c=.o))
167161
OBJ += $(addprefix $(BUILD)/, $(LIBM_SRC_C:.c=.o))
162+
OBJ += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o))
163+
OBJ += $(addprefix $(BUILD)/, $(TINYUSB_SRC_C:.c=.o))
168164
OBJ += $(GEN_PINS_SRC:.c=.o)
169165

170166
ifneq ($(FROZEN_MANIFEST),)

0 commit comments

Comments
 (0)