[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120412152256.GH24549@aftab>
Date: Thu, 12 Apr 2012 17:22:56 +0200
From: Borislav Petkov <bp@...64.org>
To: Arnaldo Carvalho de Melo <acme@...radead.org>
Cc: Borislav Petkov <bp@...64.org>, Ingo Molnar <mingo@...nel.org>,
Michal Marek <mmarek@...e.cz>, Sam Ravnborg <sam@...nborg.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 5/5] tools: Connect to the kernel build system
On Wed, Apr 11, 2012 at 03:08:37PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Apr 11, 2012 at 03:04:34PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Apr 11, 2012 at 06:36:18PM +0200, Borislav Petkov escreveu:
> > > From: Borislav Petkov <borislav.petkov@....com>
> > >
> > > Now you can do
> > >
> > > $ make tools/<toolname>
> > >
> > > from the toplevel kernel directory and have the respective tool built.
> > >
> > > If you want to build and install it, do
> > >
> > > $ make tools/<toolname>_install
> >
> > [acme@...dy linux]$ make -j8 O=/home/git/build/perf tools/perf_install
> > [acme@...dy linux]$ ls -la tools/perf/*.o | wc -l
> > 22
> >
> > It should have honoured O=
> >
> > Can you fix this one please? :)
>
> But that can be on top of this series as the way I use it:
How about the patch below? Sam, it touches the toplevel Makefile because
it needs to not set KBUILD_OUTPUT when we're building tools/* targets.
Pls, let me know if this is ok?
Thanks.
--
From: Borislav Petkov <borislav.petkov@....com>
Date: Thu, 12 Apr 2012 17:18:10 +0200
Subject: [PATCH] tools, Makefile: Fix O= building
Make sure
$ make O=/tmp/somedir tools/perf
works with the current toplevel Makefile integration.
Signed-off-by: Borislav Petkov <borislav.petkov@....com>
---
Makefile | 9 +++++++--
tools/scripts/Makefile.include | 18 +++++++++++++++---
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 23b9ce5a2c2c..2cb2ee2dc6ae 100644
--- a/Makefile
+++ b/Makefile
@@ -98,8 +98,13 @@ ifeq ($(KBUILD_SRC),)
# OK, Make called in directory where kernel src resides
# Do we want to locate output files in a separate directory?
+#
+# Also, we don't want to set KBUILD_OUTPUT if we're building stuff
+# in tools/
ifeq ("$(origin O)", "command line")
- KBUILD_OUTPUT := $(O)
+ ifneq ($(findstring tools/,$(MAKECMDGOALS)),tools/)
+ KBUILD_OUTPUT := $(O)
+ endif
endif
ifeq ("$(origin W)", "command line")
@@ -1473,7 +1478,7 @@ tools/: FORCE
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/
tools/%: FORCE
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $*
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(O) -C $(src)/tools/ $*
# Single targets
# ---------------------------------------------------------------------------
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 87b55a729a5f..297b51d8e4be 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -38,11 +38,18 @@ else
NO_SUBDIR = :
endif
-QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
-QUIET_SUBDIR1 =
ifneq ($(findstring $(MAKEFLAGS),s),s)
-ifndef V
+ifdef V
+ QUIET_SUBDIR0 = +$(MAKE)
+ QUIET_SUBDIR1 =
+
+ ifdef O
+ QUIET_SUBDIR0 += O=$(O)
+ endif
+
+ QUIET_SUBDIR0 += -C # space to separate -C and subdir
+else
QUIET_CC = @echo ' ' CC $@;
QUIET_AR = @echo ' ' AR $@;
QUIET_LINK = @echo ' ' LINK $@;
@@ -51,6 +58,11 @@ ifndef V
QUIET_SUBDIR0 = +@...dir=
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
$(MAKE) $(PRINT_DIR) -C $$subdir
+
+ ifdef O
+ QUIET_SUBDIR1 += O=$(O)
+ endif
+
QUIET_FLEX = @echo ' ' FLEX $@;
QUIET_BISON = @echo ' ' BISON $@;
endif
--
1.7.9.3.362.g71319
--
Regards/Gruss,
Boris.
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists