summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-17 19:18:21 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-26 20:09:06 -0700
commit1aecc70750ee6ce9c96ebf3e6b4a7fb322ff8ca3 (patch)
tree1e2c607ae9980b47917effe4203b4448a1dd4c5f /GNUmakefile
parentc7a0d6de46610ac9ceaea5afe1b7983550fc1be6 (diff)
Build the full matrix of CMAKE_BUILD_TYPE
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile17
1 files changed, 9 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 9f5ad61..098f076 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -61,24 +61,25 @@ generate-clean:
# `build` and `check` ##########################################################
platforms := $(shell sed -nE 's/if *\(PICO_PLATFORM STREQUAL "(.*)"\)/\1/p' cmd/*/CMakeLists.txt)
+build_types = Debug Release RelWithDebInfo MinSizeRel
-build: $(foreach p,$(platforms),build/$p/build)
+build: $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/build))
.PHONY: build
-$(foreach p,$(platforms),build/$p/Makefile): build/%/Makefile:
- mkdir -p $(@D) && cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=$* ../..
+$(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/Makefile)): build/%/Makefile:
+ mkdir -p $(@D) && cd $(@D) && cmake -DPICO_PLATFORM=$(firstword $(subst -, ,$*)) -DCMAKE_BUILD_TYPE=$(lastword $(subst -, ,$*)) ../..
-$(foreach p,$(platforms),build/$p/build): build/%/build: build/%/Makefile generate
+$(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/build)): build/%/build: build/%/Makefile generate
$(MAKE) -C $(<D)
-.PHONY: $(foreach p,$(platforms),build/$p/build)
+.PHONY: $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/build))
check: build
- $(MAKE) -j1 -k $(foreach p,$(platforms),build/$p/check)
+ $(MAKE) -j1 -k $(foreach t,$(build-types),$(foreach p,$(platforms),build/$p-$t/check))
.PHONY: check
-$(foreach p,$(platforms),build/$p/check): build/%/check: build/%/Makefile
+$(foreach t,$(build-types),$(foreach p,$(platforms),build/$p-$t/check)): build/%/check: build/%/Makefile
CTEST_OUTPUT_ON_FAILURE=1 $(MAKE) -C $(<D) test
-.PHONY: $(foreach p,$(platforms),build/$p/check)
+.PHONY: $(foreach t,$(build-types),$(foreach p,$(platforms),build/$p-$t/check))
# `lint` and `format` ##########################################################