summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-27 20:45:36 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-27 20:45:36 -0600
commitfa357459f88bb8f0170d1a68df66e7d068d59996 (patch)
tree8585b5755ae224c6609f982d973141f1f6bad97b /Makefile
parentd54ddec236bf9bdb8c032cd5fbdb0aa46ffebe86 (diff)
fixes
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 6ae28e5..39f85ff 100644
--- a/Makefile
+++ b/Makefile
@@ -28,11 +28,15 @@ libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt
################################################################################
-build: build/Makefile $(generate/files)
+commands := $(patsubst cmd/%/CMakeLists.txt,%,$(wildcard cmd/*/CMakeLists.txt))
+build: $(foreach c,$(commands),cmd/$c/build)
.PHONY: build
-build/Makefile:
- mkdir -p build && cd build && cmake ..
+cmd/%/build: build/%/Makefile $(generate/files)
+ $(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) ../..
generate: $(generate/files)
.PHONY: generate