qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree
@ 2011-09-15 17:16 Lluís Vilanova
  2011-09-15 17:17 ` [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets Lluís Vilanova
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lluís Vilanova @ 2011-09-15 17:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson


---
 Makefile |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 7e9382f..97b26c6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
 # Makefile for QEMU.
 
+# Always point to the root of the build tree
+BUILD_DIR=$(PWD)
+
 GENERATED_HEADERS = config-host.h trace.h qemu-options.def
 ifeq ($(TRACE_BACKEND),dtrace)
 GENERATED_HEADERS += trace-dtrace.h
@@ -81,7 +84,7 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 
 subdir-%: $(GENERATED_HEADERS)
-	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
+	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" BUILD_DIR=$(BUILD_DIR) TARGET_DIR="$*/" all,)
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/Makefile.objs
@@ -96,7 +99,7 @@ $(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-lib
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 romsubdir-%:
-	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
+	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" BUILD_DIR=$(BUILD_DIR) TARGET_DIR="$*/",)
 
 ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
 
@@ -132,10 +135,10 @@ install-libcacard:
 	@echo "libtool is missing, please install and rerun configure"; exit 1
 else
 libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
-	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
+	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" BUILD_DIR=$(BUILD_DIR) TARGET_DIR="$*/" libcacard.la,)
 
 install-libcacard: libcacard.la
-	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
+	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" BUILD_DIR=$(BUILD_DIR) TARGET_DIR="$*/" install-libcacard,)
 endif
 ######################################################################
 

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

* [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets
  2011-09-15 17:16 [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Lluís Vilanova
@ 2011-09-15 17:17 ` Lluís Vilanova
  2011-09-15 19:31   ` Richard Henderson
  2011-09-15 19:31 ` [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Richard Henderson
  2011-09-15 20:11 ` Paolo Bonzini
  2 siblings, 1 reply; 7+ messages in thread
From: Lluís Vilanova @ 2011-09-15 17:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

This will apply libuser-specific compilation flags (like the ones added by
--enable-user-pie), but keep softmmu emulation targets "as-is".

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 Makefile.objs   |    7 ++++---
 Makefile.target |    2 +-
 Makefile.user   |    4 +++-
 configure       |    1 +
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 62020d7..1c65087 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -177,6 +177,7 @@ user-obj-y =
 user-obj-y += envlist.o path.o
 user-obj-y += tcg-runtime.o host-utils.o
 user-obj-y += cutils.o cache-utils.o
+user-obj-y += $(trace-obj-y)
 
 ######################################################################
 # libhw
@@ -340,12 +341,12 @@ trace.h: trace.h-timestamp trace-dtrace.h
 else
 trace.h: trace.h-timestamp
 endif
-trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
+trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
 	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -h < $< > $@,"  GEN   trace.h")
 	@cmp -s $@ trace.h || cp $@ trace.h
 
 trace.c: trace.c-timestamp
-trace.c-timestamp: $(SRC_PATH)/trace-events config-host.mak
+trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
 	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -c < $< > $@,"  GEN   trace.c")
 	@cmp -s $@ trace.c || cp $@ trace.c
 
@@ -358,7 +359,7 @@ trace-dtrace.h: trace-dtrace.dtrace
 # but that gets picked up by QEMU's Makefile as an external dependency
 # rule file. So we use '.dtrace' instead
 trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
-trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events config-host.mak
+trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
 	$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -d < $< > $@,"  GEN   trace-dtrace.dtrace")
 	@cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
 
diff --git a/Makefile.target b/Makefile.target
index f708453..88d2f1f 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -383,6 +383,7 @@ obj-y += $(addprefix ../, $(common-obj-y))
 obj-y += $(addprefix ../libdis/, $(libdis-y))
 obj-y += $(libobj-y)
 obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
+obj-y += $(addprefix ../, $(trace-obj-y))
 
 endif # CONFIG_SOFTMMU
 
@@ -394,7 +395,6 @@ obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
 endif # CONFIG_BSD_USER
 endif # CONFIG_LINUX_USER
 
-obj-y += $(addprefix ../, $(trace-obj-y))
 obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
 
 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
diff --git a/Makefile.user b/Makefile.user
index 024b773..2b1e4d1 100644
--- a/Makefile.user
+++ b/Makefile.user
@@ -17,7 +17,9 @@ all: $(user-obj-y)
 	@true
 
 clean:
-	rm -f *.o *.d *.a *~
+	for d in . trace; do \
+	rm -f $$d/*.o $$d/*.d $$d/*.a $$d/*~; \
+	done
 
 # Include automatically generated dependency files
 -include $(wildcard *.d */*.d)
diff --git a/configure b/configure
index 0875f95..ad924c4 100755
--- a/configure
+++ b/configure
@@ -3669,6 +3669,7 @@ fi
 
 d=libuser
 mkdir -p $d
+mkdir -p $d/trace
 symlink $source_path/Makefile.user $d/Makefile
 if test "$static" = "no" -a "$user_pie" = "yes" ; then
   echo "QEMU_CFLAGS+=-fpie" > $d/config.mak

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

* Re: [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree
  2011-09-15 17:16 [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Lluís Vilanova
  2011-09-15 17:17 ` [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets Lluís Vilanova
@ 2011-09-15 19:31 ` Richard Henderson
  2011-09-15 20:11 ` Paolo Bonzini
  2 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 2011-09-15 19:31 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: qemu-devel

On 09/15/2011 10:16 AM, Lluís Vilanova wrote:
> 
> ---
>  Makefile |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)

This is going to get bounced back to you because of no Signed-off-by, but:

Acked-by: Richard Henderson <rth@twiddle.net>


r~

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

* Re: [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets
  2011-09-15 17:17 ` [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets Lluís Vilanova
@ 2011-09-15 19:31   ` Richard Henderson
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 2011-09-15 19:31 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: qemu-devel

On 09/15/2011 10:17 AM, Lluís Vilanova wrote:
> This will apply libuser-specific compilation flags (like the ones added by
> --enable-user-pie), but keep softmmu emulation targets "as-is".
> 
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
>  Makefile.objs   |    7 ++++---
>  Makefile.target |    2 +-
>  Makefile.user   |    4 +++-
>  configure       |    1 +
>  4 files changed, 9 insertions(+), 5 deletions(-)

Acked-by: Richard Henderson <rth@twiddle.net>

Thanks for the fix.


r~

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

* Re: [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree
  2011-09-15 17:16 [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Lluís Vilanova
  2011-09-15 17:17 ` [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets Lluís Vilanova
  2011-09-15 19:31 ` [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Richard Henderson
@ 2011-09-15 20:11 ` Paolo Bonzini
  2 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2011-09-15 20:11 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: qemu-devel, Richard Henderson

On 09/15/2011 07:16 PM, Lluís Vilanova wrote:
>   subdir-%: $(GENERATED_HEADERS)
> -	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
> +	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" BUILD_DIR=$(BUILD_DIR) TARGET_DIR="$*/" all,)

Since you have to add the s-o-b line anyway, please add BUILD_DIR to 
SUBDIR_MAKEFLAGS instead.

Paolo

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

* [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree
@ 2011-09-15 20:45 Lluís Vilanova
  2011-09-16 14:45 ` Anthony Liguori
  0 siblings, 1 reply; 7+ messages in thread
From: Lluís Vilanova @ 2011-09-15 20:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Richard Henderson

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 Makefile |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 7e9382f..57cc399 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
 # Makefile for QEMU.
 
+# Always point to the root of the build tree
+BUILD_DIR=$(PWD)
+
 GENERATED_HEADERS = config-host.h trace.h qemu-options.def
 ifeq ($(TRACE_BACKEND),dtrace)
 GENERATED_HEADERS += trace-dtrace.h
@@ -37,7 +40,7 @@ else
 DOCS=
 endif
 
-SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
+SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
 

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

* Re: [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree
  2011-09-15 20:45 Lluís Vilanova
@ 2011-09-16 14:45 ` Anthony Liguori
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony Liguori @ 2011-09-16 14:45 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: Paolo Bonzini, qemu-devel, Richard Henderson

On 09/15/2011 03:45 PM, Lluís Vilanova wrote:
> Signed-off-by: Lluís Vilanova<vilanova@ac.upc.edu>

Applied all.  Thanks.

Regards,

Anthony Liguori

> ---
>   Makefile |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 7e9382f..57cc399 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,5 +1,8 @@
>   # Makefile for QEMU.
>
> +# Always point to the root of the build tree
> +BUILD_DIR=$(PWD)
> +
>   GENERATED_HEADERS = config-host.h trace.h qemu-options.def
>   ifeq ($(TRACE_BACKEND),dtrace)
>   GENERATED_HEADERS += trace-dtrace.h
> @@ -37,7 +40,7 @@ else
>   DOCS=
>   endif
>
> -SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
> +SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
>   SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
>   SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
>
>
>
>

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

end of thread, other threads:[~2011-09-16 14:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15 17:16 [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Lluís Vilanova
2011-09-15 17:17 ` [Qemu-devel] [PATCH 2/2] build: Move tracing objects into libuser on usermode emulation targets Lluís Vilanova
2011-09-15 19:31   ` Richard Henderson
2011-09-15 19:31 ` [Qemu-devel] [PATCH 1/2] build: Always have 'BUILD_DIR' variable pointing to the root of the build tree Richard Henderson
2011-09-15 20:11 ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2011-09-15 20:45 Lluís Vilanova
2011-09-16 14:45 ` Anthony Liguori

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).