mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: changbin.du@intel.com
To: shuah@kernel.org
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Changbin Du <changbin.du@intel.com>
Subject: [PATCH 1/4] selftests/Makefile: append a slash to env variable OUTPUT
Date: Mon, 26 Mar 2018 17:23:25 +0800	[thread overview]
Message-ID: <1522056208-4004-2-git-send-email-changbin.du@intel.com> (raw)
In-Reply-To: <1522056208-4004-1-git-send-email-changbin.du@intel.com>

From: Changbin Du <changbin.du@intel.com>

The tools/build/Makefile.build use 'OUTPUT' variable as below example:
objprefix    := $(subst ./,,$(OUTPUT)$(dir)/)

So it requires the 'OUTPUT' already has a slash at the end.

This patch can kill below odd paths:
make[3]: Entering directory '/home/changbin/work/linux/tools/gpio'
  CC       /home/changbin/work/linux/tools/testing/selftests/gpiolsgpio.o
  CC       /home/changbin/work/linux/tools/testing/selftests/gpiogpio-utils.o
  LD       /home/changbin/work/linux/tools/testing/selftests/gpiolsgpio-in.o

A correct path should be:
/home/changbin/work/linux/tools/testing/selftests/gpio/lsgpio.o

Signed-off-by: Changbin Du <changbin.du@intel.com>
---
 tools/testing/selftests/Makefile | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 7442dfb..7916aa2 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -71,31 +71,31 @@ all:
 	@for TARGET in $(TARGETS); do		\
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
 		mkdir $$BUILD_TARGET  -p;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET;\
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\
 	done;
 
 run_tests: all
 	@for TARGET in $(TARGETS); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\
 	done;
 
 hotplug:
 	@for TARGET in $(TARGETS_HOTPLUG); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET;\
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\
 	done;
 
 run_hotplug: hotplug
 	@for TARGET in $(TARGETS_HOTPLUG); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_full_test;\
 	done;
 
 clean_hotplug:
 	@for TARGET in $(TARGETS_HOTPLUG); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\
 	done;
 
 run_pstore_crash:
@@ -111,7 +111,7 @@ ifdef INSTALL_PATH
 	mkdir -p $(INSTALL_PATH)
 	@for TARGET in $(TARGETS); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
 	done;
 
 	@# Ask all targets to emit their test scripts
@@ -131,7 +131,7 @@ ifdef INSTALL_PATH
 		echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
 		echo "echo ========================================" >> $(ALL_SCRIPT); \
 		echo "cd $$TARGET" >> $(ALL_SCRIPT); \
-		make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
+		make -s --no-print-directory OUTPUT=$$BUILD_TARGET/ -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
 		echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
 	done;
 
@@ -143,7 +143,7 @@ endif
 clean:
 	@for TARGET in $(TARGETS); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
+		make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\
 	done;
 
 .PHONY: all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean
-- 
2.7.4


  reply	other threads:[~2018-03-26  9:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26  9:23 [PATCH 0/4] selftests: fix compiling issues changbin.du
2018-03-26  9:23 ` changbin.du [this message]
2018-03-26  9:23 ` [PATCH 2/4] selftests/gpio: fix paths in Makefile changbin.du
2018-03-26  9:23 ` [PATCH 3/4] kselftest: install sanitized kernel headers before compiling changbin.du
2018-03-26  9:23 ` [PATCH 4/4] selftests/bpf: fix compiling errors changbin.du
2018-03-26 14:55   ` Alexei Starovoitov
2018-03-27  2:20     ` Du, Changbin
2018-03-27  3:02       ` Alexei Starovoitov
2018-03-27  3:06         ` Du, Changbin
2018-03-27  8:52           ` Daniel Borkmann
2018-03-27  9:00             ` Du, Changbin
2018-03-27  9:52               ` Daniel Borkmann
2018-03-27 10:19                 ` Du, Changbin
2018-03-27  2:33     ` Du, Changbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522056208-4004-2-git-send-email-changbin.du@intel.com \
    --to=changbin.du@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome