summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-07-01 16:24:58 +0700
committerhathach <[email protected]>2022-07-01 16:24:58 +0700
commit12341118e373cce10cb868f234009e9d37bff940 (patch)
tree87a8f0104f931b4034d362ef9f8f6e9b5575e1e1
parent8f9ecace4d9fecb14fbf8e8563d2f19334805d4d (diff)
add get-deps target
update ci to get-deps first
-rw-r--r--.github/workflows/build_arm.yml13
-rw-r--r--docs/reference/getting_started.rst7
-rw-r--r--examples/make.mk5
-rw-r--r--examples/rules.mk27
4 files changed, 33 insertions, 19 deletions
diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml
index 27cb9f1f7..7cc1b10f9 100644
--- a/.github/workflows/build_arm.yml
+++ b/.github/workflows/build_arm.yml
@@ -67,6 +67,11 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
+ - name: Install ARM GCC
+ uses: carlosperate/arm-none-eabi-gcc-action@v1
+ with:
+ release: '11.2-2022.02'
+
- name: Checkout TinyUSB
uses: actions/checkout@v3
@@ -86,10 +91,10 @@ jobs:
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
git submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB
- - name: Install ARM GCC
- uses: carlosperate/arm-none-eabi-gcc-action@v1
- with:
- release: '11.2-2022.02'
+ - name: Get Dependencies
+ run: |
+ b=`find hw/bsp/${{ matrix.family }}/boards -depth -maxdepth 1 -type d -name '[^.]?*' -printf %f -quit`
+ make BOARD={b} get-deps
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
diff --git a/docs/reference/getting_started.rst b/docs/reference/getting_started.rst
index fa5c51eff..1088d4700 100644
--- a/docs/reference/getting_started.rst
+++ b/docs/reference/getting_started.rst
@@ -50,7 +50,12 @@ Some TinyUSB examples also requires external submodule libraries in ``/lib`` suc
$ git submodule update --init lib
-In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. Luckily, it will be fetched if needed when you run the ``make`` to build your board.
+In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. To download these depencies for your board, run the ``get-dpes`` as follow.
+
+.. code-block::
+
+ $ make BOARD=feather_nrf52840_express get-deps
+
Some modules will also require a module-specific SDK (e.g. RP2040) or binary (e.g. Sony Spresense) to build examples.
diff --git a/examples/make.mk b/examples/make.mk
index 27e1db38c..47520d660 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -45,11 +45,6 @@ else
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
endif
-# Fetch submodules depended by family
-fetch_submodule_if_empty = $(if $(wildcard $(TOP)/$1/*),,$(info $(shell git -C $(TOP) submodule update --init $1)))
-ifdef DEPS_SUBMODULES
- $(foreach s,$(DEPS_SUBMODULES),$(call fetch_submodule_if_empty,$(s)))
-endif
#-------------- Cross Compiler ------------
# Can be set by board, default to ARM GCC
diff --git a/examples/rules.mk b/examples/rules.mk
index 538dffbcf..c3134056a 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -5,6 +5,7 @@
# Set all as default goal
.DEFAULT_GOAL := all
+# ---------------- GNU Make Start -----------------------
# ESP32-Sx and RP2040 has its own CMake build system
ifeq (,$(findstring $(FAMILY),esp32s2 esp32s3 rp2040))
@@ -141,7 +142,23 @@ $(BUILD)/obj/%_asm.o: %.S
@echo AS $(notdir $@)
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
-endif # GNU Make
+endif
+
+.PHONY: clean
+clean:
+ifeq ($(CMDEXE),1)
+ rd /S /Q $(subst /,\,$(BUILD))
+else
+ $(RM) -rf $(BUILD)
+endif
+# ---------------- GNU Make End -----------------------
+
+# get depenecies
+.PHONY: get-deps
+get-deps:
+ ifdef DEPS_SUBMODULES
+ git -C $(TOP) submodule update --init $(DEPS_SUBMODULES)
+ endif
size: $(BUILD)/$(PROJECT).elf
-@echo ''
@@ -152,14 +169,6 @@ size: $(BUILD)/$(PROJECT).elf
linkermap: $(BUILD)/$(PROJECT).elf
@linkermap -v $<.map
-.PHONY: clean
-clean:
-ifeq ($(CMDEXE),1)
- rd /S /Q $(subst /,\,$(BUILD))
-else
- $(RM) -rf $(BUILD)
-endif
-
# ---------------------------------------
# Flash Targets
# ---------------------------------------