diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-25 21:55:07 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-25 21:55:07 -0600 |
commit | 7c03983529f6502206cd40692c794b7c6605d9bf (patch) | |
tree | ecac9afa4928b6a1c040c97662371c01fde046c3 /Makefile | |
parent | 9f4494685a29714c57cc11d62dead71f7004e061 (diff) |
Enable pico-sdk for host binaries
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -33,15 +33,17 @@ libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt ################################################################################ -commands := $(patsubst cmd/%/CMakeLists.txt,%,$(wildcard cmd/*/CMakeLists.txt)) -build: $(foreach c,$(commands),cmd/$c/build) +platforms := $(shell sed -nE 's/if *\(PICO_PLATFORM STREQUAL "(.*)"\)/\1/p' cmd/*/CMakeLists.txt) + +build: $(foreach p,$(platforms),build/$p/build) .PHONY: build -cmd/%/build: build/%/Makefile $(generate/files) +$(foreach p,$(platforms),build/$p/Makefile): build/%/Makefile: + mkdir -p $(@D) && cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=$* ../.. + +$(foreach p,$(platforms),build/$p/build): build/%/build: build/%/Makefile $(MAKE) -C $(<D) -.PHONY: cmd/%/build -build/%/Makefile: cmd/%/CMakeLists.txt - mkdir -p $(@D) && cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Debug -D_UBUILD_CMD=$* $(shell if grep -q pico_sdk_init $<; then echo ' -D_UBUILD_USE_PICO_SDK=1 '; fi) ../.. +.PHONY: $(foreach p,$(platforms),build/$p/build) generate: $(generate/files) .PHONY: generate |