commit 34121e8a63e8dedc3e50fb4a9fb8f624768c79fe parent 8069562a2f7b530cd190cf06e0d88f1350d8d41d Author: Louis Burda <quent.burda@gmail.com> Date: Tue, 27 Dec 2022 16:48:39 +0100 Automatically clone submodules and patch tinyusb on initial make Diffstat:
M | Makefile | | | 20 | +++++++++++++------- |
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,5 +1,10 @@ FAMILY ?= rp2040 + PICO_SDK_PATH ?= lib/picosdk +TINYUSB_PATH ?= lib/tinyusb + +PICO_SCK_FILES = $(PICO_SDK_PATH)/CMakeLists.txt +TINYUSB_FILES = $(TINYUSB_PATH)/hw/bsp/family_support.cmake CMAKE_FLAGS = -DFAMILY=$(FAMILY) -DPICO_SDK_PATH=$(PICO_SDK_PATH) CMAKE_FLAGS_LEFT = $(CMAKE_FLAGS) -DSPLIT_SIDE=LEFT $(CMAKE_FLAGS_LEFT_EXTRA) @@ -10,21 +15,22 @@ all: left right clean: rm -rf .build -left: | $(PICO_SDK_PATH) .build/left +left: | $(PICO_SDK_FILES) $(TINYUSB_FILES) .build/left cmake -B .build/left $(CMAKE_FLAGS_LEFT) make -C .build/left -right: | $(PICO_SDK_PATH) .build/right +right: | $(PICO_SDK_FILES $(TINYUSB_FILES) .build/right cmake -B .build/right $(CMAKE_FLAGS_RIGHT) make -C .build/right -lib/picosdk: +$(PICO_SDK_FILES): git submodule update --init lib/picosdk -.build/left: - mkdir -p $@ +$(TINYUSB_FILES): + git submodule update --init lib/tinyusb + git -C lib/tinyusb apply ../../extra/tinyusb.diff -.build/right: +.build/left .build/right: mkdir -p $@ flash_left: @@ -33,4 +39,4 @@ flash_left: flash_right: picotool load .build/right/sxkbd.uf2 -.PHONY: all clean left right upload +.PHONY: all clean left right flash_left flash_right