Skip to content

Commit 53db231

Browse files
committed
add get-dependencies.py
1 parent 5323472 commit 53db231

File tree

7 files changed

+45
-9
lines changed

7 files changed

+45
-9
lines changed

.github/workflows/build_aarch64.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555
- name: Set Toolchain Path
5656
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
5757

58+
- name: Get Dependencies
59+
run: python3 tools/get_dependencies.py ${{ matrix.family }}
60+
5861
- name: Build
5962
run: python3 tools/build_family.py ${{ matrix.family }}
6063

.github/workflows/build_arm.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ jobs:
8989
run: |
9090
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
9191
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
92-
git submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB
9392
9493
- name: Get Dependencies
95-
run: |
96-
b=`find hw/bsp/${{ matrix.family }}/boards -depth -maxdepth 1 -type d -name '[^.]?*' -printf %f -quit`
97-
make -C examples/device/board_test BOARD=${b} get-deps
94+
run: python3 tools/get_dependencies.py ${{ matrix.family }}
9895

9996
- name: Build
10097
run: python3 tools/build_family.py ${{ matrix.family }}
@@ -127,16 +124,16 @@ jobs:
127124
- name: Setup Python
128125
uses: actions/setup-python@v3
129126

127+
- name: Install ARM GCC
128+
uses: carlosperate/arm-none-eabi-gcc-action@v1
129+
with:
130+
release: '11.2-2022.02'
131+
130132
- name: Checkout TinyUSB
131133
uses: actions/checkout@v3
132134

133135
- name: Checkout common submodules in lib
134136
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
135137

136-
- name: Install ARM GCC
137-
uses: carlosperate/arm-none-eabi-gcc-action@v1
138-
with:
139-
release: '11.2-2022.02'
140-
141138
- name: Build
142139
run: python3 tools/build_board.py ${{ matrix.example }}

.github/workflows/build_msp430.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
- name: Set Toolchain Path
5353
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
5454

55+
- name: Get Dependencies
56+
run: python3 tools/get_dependencies.py ${{ matrix.family }}
57+
5558
- name: Build
5659
run: python3 tools/build_family.py ${{ matrix.family }}
5760

.github/workflows/build_renesas.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353
- name: Set Toolchain Path
5454
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
5555

56+
- name: Get Dependencies
57+
run: python3 tools/get_dependencies.py ${{ matrix.family }}
58+
5659
- name: Build
5760
run: python3 tools/build_family.py ${{ matrix.family }}
5861

.github/workflows/build_riscv.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353
- name: Set Toolchain Path
5454
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
5555

56+
- name: Get Dependencies
57+
run: python3 tools/get_dependencies.py ${{ matrix.family }}
58+
5659
- name: Build
5760
run: python3 tools/build_family.py ${{ matrix.family }}
5861

hw/bsp/rp2040/family.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
JLINK_DEVICE = rp2040_m0_0
22
PYOCD_TARGET = rp2040
33

4+
DEPS_SUBMODULES += hw/mcu/raspberry_pi/Pico-PIO-USB
5+
46
ifeq ($(DEBUG), 1)
57
CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
68
endif

tools/get_dependencies.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
import sys
3+
import subprocess
4+
5+
6+
# dependency lookup (ABC sorted)
7+
# deps = {
8+
# 'LPC11UXX' : [ [] ]
9+
# }
10+
11+
12+
def get_family_dep(family):
13+
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
14+
if entry.is_dir():
15+
result = subprocess.run("make -C examples/device/board_test BOARD={} get-deps".format(entry.name),
16+
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
17+
print(result.stdout.decode("utf-8"))
18+
return result.returncode
19+
20+
status = 0
21+
all_family = sys.argv[1:]
22+
for f in all_family:
23+
status += get_family_dep(f)
24+
25+
sys.exit(status)

0 commit comments

Comments
 (0)