lkml.org 
[lkml]   [2012]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 5/5] tools: Connect to the kernel build system
> --
> From: Borislav Petkov <borislav.petkov@amd.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@amd.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
It is complicated enough - this is not OK.
We cannot special case individual targets here...

>
> 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/ $*

I think we can do:
> + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(KBUILD_OUTPUT) -C $(src)/tools/ $*
And then avoid the hacks above.


>
> # 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 =

Who-ever came up with the names "QUIET_SUBDIR" must have had a bad day...
I think you could do all the tricks using:

QUIET_MAKE = ...

It looks much simpler to use:

foo: bar
$(QUIET_MAKE) ...

But this is another patch...

Sam


\
 
 \ /
  Last update: 2012-04-12 17:59    [W:0.095 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site