Skip to content

Commit 1234111

Browse files
committed
add get-deps target
update ci to get-deps first
1 parent 8f9ecac commit 1234111

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

.github/workflows/build_arm.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ jobs:
6767
- name: Setup Python
6868
uses: actions/setup-python@v3
6969

70+
- name: Install ARM GCC
71+
uses: carlosperate/arm-none-eabi-gcc-action@v1
72+
with:
73+
release: '11.2-2022.02'
74+
7075
- name: Checkout TinyUSB
7176
uses: actions/checkout@v3
7277

@@ -86,10 +91,10 @@ jobs:
8691
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
8792
git submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB
8893
89-
- name: Install ARM GCC
90-
uses: carlosperate/arm-none-eabi-gcc-action@v1
91-
with:
92-
release: '11.2-2022.02'
94+
- name: Get Dependencies
95+
run: |
96+
b=`find hw/bsp/${{ matrix.family }}/boards -depth -maxdepth 1 -type d -name '[^.]?*' -printf %f -quit`
97+
make BOARD={b} get-deps
9398
9499
- name: Build
95100
run: python3 tools/build_family.py ${{ matrix.family }}

docs/reference/getting_started.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ Some TinyUSB examples also requires external submodule libraries in ``/lib`` suc
5050
5151
$ git submodule update --init lib
5252
53-
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.
53+
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.
54+
55+
.. code-block::
56+
57+
$ make BOARD=feather_nrf52840_express get-deps
58+
5459
5560
Some modules will also require a module-specific SDK (e.g. RP2040) or binary (e.g. Sony Spresense) to build examples.
5661

examples/make.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ else
4545
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
4646
endif
4747

48-
# Fetch submodules depended by family
49-
fetch_submodule_if_empty = $(if $(wildcard $(TOP)/$1/*),,$(info $(shell git -C $(TOP) submodule update --init $1)))
50-
ifdef DEPS_SUBMODULES
51-
$(foreach s,$(DEPS_SUBMODULES),$(call fetch_submodule_if_empty,$(s)))
52-
endif
5348

5449
#-------------- Cross Compiler ------------
5550
# Can be set by board, default to ARM GCC

examples/rules.mk

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Set all as default goal
66
.DEFAULT_GOAL := all
77

8+
# ---------------- GNU Make Start -----------------------
89
# ESP32-Sx and RP2040 has its own CMake build system
910
ifeq (,$(findstring $(FAMILY),esp32s2 esp32s3 rp2040))
1011

@@ -141,7 +142,23 @@ $(BUILD)/obj/%_asm.o: %.S
141142
@echo AS $(notdir $@)
142143
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
143144

144-
endif # GNU Make
145+
endif
146+
147+
.PHONY: clean
148+
clean:
149+
ifeq ($(CMDEXE),1)
150+
rd /S /Q $(subst /,\,$(BUILD))
151+
else
152+
$(RM) -rf $(BUILD)
153+
endif
154+
# ---------------- GNU Make End -----------------------
155+
156+
# get depenecies
157+
.PHONY: get-deps
158+
get-deps:
159+
ifdef DEPS_SUBMODULES
160+
git -C $(TOP) submodule update --init $(DEPS_SUBMODULES)
161+
endif
145162

146163
size: $(BUILD)/$(PROJECT).elf
147164
-@echo ''
@@ -152,14 +169,6 @@ size: $(BUILD)/$(PROJECT).elf
152169
linkermap: $(BUILD)/$(PROJECT).elf
153170
@linkermap -v $<.map
154171

155-
.PHONY: clean
156-
clean:
157-
ifeq ($(CMDEXE),1)
158-
rd /S /Q $(subst /,\,$(BUILD))
159-
else
160-
$(RM) -rf $(BUILD)
161-
endif
162-
163172
# ---------------------------------------
164173
# Flash Targets
165174
# ---------------------------------------

0 commit comments

Comments
 (0)