Make phony makefile targets more obvious

Instead of one long line declaring a lot of makefile targets as phony, include a
line like `.PHONY: <target>` immediately above each one.  This makes the
makefile longer, but it's now obvious if the target you're looking at is phony.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1155/head
Michael Richters 2 years ago
parent 3de83322e5
commit 67d47d6904
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -40,13 +40,16 @@ endif
DEFAULT_GOAL: smoke-sketches DEFAULT_GOAL: smoke-sketches
.PHONY: setup
setup: $(ARDUINO_CLI_PATH) $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml install-arduino-core-avr install-arduino-core-kaleidoscope $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt setup: $(ARDUINO_CLI_PATH) $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml install-arduino-core-avr install-arduino-core-kaleidoscope $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt
@: @:
.PHONY: checkout-platform
checkout-platform: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt checkout-platform: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt
@: @:
.PHONY: prepare-virtual
prepare-virtual: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt prepare-virtual: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt
@: @:
@ -68,27 +71,33 @@ $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt:
--recurse-submodules=':(exclude)libraries/Kaleidoscope' \ --recurse-submodules=':(exclude)libraries/Kaleidoscope' \
https://github.com/keyboardio/ArduinoCore-GD32-Keyboardio $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32 https://github.com/keyboardio/ArduinoCore-GD32-Keyboardio $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32
.PHONY: update
update: update:
cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio; git pull; \ cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio; git pull; \
git submodule update --init --recursive git submodule update --init --recursive
cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32; git pull; \ cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32; git pull; \
git submodule update --init --recursive git submodule update --init --recursive
.PHONY: simulator-tests
simulator-tests: simulator-tests:
ifneq ($(_using_old_make),) ifneq ($(_using_old_make),)
$(info You're using an older version of GNU Make that doesn't offer the --output-sync option. If you're running the test suite in parallel, output may be garbled. You might consider using GNU Make 4.0 or later instead) $(info You're using an older version of GNU Make that doesn't offer the --output-sync option. If you're running the test suite in parallel, output may be garbled. You might consider using GNU Make 4.0 or later instead)
endif endif
$(MAKE) -C tests all $(MAKE) -C tests all
.PHONY: docker-simulator-tests
docker-simulator-tests: docker-simulator-tests:
ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "make simulator-tests $(TEST_PATH_ARG)" ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "make simulator-tests $(TEST_PATH_ARG)"
.PHONY: docker-clean
docker-clean: docker-clean:
_NO_SYNC_KALEIDOSCOPE=1 ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "rm -rf -- testing/googletest/build/* _build/* /kaleidoscope-persist/temp/*" _NO_SYNC_KALEIDOSCOPE=1 ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "rm -rf -- testing/googletest/build/* _build/* /kaleidoscope-persist/temp/*"
.PHONY: docker-bash
docker-bash: docker-bash:
_NO_SYNC_KALEIDOSCOPE=1 DOCKER_LIVE_KALEIDOSCOPE_DIR=1 ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "bash" _NO_SYNC_KALEIDOSCOPE=1 DOCKER_LIVE_KALEIDOSCOPE_DIR=1 ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "bash"
.PHONY: run-tests
run-tests: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt build-gtest-gmock run-tests: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt build-gtest-gmock
$(MAKE) -c tests $(MAKE) -c tests
@: # blah @: # blah
@ -97,17 +106,19 @@ build-gtest-gmock:
(cd testing/googletest && cmake -H. -Bbuild -DCMAKE_C_COMPILER=$(call _arduino_prop,compiler.path)$(call _arduino_prop,compiler.c.cmd) -DCMAKE_CXX_COMPILER=$(call _arduino_prop,compiler.path)$(call _arduino_prop,compiler.cpp.cmd) .) (cd testing/googletest && cmake -H. -Bbuild -DCMAKE_C_COMPILER=$(call _arduino_prop,compiler.path)$(call _arduino_prop,compiler.c.cmd) -DCMAKE_CXX_COMPILER=$(call _arduino_prop,compiler.path)$(call _arduino_prop,compiler.cpp.cmd) .)
$(MAKE) -C testing/googletest $(MAKE) -C testing/googletest
.PHONY: find-filename-conflicts
find-filename-conflicts: find-filename-conflicts:
bin/find-filename-conflicts.py src plugins/* bin/find-filename-conflicts.py src plugins/*
.PHONY: format check-formatting cpplint cpplint-noisy shellcheck smoke-examples find-filename-conflicts prepare-virtual checkout-platform adjust-git-timestamps docker-bash docker-simulator-tests run-tests simulator-tests setup
.PHONY: format
format: format:
bin/format-code.py \ bin/format-code.py \
--exclude-dir 'testing/googletest' \ --exclude-dir 'testing/googletest' \
--exclude-file 'generated-testcase.cpp' \ --exclude-file 'generated-testcase.cpp' \
src plugins examples testing src plugins examples testing
.PHONY: check-formatting
check-formatting: check-formatting:
bin/format-code.py \ bin/format-code.py \
--exclude-dir 'testing/googletest' \ --exclude-dir 'testing/googletest' \
@ -116,13 +127,16 @@ check-formatting:
--verbose \ --verbose \
src plugins examples testing src plugins examples testing
.PHONY: cpplint-noisy
cpplint-noisy: cpplint-noisy:
-bin/cpplint.py --config=.cpplint-noisy --recursive src plugins examples -bin/cpplint.py --config=.cpplint-noisy --recursive src plugins examples
.PHONY: cpplint
cpplint: cpplint:
bin/cpplint.py --config=.cpplint --quiet --recursive src plugins examples bin/cpplint.py --config=.cpplint --quiet --recursive src plugins examples
.PHONY: shellcheck
shellcheck: shellcheck:
bin/check-shell-scripts.sh bin/check-shell-scripts.sh
@ -131,14 +145,14 @@ SMOKE_SKETCHES := $(sort $(shell if [ -d ./examples ]; then find ./examples -typ
smoke-sketches: $(SMOKE_SKETCHES) smoke-sketches: $(SMOKE_SKETCHES)
@echo "Smoke-tested all the sketches" @echo "Smoke-tested all the sketches"
.PHONY: force all clean test
.PHONY: clean
clean: clean:
$(MAKE) -C tests clean $(MAKE) -C tests clean
rm -rf -- "testing/googletest/build/*" rm -rf -- "testing/googletest/build/*"
rm -rf -- "_build/*" rm -rf -- "_build/*"
.PHONY: force
$(SMOKE_SKETCHES): force $(SMOKE_SKETCHES): force
$(MAKE) -C $@ -f $(KALEIDOSCOPE_ETC_DIR)/makefiles/sketch.mk compile $(MAKE) -C $@ -f $(KALEIDOSCOPE_ETC_DIR)/makefiles/sketch.mk compile

@ -46,12 +46,13 @@ include $(top_dir)/etc/makefiles/arduino-cli.mk
KALEIDOSCOPE_ETC_DIR ?= $(top_dir)/etc KALEIDOSCOPE_ETC_DIR ?= $(top_dir)/etc
.PHONY: clean cmake-clean all googletest
.PHONY: all
all: ${libcommon_a} googletest ${TESTS} all: ${libcommon_a} googletest ${TESTS}
@: @:
.PHONY: cmake-clean
cmake-clean: cmake-clean:
rm -rf "${top_dir}"/testing/googletest/build/* rm -rf "${top_dir}"/testing/googletest/build/*
@ -65,6 +66,7 @@ run-all: ${TESTS}
.PHONY: clean
clean: cmake-clean clean: cmake-clean
@for test in ${TESTS}; do \ @for test in ${TESTS}; do \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk \ ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk \
@ -73,6 +75,7 @@ clean: cmake-clean
done done
rm -rf "${build_dir}"/* rm -rf "${build_dir}"/*
.PHONY: googletest
googletest: ${top_dir}/testing/googletest/build/Makefile googletest: ${top_dir}/testing/googletest/build/Makefile
${MAKE} -C ${top_dir}/testing/googletest/build ${MAKE} -C ${top_dir}/testing/googletest/build

Loading…
Cancel
Save