From dbeed3c767f9e051721a869a7ec244c5385e19de Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 26 Mar 2022 18:57:16 -0700 Subject: [PATCH] Apply some of our makefile optimization techniques to the test suite --- testing/makefiles/testcase.mk | 21 +++++++++++++++++++++ tests/Makefile | 21 ++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/testing/makefiles/testcase.mk b/testing/makefiles/testcase.mk index 9192fb77..99bce816 100644 --- a/testing/makefiles/testcase.mk +++ b/testing/makefiles/testcase.mk @@ -1,3 +1,24 @@ +# Reset a bunch of historical GNU make implicit rules that we never +# use, but which have a disastrous impact on performance +# +# --no-builtin-rules in MAKEFLAGS apparently came in with GNU Make 4, +# which is newer than what Apple ships +MAKEFLAGS += --no-builtin-rules + +# These lines reset the implicit rules we really care about +%:: %,v + +%:: RCS/%,v + +%:: RCS/% + +%:: s.% + +%:: SCCS/s.% + +.SUFFIXES: + + mkfile_dir := $(dir $(lastword ${MAKEFILE_LIST})) top_dir := $(abspath $(mkfile_dir)../..) diff --git a/tests/Makefile b/tests/Makefile index 28b0c12b..8859e323 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,3 +1,22 @@ +# Reset a bunch of historical GNU make implicit rules that we never +# use, but which have a disastrous impact on performance +# +# --no-builtin-rules in MAKEFLAGS apparently came in with GNU Make 4, +# which is newer than what Apple ships +MAKEFLAGS += --no-builtin-rules + +# These lines reset the implicit rules we really care about +%:: %,v + +%:: RCS/%,v + +%:: RCS/% + +%:: s.% + +%:: SCCS/s.% + +.SUFFIXES: tests_dir := $(abspath $(dir $(lastword ${MAKEFILE_LIST}))) @@ -13,7 +32,7 @@ TEST_PATH ?= ./ export FQBN ?= keyboardio:virtual:model01 -TESTS ?= $(shell cd $(tests_dir); find ${TEST_PATH} -name '*.ino' -exec dirname {} \;) +TESTS := $(shell cd $(tests_dir); find ${TEST_PATH} -name '*.ino' -exec dirname {} \;) include $(top_dir)/etc/makefiles/arduino-cli.mk