extmod: Make extmod.mk self-contained.

This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.

Make all extmod variables (src, flags, etc) private to extmod.mk.

Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.

Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2022-10-08 23:59:08 +11:00
committed by Damien George
parent 87011f6353
commit d6d8722558
21 changed files with 236 additions and 284 deletions

View File

@@ -150,10 +150,6 @@ SRC_C += \
drivers/bus/softspi.c \
drivers/dht/dht.c \
eth.c \
extmod/modnetwork.c \
extmod/modonewire.c \
extmod/modusocket.c \
extmod/uos_dupterm.c \
fatfs_port.c \
hal/pwm_backport.c \
led.c \
@@ -257,16 +253,6 @@ SRC_S += shared/runtime/gchelper_m3.s \
# QSTR Sources
# =============================================================================
# All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP
ifeq ($(MICROPY_PY_LWIP),1)
SRC_QSTR += \
extmod/modlwip.c \
extmod/modnetwork.c \
extmod/modusocket.c \
extmod/moduwebsocket.c \
network_lan.c
endif
# List of sources for qstr extraction
SRC_QSTR += \
extmod/modonewire.c \
@@ -386,7 +372,7 @@ CFLAGS += \
-DMBEDTLS_CONFIG_FILE='"mbedtls/mbedtls_config.h"'
endif
CFLAGS += $(CFLAGS_MOD) $(CFLAGS_EXTRA)
CFLAGS += $(CFLAGS_EXTRA)
# =============================================================================
# Linker Flags
@@ -433,7 +419,6 @@ OBJ += $(LIBM_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_SS:.S=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
OBJ += $(GEN_PINS_SRC:.c=.o)
# Workaround for bug in older gcc, warning on "static usbd_device_t _usbd_dev = { 0 };"