linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kselftest/vm: Rename TARGETS to BUILD_TARGETS
@ 2021-05-24 13:03 Alistair Popple
  2021-05-24 13:03 ` [PATCH 2/2] kselftest/vm: Add test_hmm.sh to TEST_FILES Alistair Popple
  0 siblings, 1 reply; 3+ messages in thread
From: Alistair Popple @ 2021-05-24 13:03 UTC (permalink / raw)
  To: linux-kselftest
  Cc: linux-kernel, linux-mm, shuah, akpm, jhubbard, sandipan,
	linuxram, harish, dave.hansen, rcampbell, Alistair Popple

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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] kselftest/vm: Add test_hmm.sh to TEST_FILES
  2021-05-24 13:03 [PATCH 1/2] kselftest/vm: Rename TARGETS to BUILD_TARGETS Alistair Popple
@ 2021-05-24 13:03 ` Alistair Popple
  0 siblings, 0 replies; 3+ messages in thread
From: Alistair Popple @ 2021-05-24 13:03 UTC (permalink / raw)
  To: linux-kselftest
  Cc: linux-kernel, linux-mm, shuah, akpm, jhubbard, sandipan,
	linuxram, harish, dave.hansen, rcampbell, Alistair Popple

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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] kselftest/vm: Rename TARGETS to BUILD_TARGETS
@ 2022-03-03 23:33 Yosry Ahmed
  0 siblings, 0 replies; 3+ messages in thread
From: Yosry Ahmed @ 2022-03-03 23:33 UTC (permalink / raw)
  To: apopple
  Cc: akpm, dave.hansen, harish, jhubbard, linux-kernel,
	linux-kselftest, linux-mm, linuxram, rcampbell, sandipan, shuah

I ran into the same problem when running:

make -C tools/testing/selftests TARGETS=vm

I was going to send a fix but I found this one deep in the mailing list.

Reviewed-by: Yosry Ahmed <yosryahmed@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-03 23:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 13:03 [PATCH 1/2] kselftest/vm: Rename TARGETS to BUILD_TARGETS Alistair Popple
2021-05-24 13:03 ` [PATCH 2/2] kselftest/vm: Add test_hmm.sh to TEST_FILES Alistair Popple
2022-03-03 23:33 [PATCH 1/2] kselftest/vm: Rename TARGETS to BUILD_TARGETS Yosry Ahmed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).