mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2275 from openmv/makefile_refactor
misc: Export common environment variables from top Makefile.
This commit is contained in:
commit
b7c5b7bdeb
@ -1,7 +1,7 @@
|
||||
# This file is part of the OpenMV project.
|
||||
#
|
||||
# Copyright (c) 2013-2019 Ibrahim Abdelkader <iabdalkader@openmv.io>
|
||||
# Copyright (c) 2013-2019 Kwabena W. Agyeman <kwagyeman@openmv.io>
|
||||
# Copyright (c) 2013-2024 Ibrahim Abdelkader <iabdalkader@openmv.io>
|
||||
# Copyright (c) 2013-2024 Kwabena W. Agyeman <kwagyeman@openmv.io>
|
||||
#
|
||||
# This work is licensed under the MIT license, see the file LICENSE for details.
|
||||
#
|
||||
@ -195,5 +195,8 @@ MPY_CFLAGS += -DMP_CONFIGFILE=\<$(OMV_PORT_DIR)/omv_mpconfigport.h\>
|
||||
# Include the port Makefile.
|
||||
include $(OMV_PORT_DIR)/omv_portconfig.mk
|
||||
|
||||
# Export all common variables
|
||||
include $(OMV_COMMON_DIR)/export.mk
|
||||
|
||||
clean:
|
||||
$(RM) -fr $(BUILD)
|
||||
|
||||
77
src/omv/common/export.mk
Normal file
77
src/omv/common/export.mk
Normal file
@ -0,0 +1,77 @@
|
||||
# This file is part of the OpenMV project.
|
||||
#
|
||||
# Copyright (c) 2013-2024 Ibrahim Abdelkader <iabdalkader@openmv.io>
|
||||
# Copyright (c) 2013-2024 Kwabena W. Agyeman <kwagyeman@openmv.io>
|
||||
#
|
||||
# This work is licensed under the MIT license, see the file LICENSE for details.
|
||||
#
|
||||
# Tools, directories and common variables that need to be exported when calling
|
||||
# sub-Makefiles.
|
||||
|
||||
# Export Commands
|
||||
export Q
|
||||
export CC
|
||||
export CXX
|
||||
export AS
|
||||
export LD
|
||||
export AR
|
||||
export RM
|
||||
export CPP
|
||||
export SIZE
|
||||
export STRIP
|
||||
export OBJCOPY
|
||||
export OBJDUMP
|
||||
export PYTHON
|
||||
export MKDIR
|
||||
export ECHO
|
||||
export MAKE
|
||||
export CAT
|
||||
export TFLITE2C
|
||||
|
||||
# Export Flags
|
||||
export CFLAGS
|
||||
export AFLAGS
|
||||
export LDFLAGS
|
||||
export MPY_CFLAGS
|
||||
|
||||
# Export variables
|
||||
export TARGET
|
||||
export FIRMWARE
|
||||
export SYSTEM
|
||||
export STARTUP
|
||||
export MICROPY_ARGS
|
||||
export FROZEN_MANIFEST
|
||||
|
||||
# Export board config variables
|
||||
export PORT
|
||||
export HAL_DIR
|
||||
export MCU
|
||||
export MCU_SERIES
|
||||
export MCU_VARIANT
|
||||
export MCU_CORE
|
||||
|
||||
# Export Directories
|
||||
export TOP_DIR
|
||||
export BUILD
|
||||
export TOOLS
|
||||
export FW_DIR
|
||||
export OMV_DIR
|
||||
export CMSIS_DIR
|
||||
export MICROPY_DIR
|
||||
export LEPTON_DIR
|
||||
export LSM6DS3_DIR
|
||||
export LSM6DSOX_DIR
|
||||
export WINC1500_DIR
|
||||
export MLX90621_DIR
|
||||
export MLX90640_DIR
|
||||
export MLX90641_DIR
|
||||
export VL53L5CX_DIR
|
||||
export PIXART_DIR
|
||||
export DISPLAY_DIR
|
||||
export LIBPDM_DIR
|
||||
export TENSORFLOW_DIR
|
||||
export OMV_BOARD_CONFIG_DIR
|
||||
export OMV_PORT_DIR
|
||||
export MP_BOARD_CONFIG_DIR
|
||||
export OMV_LIB_DIR
|
||||
export OMV_COMMON_DIR
|
||||
@ -1,6 +1,6 @@
|
||||
# Set startup and system files based on MCU.
|
||||
SYSTEM ?= mimxrt/system_$(MCU_SERIES)
|
||||
STARTUP ?= mimxrt/startup_$(MCU_SERIES)
|
||||
# Set startup and system files for CMSIS Makefile.
|
||||
SYSTEM ?= mimxrt/system_$(MCU_SERIES)
|
||||
STARTUP ?= mimxrt/startup_$(MCU_SERIES)
|
||||
LDSCRIPT ?= mimxrt
|
||||
|
||||
# Compiler Flags
|
||||
@ -511,34 +511,6 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/,\
|
||||
)
|
||||
endif
|
||||
|
||||
###################################################
|
||||
#Export Variables
|
||||
export Q
|
||||
export CC
|
||||
export CXX
|
||||
export AS
|
||||
export LD
|
||||
export AR
|
||||
export SIZE
|
||||
export OBJCOPY
|
||||
export OBJDUMP
|
||||
export MKDIR
|
||||
export ECHO
|
||||
export CFLAGS
|
||||
export AFLAGS
|
||||
export LDFLAGS
|
||||
export TOP_DIR
|
||||
export BUILD
|
||||
export TOOLS
|
||||
export TARGET
|
||||
export STARTUP
|
||||
export SYSTEM
|
||||
export FROZEN_MANIFEST
|
||||
export PORT
|
||||
export HAL_DIR
|
||||
export CMSIS_DIR
|
||||
export PYTHON
|
||||
export TFLITE2C
|
||||
###################################################
|
||||
all: $(OPENMV)
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
SYSTEM ?= nrf/system_nrf52840
|
||||
STARTUP ?= nrf/startup_$(shell echo $(MCU) | tr '[:upper:]' '[:lower:]')
|
||||
LDSCRIPT ?= nrf52xxx
|
||||
SD_DIR = $(TOP_DIR)/drivers/nrf
|
||||
export SD_DIR = $(TOP_DIR)/drivers/nrf
|
||||
|
||||
# Compiler Flags
|
||||
CFLAGS += -std=gnu99 -Wall -Werror -Warray-bounds -mthumb -nostartfiles -fdata-sections -ffunction-sections
|
||||
@ -369,28 +369,6 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/modules/ulab/code/,\
|
||||
)
|
||||
endif
|
||||
|
||||
###################################################
|
||||
#Export Variables
|
||||
export Q
|
||||
export CC
|
||||
export AS
|
||||
export LD
|
||||
export AR
|
||||
export SIZE
|
||||
export OBJCOPY
|
||||
export OBJDUMP
|
||||
export MKDIR
|
||||
export ECHO
|
||||
export CFLAGS
|
||||
export LDFLAGS
|
||||
export TOP_DIR
|
||||
export BUILD
|
||||
export TARGET
|
||||
export STARTUP
|
||||
export SYSTEM
|
||||
export FROZEN_MANIFEST
|
||||
export PORT
|
||||
export SD_DIR
|
||||
###################################################
|
||||
all: $(OPENMV)
|
||||
|
||||
|
||||
@ -8,9 +8,7 @@
|
||||
# RP2 Makefile.
|
||||
# This just invokes make in MicroPython RP2 port with OpenMV's cmake arg.
|
||||
|
||||
export PORT
|
||||
export TARGET
|
||||
export TOP_DIR
|
||||
export Q=
|
||||
export CC=
|
||||
export CXX=
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Set startup and system files based on MCU.
|
||||
SYSTEM ?= st/system_stm32fxxx
|
||||
STARTUP ?= st/startup_$(shell echo $(MCU) | tr '[:upper:]' '[:lower:]')
|
||||
# Set startup and system files for CMSIS Makefile.
|
||||
SYSTEM ?= st/system_stm32fxxx
|
||||
STARTUP ?= st/startup_$(shell echo $(MCU) | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
LDSCRIPT ?= stm32fxxx
|
||||
|
||||
# Compiler Flags
|
||||
@ -645,32 +646,6 @@ UVC_OBJ += $(wildcard $(BUILD)/$(VL53L5CX_DIR)/src/*.o)
|
||||
UVC_OBJ += $(wildcard $(BUILD)/$(PIXART_DIR)/src/*.o)
|
||||
endif
|
||||
|
||||
###################################################
|
||||
#Export Variables
|
||||
export Q
|
||||
export CC
|
||||
export AS
|
||||
export LD
|
||||
export AR
|
||||
export SIZE
|
||||
export OBJCOPY
|
||||
export OBJDUMP
|
||||
export MKDIR
|
||||
export ECHO
|
||||
export CFLAGS
|
||||
export LDFLAGS
|
||||
export TOP_DIR
|
||||
export BUILD
|
||||
export TOOLS
|
||||
export TARGET
|
||||
export STARTUP
|
||||
export SYSTEM
|
||||
export FROZEN_MANIFEST
|
||||
export PORT
|
||||
export HAL_DIR
|
||||
export CMSIS_DIR
|
||||
export PYTHON
|
||||
export TFLITE2C
|
||||
###################################################
|
||||
all: $(OPENMV)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user