[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180701153122.463768891@linuxfoundation.org>
Date: Sun, 1 Jul 2018 18:01:20 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Brian Norris <computersforpeace@...il.com>,
Jiri Olsa <jolsa@...nel.org>, Borislav Petkov <bp@...e.de>,
David Ahern <dsahern@...il.com>,
David Howells <dhowells@...hat.com>,
Michal Marek <mmarek@...e.cz>,
Namhyung Kim <namhyung@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Sam Ravnborg <sam@...nborg.org>, linux-kbuild@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH 3.18 02/85] tools build: Fix Makefile(s) to properly invoke tools build
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <jolsa@...nel.org>
commit 16671c1e1cac2dbb995feb4bc55082fd939b5c2c upstream.
Several fixes were needed to allow following builds:
$ make tools/tmon
$ make -C <kernelsrc> tools/perf
$ make -C <kernelsrc>/tools perf
- some of the tools (perf) use same make variables as in
kernel build, unsetting srctree and objtree
- using original $(O) for O variable
- perf build does not follow the descend function setup
invoking it via it's own make rule
I tried the rest of the tools/Makefile targets and they
seem to work now.
Reported-by: Brian Norris <computersforpeace@...il.com>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Cc: Borislav Petkov <bp@...e.de>
Cc: Brian Norris <computersforpeace@...il.com>
Cc: David Ahern <dsahern@...il.com>
Cc: David Howells <dhowells@...hat.com>
Cc: Michal Marek <mmarek@...e.cz>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Sam Ravnborg <sam@...nborg.org>
Cc: linux-kbuild@...r.kernel.org
Link: http://lkml.kernel.org/r/1429389280-18720-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
Makefile | 5 ++---
tools/Makefile | 12 +++++++++++-
2 files changed, 13 insertions(+), 4 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -214,7 +214,6 @@ VPATH := $(srctree)$(if $(KBUILD_EXTMOD
export srctree objtree VPATH
-
# SUBARCH tells the usermode build what the underlying arch is. That is set
# first, and if a usermode build is happening, the "ARCH=um" on the command
# line overrides the setting of ARCH below. If a native build is happening,
@@ -1505,11 +1504,11 @@ image_name:
# Clear a bunch of variables before executing the submake
tools/: FORCE
$(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(O) subdir=tools -C $(src)/tools/
tools/%: FORCE
$(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/ $*
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(O) subdir=tools -C $(src)/tools/ $*
# Single targets
# ---------------------------------------------------------------------------
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,3 +1,8 @@
+# Some of the tools (perf) use same make variables
+# as in kernel build.
+export srctree=
+export objtree=
+
include scripts/Makefile.include
help:
@@ -54,8 +59,13 @@ liblockdep: FORCE
libapi: FORCE
$(call descend,lib/api)
+# The perf build does not follow the descend function setup,
+# invoking it via it's own make rule.
+PERF_O = $(if $(O),$(O)/tools/perf,)
+
perf: FORCE
- $(call descend,$@)
+ $(Q)mkdir -p $(PERF_O) .
+ $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
selftests: FORCE
$(call descend,testing/$@)
Powered by blists - more mailing lists