All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: Fix build failures when invoked from kselftest target
@ 2015-03-14  1:45 Shuah Khan
  2015-03-14  1:45 ` [PATCH] selftests: Fix kcmp build to not require headers install Shuah Khan
  2015-03-16  0:38   ` Michael Ellerman
  0 siblings, 2 replies; 15+ messages in thread
From: Shuah Khan @ 2015-03-14  1:45 UTC (permalink / raw)
  To: linux-api, linux-kernel; +Cc: Shuah Khan

Several tests that rely on implicit build rules fail to build,
when invoked from the main Makefile kselftest target. These
failures are due to --no-builtin-rules and --no-builtin-variables
options set in the inherited MAKEFLAGS.

--no-builtin-rules eliminates the use of built-in implicit rules
and --no-builtin-variables is for not defining built-in variables.
These two options override the use of implicit rules resulting in
build failures. In addition, inherited LDFLAGS result in build
failures and there is no need to define LDFLAGS.  Clear LDFLAGS
and MAKEFLAG when make is invoked from the main Makefile kselftest
target. Fixing this at selftests Makefile avoids changing the main
Makefile and keeps this change self contained at selftests level.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 4e51122..8e09db7 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -22,6 +22,15 @@ TARGETS += vm
 TARGETS_HOTPLUG = cpu-hotplug
 TARGETS_HOTPLUG += memory-hotplug
 
+# Clear LDFLAGS and MAKEFLAGS if called from main
+# Makefile to avoid test build failures when test
+# Makefile doesn't have explicit build rules.
+ifeq (1,$(MAKELEVEL))
+undefine LDFLAGS
+override define MAKEFLAGS =
+endef
+endif
+
 all:
 	for TARGET in $(TARGETS); do \
 		make -C $$TARGET; \
-- 
2.1.0


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

end of thread, other threads:[~2015-03-19  0:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-14  1:45 [PATCH] selftests: Fix build failures when invoked from kselftest target Shuah Khan
2015-03-14  1:45 ` [PATCH] selftests: Fix kcmp build to not require headers install Shuah Khan
2015-03-16 11:00   ` Michael Ellerman
2015-03-16 11:00     ` Michael Ellerman
2015-03-18 15:04     ` Shuah Khan
2015-03-18 15:04       ` Shuah Khan
2015-03-19  0:02       ` Michael Ellerman
2015-03-19  0:02         ` Michael Ellerman
2015-03-19  0:18         ` Shuah Khan
2015-03-19  0:51           ` Michael Ellerman
2015-03-19  0:51             ` Michael Ellerman
2015-03-16  0:38 ` [PATCH] selftests: Fix build failures when invoked from kselftest target Michael Ellerman
2015-03-16  0:38   ` Michael Ellerman
2015-03-18 16:46   ` Shuah Khan
2015-03-18 16:46     ` Shuah Khan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.