mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Move common flags/options to top Makefile.
This commit is contained in:
parent
6e3fa2ba98
commit
38d687e3c9
48
src/Makefile
48
src/Makefile
@ -87,12 +87,56 @@ ifeq ($(FB_ALLOC_STATS), 1)
|
||||
CFLAGS += -DFB_ALLOC_STATS
|
||||
endif
|
||||
|
||||
# Include the board config to set the port.
|
||||
# Include OpenMV board config first to set the port.
|
||||
include $(OMV_BOARD_CONFIG_DIR)/omv_boardconfig.mk
|
||||
|
||||
# MicroPython board config.
|
||||
# Include MicroPython board config.
|
||||
#include $(MP_BOARD_CONFIG_DIR)/mpconfigboard.mk
|
||||
|
||||
# The following command line args are passed to MicroPython's top Makefile.
|
||||
MICROPY_ARGS = BOARD=$(TARGET) DEBUG=$(DEBUG) QSTR_DEFS="$(OMV_QSTR_DEFS)" MPY_LIB_DIR=$(MPY_LIB_DIR)
|
||||
|
||||
# Configure additional built-in modules. Note must define both the CFLAGS and the Make command line args.
|
||||
ifeq ($(MICROPY_PY_SENSOR), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_SENSOR=1
|
||||
MICROPY_ARGS += MICROPY_PY_SENSOR=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_WINC1500), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_WINC1500=1
|
||||
MICROPY_ARGS += MICROPY_PY_WINC1500=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_IMU), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_IMU=1
|
||||
MICROPY_ARGS += MICROPY_PY_IMU=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_ULAB), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_ULAB=1
|
||||
MICROPY_ARGS += MICROPY_PY_ULAB=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_LWIP), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_LWIP=1
|
||||
MICROPY_ARGS += MICROPY_PY_LWIP=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_NETWORK_CYW43), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_NETWORK_CYW43=1
|
||||
MICROPY_ARGS += MICROPY_PY_NETWORK_CYW43=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_AUDIO), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_AUDIO=1
|
||||
MICROPY_ARGS += MICROPY_PY_AUDIO=1
|
||||
endif
|
||||
|
||||
ifeq ($(MICROPY_PY_MICRO_SPEECH), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_MICRO_SPEECH=1
|
||||
MICROPY_ARGS += MICROPY_PY_MICRO_SPEECH=1
|
||||
endif
|
||||
|
||||
# Include the port Makefile.
|
||||
include $(OMV_DIR)/ports/$(PORT)/omv_port.mk
|
||||
|
||||
|
||||
@ -28,43 +28,6 @@ MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/ports/stm32/usbdev/core/inc/
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/ports/stm32/usbdev/class/inc/
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/ports/stm32/lwip_inc/
|
||||
|
||||
# In addition to CFLAGS, the following options are needed to set varilables
|
||||
# in MicroPython's Makefile, to enable or disable compiling additional modules.
|
||||
MICROPY_ARGS = BOARD=$(TARGET) DEBUG=$(DEBUG) QSTR_DEFS="$(OMV_QSTR_DEFS)" MPY_LIB_DIR=$(MPY_LIB_DIR)
|
||||
|
||||
ifeq ($(MICROPY_PY_SENSOR), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_SENSOR=1
|
||||
MICROPY_ARGS += MICROPY_PY_SENSOR=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_WINC1500), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_WINC1500=1
|
||||
MICROPY_ARGS += MICROPY_PY_WINC1500=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_IMU), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_IMU=1
|
||||
MICROPY_ARGS += MICROPY_PY_IMU=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_ULAB), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_ULAB=1
|
||||
MICROPY_ARGS += MICROPY_PY_ULAB=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_LWIP), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_LWIP=1
|
||||
MICROPY_ARGS += MICROPY_PY_LWIP=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_NETWORK_CYW43), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_NETWORK_CYW43=1
|
||||
MICROPY_ARGS += MICROPY_PY_NETWORK_CYW43=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_AUDIO), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_AUDIO=1
|
||||
MICROPY_ARGS += MICROPY_PY_AUDIO=1
|
||||
endif
|
||||
ifeq ($(MICROPY_PY_MICRO_SPEECH), 1)
|
||||
MPY_CFLAGS += -DMICROPY_PY_MICRO_SPEECH=1
|
||||
MICROPY_ARGS += MICROPY_PY_MICRO_SPEECH=1
|
||||
endif
|
||||
|
||||
OMV_CFLAGS += -I$(OMV_BOARD_CONFIG_DIR)
|
||||
OMV_CFLAGS += -I$(TOP_DIR)/$(OMV_DIR)/
|
||||
OMV_CFLAGS += -I$(TOP_DIR)/$(OMV_DIR)/alloc/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user