kselftest/vm: Rename TARGETS to BUILD_TARGETS
Subsystems (2)
PATCH 1/2 kselftest/vm: Rename TARGETS to BUILD_TARGETS
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 <[email protected]>
--- tools/testing/selftests/vm/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/testing/selftests/vm/Makefile +5 -5
@@ -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
Signature · 1 line
2.20.1
PATCH 2/2 kselftest/vm: Add test_hmm.sh to TEST_FILES
This ensures targets such as 'make install' copy test_hmm.sh into the target directoy.
Signed-off-by Alistair Popple <[email protected]>
--- tools/testing/selftests/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/Makefile +1 -1
@@ -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
Signature · 1 line
2.20.1