mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
try to fetch needed mcu submodule while running make
This commit is contained in:
parent
0374e08550
commit
c222f6f111
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@ -62,13 +62,14 @@ jobs:
|
|||||||
- name: Checkout TinyUSB
|
- name: Checkout TinyUSB
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'false'
|
||||||
|
|
||||||
- name: Checkout Sub-Submodules
|
- name: Checkout Sub-Submodules
|
||||||
run: |
|
run: |
|
||||||
|
# Clone all submodules in lib
|
||||||
|
git submodule update --init --recursive lib
|
||||||
# some submodule has it own submodules that need to be fetched as well
|
# some submodule has it own submodules that need to be fetched as well
|
||||||
git submodule update --init --recursive hw/mcu/microchip
|
#git submodule update --init --recursive hw/mcu/microchip
|
||||||
git submodule update --init --recursive lib/FreeRTOS
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||||
|
@ -16,19 +16,7 @@ __check_defined = \
|
|||||||
$(if $(value $1),, \
|
$(if $(value $1),, \
|
||||||
$(error Undefined make flag: $1$(if $2, ($2))))
|
$(error Undefined make flag: $1$(if $2, ($2))))
|
||||||
|
|
||||||
# TODO Check if submodule haven't checkout yet
|
|
||||||
fetch_submodule_if_empty = \
|
|
||||||
ifeq ($(wildcard $(TOP)/$1/*),) \
|
|
||||||
$(info $(shell git -C $(TOP) submodule update --init)) \
|
|
||||||
endif
|
|
||||||
|
|
||||||
#-------------- Select the board to build for. ------------
|
#-------------- Select the board to build for. ------------
|
||||||
#BOARD_LIST = $(sort $(subst /.,,$(subst $(TOP)/hw/bsp/,,$(wildcard $(TOP)/hw/bsp/*/.))))
|
|
||||||
#ifeq ($(filter $(BOARD),$(BOARD_LIST)),)
|
|
||||||
# $(info You must provide a BOARD parameter with 'BOARD=', supported boards are:)
|
|
||||||
# $(foreach b,$(BOARD_LIST),$(info - $(b)))
|
|
||||||
# $(error Invalid BOARD specified)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
# Board without family
|
# Board without family
|
||||||
BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD)))
|
BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD)))
|
||||||
@ -42,6 +30,7 @@ ifeq ($(BOARD_PATH),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BOARD_PATH),)
|
ifeq ($(BOARD_PATH),)
|
||||||
|
$(info You must provide a BOARD parameter with 'BOARD=')
|
||||||
$(error Invalid BOARD specified)
|
$(error Invalid BOARD specified)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -56,6 +45,16 @@ endif
|
|||||||
|
|
||||||
#TODO $(call fetch_submodule_if_empty,lib/sct_neopixel)
|
#TODO $(call fetch_submodule_if_empty,lib/sct_neopixel)
|
||||||
|
|
||||||
|
# Fetch submodules depended by family
|
||||||
|
fetch_submodule_if_empty = \
|
||||||
|
ifeq ($(wildcard $(TOP)/$1/*),) \
|
||||||
|
$(info $(shell git -C $(TOP) submodule update --init $1)) \
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef FAMILY_SUBMODULES
|
||||||
|
$(foreach s,$(FAMILY_SUBMODULES),:$(call fetch_submodule_if_empty,$(s)))
|
||||||
|
endif
|
||||||
|
|
||||||
#-------------- Cross Compiler ------------
|
#-------------- Cross Compiler ------------
|
||||||
# Can be set by board, default to ARM GCC
|
# Can be set by board, default to ARM GCC
|
||||||
CROSS_COMPILE ?= arm-none-eabi-
|
CROSS_COMPILE ?= arm-none-eabi-
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
.DEFAULT_GOAL := all
|
.DEFAULT_GOAL := all
|
||||||
|
|
||||||
ifeq ($(FAMILY),esp32s2)
|
ifeq ($(FAMILY),esp32s2)
|
||||||
|
# ---------------------------------------
|
||||||
# Espressif IDF use CMake build system, this add wrapper target to call idf.py
|
# Espressif IDF use CMake build system, this add wrapper target to call idf.py
|
||||||
|
# ---------------------------------------
|
||||||
|
|
||||||
.PHONY: all clean flash
|
.PHONY: all clean flash
|
||||||
|
|
||||||
@ -44,6 +46,9 @@ $(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin
|
|||||||
$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^
|
$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^
|
||||||
|
|
||||||
else ifeq ($(FAMILY),rp2040)
|
else ifeq ($(FAMILY),rp2040)
|
||||||
|
# ---------------------------------------
|
||||||
|
# RP2040 CMake
|
||||||
|
# ---------------------------------------
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
|
CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
|
||||||
@ -62,7 +67,9 @@ flash:
|
|||||||
@$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
|
@$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
|
||||||
|
|
||||||
else
|
else
|
||||||
|
# ---------------------------------------
|
||||||
# GNU Make build system
|
# GNU Make build system
|
||||||
|
# ---------------------------------------
|
||||||
|
|
||||||
# libc
|
# libc
|
||||||
LIBS += -lgcc -lm -lnosys
|
LIBS += -lgcc -lm -lnosys
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
UF2_FAMILY_ID = 0x4fb2d5bd
|
UF2_FAMILY_ID = 0x4fb2d5bd
|
||||||
|
FAMILY_SUBMODULES = hw/mcu/nxp
|
||||||
|
|
||||||
include $(TOP)/$(BOARD_PATH)/board.mk
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
UF2_FAMILY_ID = 0xADA52840
|
UF2_FAMILY_ID = 0xADA52840
|
||||||
|
FAMILY_SUBMODULES = hw/mcu/nordic/nrfx
|
||||||
|
|
||||||
include $(TOP)/$(BOARD_PATH)/board.mk
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user