All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: mingo@kernel.org, tglx@linutronix.de, acme@ghostprotocols.net,
	davem@davemloft.net, torvalds@linux-foundation.org,
	paulus@samba.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 2/5] tools: Honour the O= flag when tool build called from a higher Makefile
Date: Fri, 26 Oct 2012 14:34:59 +0900	[thread overview]
Message-ID: <87haph94os.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20121019165616.23037.35557.stgit@warthog.procyon.org.uk> (David Howells's message of "Fri, 19 Oct 2012 17:56:16 +0100")

On Fri, 19 Oct 2012 17:56:16 +0100, David Howells wrote:
> Honour the O= flag that was passed to a higher level Makefile and then passed
> down as part of a tool build.
>
> To make this work, the top-level Makefile passes the original O= flag and
> subdir=tools to the tools/Makefile, and that in turn passes
> subdir=$(O)/$(subdir)/foodir when building tool foo in directory
> $(O)/$(subdir)/foodir (where the intervening slashes aren't added if an
> element is missing).
>
> For example, take perf.  This is found in tools/perf/.  Assume we're building
> into directory ~/zebra/, so we pass O=~/zebra to make.  Dependening on where
> we run the build from, we see:
>
> 	make run in dir		$(OUTPUT) dir
> 	=======================	==================
> 	linux			~/zebra/tools/perf/
> 	linux/tools		~/zebra/perf/
> 	linux/tools/perf	~/zebra/
>
> and if O= is not set, we get:
>
> 	make run in dir		$(OUTPUT) dir
> 	=======================	==================
> 	linux			linux/tools/perf/
> 	linux/tools		linux/tools/perf/
> 	linux/tools/perf	linux/tools/perf/
>
> The output directories are created by the descend function if they don't
> already exist.

This is my test:

  namhyung@sejong:~$ cd project/linux
  namhyung@sejong:linux$ make O=~/build/zebra tools/perf
  /bin/sh: line 0: cd: /home/namhyung/build/zebra: No such file or directory
  Makefile:121: *** output directory "/home/namhyung/build/zebra" does not exist.  Stop.
  
  namhyung@sejong:tools$ mkdir ~/build/zebra
  namhyung@sejong:linux$ make O=~/build/zebra tools/perf
    HOSTCC  scripts/basic/fixdep
    GEN     /home/namhyung/build/zebra/Makefile
    HOSTCC  scripts/kconfig/conf.o
    HOSTCC  scripts/kconfig/zconf.tab.o
    HOSTLD  scripts/kconfig/conf
  scripts/kconfig/conf --silentoldconfig Kconfig
  ***
  *** Configuration file ".config" not found!
  ***
  *** Please run some configurator (e.g. "make oldconfig" or
  *** "make menuconfig" or "make xconfig").
  ***
  make[3]: *** [silentoldconfig] Error 1
  make[2]: *** [silentoldconfig] Error 2
      DESCEND perf
      MKDIR /home/namhyung/build/zebra/tools/perf/arch/
      MKDIR /home/namhyung/build/zebra/tools/perf/arch/x86/util/
      MKDIR /home/namhyung/build/zebra/tools/perf/bench/
      MKDIR /home/namhyung/build/zebra/tools/perf/scripts/perl/Perf-Trace-Util/
      MKDIR /home/namhyung/build/zebra/tools/perf/scripts/python/Perf-Trace-Util/
      MKDIR /home/namhyung/build/zebra/tools/perf/ui/
      MKDIR /home/namhyung/build/zebra/tools/perf/ui/browsers/
      MKDIR /home/namhyung/build/zebra/tools/perf/ui/gtk/
      MKDIR /home/namhyung/build/zebra/tools/perf/ui/stdio/
      MKDIR /home/namhyung/build/zebra/tools/perf/ui/tui/
      MKDIR /home/namhyung/build/zebra/tools/perf/util/
      MKDIR /home/namhyung/build/zebra/tools/perf/util/scripting-engines/
  PERF_VERSION = 3.7.rc2.1655.g54fa2b.dirty
      GEN /home/namhyung/build/zebra/tools/perf/common-cmds.h
      * new build flags or prefix
      CC /home/namhyung/build/zebra/tools/perf/perf.o
      ...

This looks ok but it'd be better if we can skip the config check when
building tools IMHO.


  namhyung@sejong:linux cd tools
  
  namhyung@sejong:tools$ make O=~/build/zebra perf
      DESCEND perf
      ...
      * new build flags or prefix
      CC /home/namhyung/build/zebra/perf.o
      ...

This looks not good as it doesn't build perf into
~/build/zebra/perf/perf.o.

Thanks,
Namhyung

  reply	other threads:[~2012-10-26  5:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 16:55 [RFC][PATCH 0/5] tools, perf: Fix up for x86 UAPI disintegration David Howells
2012-10-19 16:56 ` [PATCH 1/5] tools: Define a Makefile function to do subdir processing David Howells
2012-10-19 16:56 ` [PATCH 2/5] tools: Honour the O= flag when tool build called from a higher Makefile David Howells
2012-10-26  5:34   ` Namhyung Kim [this message]
2012-10-19 16:56 ` [PATCH 3/5] perf: Make perf build for x86 with UAPI disintegration applied David Howells
2012-10-26  5:49   ` Namhyung Kim
2012-10-19 16:56 ` [PATCH 4/5] x86: Disintegrate asm/svm.h and asm/vmx.h to produce UAPI components for perf David Howells
2012-10-19 16:56 ` [PATCH 5/5] x86: UAPI Disintegrate asm/perf_regs.h David Howells
2012-10-24 18:43 ` [RFC][PATCH 0/5] tools, perf: Fix up for x86 UAPI disintegration Arnaldo Carvalho de Melo
2012-10-24 19:46   ` Borislav Petkov
2012-10-25  7:57     ` David Howells
2012-10-26  4:33       ` Namhyung Kim
2012-10-26  6:04         ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87haph94os.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=acme@ghostprotocols.net \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.