Patchwork Fix compilation failure with simple trace when srcdir==objdir

login
register
mail settings
Submitter Peter Maydell
Date Nov. 16, 2010, 8:07 p.m.
Message ID <1289938027-28282-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/71449/
State New
Headers show

Comments

Peter Maydell - Nov. 16, 2010, 8:07 p.m.
Fix a makefile error that meant that qemu would not compile if
the source and object directories were the same.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 Makefile.target |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
Stefan Hajnoczi - Nov. 16, 2010, 9:12 p.m.
On Tue, Nov 16, 2010 at 8:07 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Fix a makefile error that meant that qemu would not compile if
> the source and object directories were the same.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  Makefile.target |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)

This patch fixes the build for me.

Stefan
Anthony Liguori - Nov. 16, 2010, 10:25 p.m.
On 11/16/2010 02:07 PM, Peter Maydell wrote:
> Fix a makefile error that meant that qemu would not compile if
> the source and object directories were the same.
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   Makefile.target |   11 +++++------
>   1 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index a5e6410..652c7d2 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -30,6 +30,7 @@ endif
>   endif
>
>   PROGS=$(QEMU_PROG)
> +STPFILES=
>
>   ifndef CONFIG_HAIKU
>   LIBS+=-lm
> @@ -41,19 +42,17 @@ config-target.h: config-target.h-timestamp
>   config-target.h-timestamp: config-target.mak
>
>   ifdef CONFIG_SYSTEMTAP_TRACE
> -trace: $(QEMU_PROG).stp
> +STPFILES+=$(QEMU_PROG).stp
>
>   $(QEMU_PROG).stp:
>   	$(call quiet-command,sh $(SRC_PATH)/tracetool \
>   		--$(TRACE_BACKEND) \
>   		--bindir $(bindir) \
>   		--target $(TARGET_ARCH) \
> -		-s<  $(SRC_PATH)/trace-events>  $(QEMU_PROG).stp,"  GEN   $(QEMU_PROG).stp")
> -else
> -trace:
> +		-s<  $(SRC_PATH)/trace-events>  $@,"  GEN   $@")
>   endif
>
> -all: $(PROGS) trace
> +all: $(PROGS) $(STPFILES)
>
>   # Dummy command so that make thinks it has done something
>   	@true
> @@ -363,7 +362,7 @@ endif
>   endif
>   ifdef CONFIG_SYSTEMTAP_TRACE
>   	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/../systemtap/tapset"
> -	$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(datadir)/../systemtap/tapset"
> +	$(INSTALL_DATA) $(STPFILES) "$(DESTDIR)$(datadir)/../systemtap/tapset"
>   endif
>
>   # Include automatically generated dependency files
>

Patch

diff --git a/Makefile.target b/Makefile.target
index a5e6410..652c7d2 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -30,6 +30,7 @@  endif
 endif
 
 PROGS=$(QEMU_PROG)
+STPFILES=
 
 ifndef CONFIG_HAIKU
 LIBS+=-lm
@@ -41,19 +42,17 @@  config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak
 
 ifdef CONFIG_SYSTEMTAP_TRACE
-trace: $(QEMU_PROG).stp
+STPFILES+=$(QEMU_PROG).stp
 
 $(QEMU_PROG).stp:
 	$(call quiet-command,sh $(SRC_PATH)/tracetool \
 		--$(TRACE_BACKEND) \
 		--bindir $(bindir) \
 		--target $(TARGET_ARCH) \
-		-s < $(SRC_PATH)/trace-events > $(QEMU_PROG).stp,"  GEN   $(QEMU_PROG).stp")
-else
-trace:
+		-s < $(SRC_PATH)/trace-events > $@,"  GEN   $@")
 endif
 
-all: $(PROGS) trace
+all: $(PROGS) $(STPFILES)
 
 # Dummy command so that make thinks it has done something
 	@true
@@ -363,7 +362,7 @@  endif
 endif
 ifdef CONFIG_SYSTEMTAP_TRACE
 	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/../systemtap/tapset"
-	$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(datadir)/../systemtap/tapset"
+	$(INSTALL_DATA) $(STPFILES) "$(DESTDIR)$(datadir)/../systemtap/tapset"
 endif
 
 # Include automatically generated dependency files