From 16671c1e1cac2dbb995feb4bc55082fd939b5c2c Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Sat, 18 Apr 2015 22:34:39 +0200 Subject: tools build: Fix Makefile(s) to properly invoke tools build Several fixes were needed to allow following builds: $ make tools/tmon $ make -C tools/perf $ make -C /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 Signed-off-by: Jiri Olsa Cc: Borislav Petkov Cc: Brian Norris Cc: David Ahern Cc: David Howells Cc: Michal Marek Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Sam Ravnborg Cc: linux-kbuild@vger.kernel.org Link: http://lkml.kernel.org/r/1429389280-18720-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools/Makefile') diff --git a/tools/Makefile b/tools/Makefile index 01995cc8ac44..b35102721cbb 100644 --- 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: @@ -50,8 +55,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/$@) -- cgit v1.2.3