The TARGETS variable can be used when building selftests to specify a subset of selftests to build and run like so:
make -C tools/testing/selftests TARGETS=ptrace run_tests
However specifying TARGETS=vm results in the following build error as the TARGETS variable is used internally in the Makefile:
make[1]: *** No rule to make target 'vm.c', needed by 'linux/kselftest/vm/vm_32'. Stop.
Fix this by renaming the vm Makefile TARGETS variable to BUILD_TARGETS.
Signed-off-by: Alistair Popple apopple@nvidia.com --- tools/testing/selftests/vm/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 73e1cc96d7c2..110751ce8701 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -49,9 +49,9 @@ CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_32bit_progra CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_64bit_program.c) CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_program.c -no-pie)
-TARGETS := protection_keys -BINARIES_32 := $(TARGETS:%=%_32) -BINARIES_64 := $(TARGETS:%=%_64) +BUILD_TARGETS := protection_keys +BINARIES_32 := $(BUILD_TARGETS:%=%_32) +BINARIES_64 := $(BUILD_TARGETS:%=%_64)
ifeq ($(CAN_BUILD_WITH_NOPIE),1) CFLAGS += -no-pie @@ -104,7 +104,7 @@ $(BINARIES_32): CFLAGS += -m32 $(BINARIES_32): LDLIBS += -lrt -ldl -lm $(BINARIES_32): $(OUTPUT)/%_32: %.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ -$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t)))) +$(foreach t,$(BUILD_TARGETS),$(eval $(call gen-target-rule-32,$(t)))) endif
ifeq ($(CAN_BUILD_X86_64),1) @@ -112,7 +112,7 @@ $(BINARIES_64): CFLAGS += -m64 $(BINARIES_64): LDLIBS += -lrt -ldl $(BINARIES_64): $(OUTPUT)/%_64: %.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ -$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t)))) +$(foreach t,$(BUILD_TARGETS),$(eval $(call gen-target-rule-64,$(t)))) endif
# x86_64 users should be encouraged to install 32-bit libraries
This ensures targets such as 'make install' copy test_hmm.sh into the target directoy.
Signed-off-by: Alistair Popple apopple@nvidia.com --- tools/testing/selftests/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 110751ce8701..202fc643de88 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -80,7 +80,7 @@ endif
TEST_PROGS := run_vmtests.sh
-TEST_FILES := test_vmalloc.sh +TEST_FILES := test_vmalloc.sh test_hmm.sh
KSFT_KHDR_INSTALL := 1 include ../lib.mk
linux-kselftest-mirror@lists.linaro.org