qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Makefile.target: set master BUILD_DIR
@ 2015-05-26  5:38 Peter Crosthwaite
  2015-05-26 13:29 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Crosthwaite @ 2015-05-26  5:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Gerd Hoffmann, Peter Crosthwaite

make can be invoked in the individual build dirs to build an individual
target or just a single file of a target. e.g.

touch translate-all.c
make -C microblazeel-softmmu translate-all.o

There is however a small bug when using the pixman submodule.
config-host.mak will ref BUILD_DIR for the pixman -I CFLAGS:

grep BUILD_DIR config-host.mak
QEMU_CFLAGS=-I$(SRC_PATH)/pixman/pixman -I$(BUILD_DIR)/pixman/pixman ...

This causes a build failure as -I/pixman/pixman (BUILD_DIR=="") will
not be found.

BUILD_DIR is usually set by the top level Makefile. Just lazy-set it in
Makefile.target to the parent directory.

Granted, this will not work if the pixman submodule is not prebuilt,
but it at least means you can do incremental partial builds once you
have done your initial full build (or attempt) from the top level.

The next step would be refactor make infrastructure to rebuild pixman
on a submake like the one above.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
Pixman is the only config-host.mak user of BUILD dir so maybe there is
a pixman specific solution out there too?
---
 Makefile.target | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile.target b/Makefile.target
index 3e861c8..ec5b92c 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,5 +1,7 @@
 # -*- Mode: makefile -*-
 
+BUILD_DIR?=$(CURDIR)/..
+
 include ../config-host.mak
 include config-target.mak
 include config-devices.mak
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Makefile.target: set master BUILD_DIR
  2015-05-26  5:38 [Qemu-devel] [PATCH] Makefile.target: set master BUILD_DIR Peter Crosthwaite
@ 2015-05-26 13:29 ` Paolo Bonzini
  2015-05-26 17:15   ` Peter Crosthwaite
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2015-05-26 13:29 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel; +Cc: Gerd Hoffmann, Peter Crosthwaite



On 26/05/2015 07:38, Peter Crosthwaite wrote:
> make can be invoked in the individual build dirs to build an individual
> target or just a single file of a target. e.g.
> 
> touch translate-all.c
> make -C microblazeel-softmmu translate-all.o

Out of curiosity, why not use "make subdir-microblazeel-softmmu" instead?

Paolo

> There is however a small bug when using the pixman submodule.
> config-host.mak will ref BUILD_DIR for the pixman -I CFLAGS:
> 
> grep BUILD_DIR config-host.mak
> QEMU_CFLAGS=-I$(SRC_PATH)/pixman/pixman -I$(BUILD_DIR)/pixman/pixman ...
> 
> This causes a build failure as -I/pixman/pixman (BUILD_DIR=="") will
> not be found.
> 
> BUILD_DIR is usually set by the top level Makefile. Just lazy-set it in
> Makefile.target to the parent directory.
> 
> Granted, this will not work if the pixman submodule is not prebuilt,
> but it at least means you can do incremental partial builds once you
> have done your initial full build (or attempt) from the top level.
> 
> The next step would be refactor make infrastructure to rebuild pixman
> on a submake like the one above.
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
> Pixman is the only config-host.mak user of BUILD dir so maybe there is
> a pixman specific solution out there too?
> ---
>  Makefile.target | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Makefile.target b/Makefile.target
> index 3e861c8..ec5b92c 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -1,5 +1,7 @@
>  # -*- Mode: makefile -*-
>  
> +BUILD_DIR?=$(CURDIR)/..
> +
>  include ../config-host.mak
>  include config-target.mak
>  include config-devices.mak
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Makefile.target: set master BUILD_DIR
  2015-05-26 13:29 ` Paolo Bonzini
@ 2015-05-26 17:15   ` Peter Crosthwaite
  2015-05-26 17:17     ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Crosthwaite @ 2015-05-26 17:15 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Peter Crosthwaite, Peter Crosthwaite,
	qemu-devel@nongnu.org Developers, Gerd Hoffmann

On Tue, May 26, 2015 at 6:29 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 26/05/2015 07:38, Peter Crosthwaite wrote:
>> make can be invoked in the individual build dirs to build an individual
>> target or just a single file of a target. e.g.
>>
>> touch translate-all.c
>> make -C microblazeel-softmmu translate-all.o
>
> Out of curiosity, why not use "make subdir-microblazeel-softmmu" instead?
>

Does that in any way allow you to specify a single file?

This come up in my multi-arch work, where I am constantly touching
core headers while being a fully configured build. Every change
triggers major recompilation. So to make my quick edits I have started
a process where I use this fuller make specification to rebuild the
one under-development file+target combo that failed until the build
bugs go away. Then once is works I continue with unqualified build. I
also want to avoid retrigger of the common-obj build.

I guess I can pass BUILD_DIR in on the command line though.

Regards,
Peter

> Paolo
>
>> There is however a small bug when using the pixman submodule.
>> config-host.mak will ref BUILD_DIR for the pixman -I CFLAGS:
>>
>> grep BUILD_DIR config-host.mak
>> QEMU_CFLAGS=-I$(SRC_PATH)/pixman/pixman -I$(BUILD_DIR)/pixman/pixman ...
>>
>> This causes a build failure as -I/pixman/pixman (BUILD_DIR=="") will
>> not be found.
>>
>> BUILD_DIR is usually set by the top level Makefile. Just lazy-set it in
>> Makefile.target to the parent directory.
>>
>> Granted, this will not work if the pixman submodule is not prebuilt,
>> but it at least means you can do incremental partial builds once you
>> have done your initial full build (or attempt) from the top level.
>>
>> The next step would be refactor make infrastructure to rebuild pixman
>> on a submake like the one above.
>>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>> ---
>> Pixman is the only config-host.mak user of BUILD dir so maybe there is
>> a pixman specific solution out there too?
>> ---
>>  Makefile.target | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/Makefile.target b/Makefile.target
>> index 3e861c8..ec5b92c 100644
>> --- a/Makefile.target
>> +++ b/Makefile.target
>> @@ -1,5 +1,7 @@
>>  # -*- Mode: makefile -*-
>>
>> +BUILD_DIR?=$(CURDIR)/..
>> +
>>  include ../config-host.mak
>>  include config-target.mak
>>  include config-devices.mak
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Makefile.target: set master BUILD_DIR
  2015-05-26 17:15   ` Peter Crosthwaite
@ 2015-05-26 17:17     ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2015-05-26 17:17 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: Peter Crosthwaite, Peter Crosthwaite,
	qemu-devel@nongnu.org Developers, Gerd Hoffmann



On 26/05/2015 19:15, Peter Crosthwaite wrote:
> On Tue, May 26, 2015 at 6:29 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 26/05/2015 07:38, Peter Crosthwaite wrote:
>>> make can be invoked in the individual build dirs to build an individual
>>> target or just a single file of a target. e.g.
>>>
>>> touch translate-all.c
>>> make -C microblazeel-softmmu translate-all.o
>>
>> Out of curiosity, why not use "make subdir-microblazeel-softmmu" instead?
>>
> 
> Does that in any way allow you to specify a single file?
> 
> This come up in my multi-arch work, where I am constantly touching
> core headers while being a fully configured build. Every change
> triggers major recompilation. So to make my quick edits I have started
> a process where I use this fuller make specification to rebuild the
> one under-development file+target combo that failed until the build
> bugs go away. Then once is works I continue with unqualified build. I
> also want to avoid retrigger of the common-obj build.

Understood, thanks for the application.  I'll include the patch in my
next pull request (and will prepare a public git tree sooner rather than
later).

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-26 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26  5:38 [Qemu-devel] [PATCH] Makefile.target: set master BUILD_DIR Peter Crosthwaite
2015-05-26 13:29 ` Paolo Bonzini
2015-05-26 17:15   ` Peter Crosthwaite
2015-05-26 17:17     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).