summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 3abe629..7dc3a5e 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -42,6 +42,7 @@ libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt
$^
generate/files += build-aux/sources.mk
+ifeq ($(INNER),)
build-aux/sources.mk: $(if $(wildcard .git),FORCE)
git ls-files | grep -vFx $(foreach f,$(generate/files),-e $f) \
| sed 's,^,$(CURDIR)/,' | xargs editorconfig \
@@ -50,6 +51,7 @@ build-aux/sources.mk: $(if $(wildcard .git),FORCE)
| sort \
>$@.tmp
if ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi
+endif
generate: $(generate/files)
.PHONY: generate
@@ -70,15 +72,15 @@ $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/Makefile)): buil
mkdir -p $(@D) && cd $(@D) && cmake -DPICO_PLATFORM=$(firstword $(subst -, ,$*)) -DCMAKE_BUILD_TYPE=$(lastword $(subst -, ,$*)) ../..
$(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/build)): build/%/build: build/%/Makefile generate
- $(MAKE) -C $(<D)
+ $(MAKE) -C $(<D) INNER=t
.PHONY: $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/build))
check: build
- $(MAKE) -j1 -k $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check))
+ $(MAKE) -j1 -k INNER=t $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check))
.PHONY: check
$(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check)): build/%/check: build/%/Makefile
- CTEST_OUTPUT_ON_FAILURE=1 $(MAKE) -C $(<D) test
+ CTEST_OUTPUT_ON_FAILURE=1 $(MAKE) -C $(<D) INNER=t test
.PHONY: $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check))
# `lint` and `format` ##########################################################
@@ -93,7 +95,7 @@ build-aux/venv: build-aux/requirements.txt
# `lint` ###########
lint:
- $(MAKE) -k $(patsubst sources_%,lint/%,$(filter sources_%,$(.VARIABLES)))
+ $(MAKE) -k INNER=t $(patsubst sources_%,lint/%,$(filter sources_%,$(.VARIABLES)))
lint/sh lint/bash: lint/%:
shellcheck $(sources_$*)
lint/python3: lint/%: build-aux/venv
@@ -112,7 +114,7 @@ lint/all: lint/%: build-aux/lint-generic build-aux/get-dscname
# `format` #########
format:
- $(MAKE) -k $(patsubst sources_%,format/%,$(filter-out sources_all,$(filter sources_%,$(.VARIABLES))))
+ $(MAKE) -k INNER=t $(patsubst sources_%,format/%,$(filter-out sources_all,$(filter sources_%,$(.VARIABLES))))
format/python3: format/%: ./build-aux/venv
./build-aux/venv/bin/black $(sources_$*)
./build-aux/venv/bin/isort $(sources_$*)