diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 17 |
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` ########################################################## |