qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Makefiles: convert some obj-specific CFLAGS to use new foo.o-cflags syntax
@ 2014-05-02 11:40 Michael Tokarev
  2014-05-04  1:45 ` Fam Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2014-05-02 11:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Fam Zheng

Current Makefile system allows using foo.o-cflags variables to store
object-specific CFLAGS.  Convert some usages of old syntax
(using QEMU_CFLAGS += construct) to the new syntax.

Do not touch multifile modules for now, as build system isn't ready for this.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 Makefile               |    6 ------
 Makefile.objs          |    2 ++
 audio/Makefile.objs    |    2 +-
 backends/Makefile.objs |    2 +-
 disas/Makefile.objs    |    2 +-
 ui/Makefile.objs       |    2 +-
 6 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 423e373..0e32b27 100644
--- a/Makefile
+++ b/Makefile
@@ -148,10 +148,6 @@ endif
 
 all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
 
-vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-
-vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
-
 config-host.h: config-host.h-timestamp
 config-host.h-timestamp: config-host.mak
 qemu-options.def: $(SRC_PATH)/qemu-options.hx
@@ -195,8 +191,6 @@ ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
 
 recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
 
-bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
-
 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
 $(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
diff --git a/Makefile.objs b/Makefile.objs
index a6e0e2a..f0069ba 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -64,9 +64,11 @@ common-obj-y += hw/
 
 common-obj-y += ui/
 common-obj-y += bt-host.o bt-vhci.o
+bt-host.o-cflags := $(BLUEZ_CFLAGS)
 
 common-obj-y += dma-helpers.o
 common-obj-y += vl.o
+vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
 common-obj-y += tpm.o
 
 common-obj-$(CONFIG_SLIRP) += slirp/
diff --git a/audio/Makefile.objs b/audio/Makefile.objs
index d71a877..bdb12c6 100644
--- a/audio/Makefile.objs
+++ b/audio/Makefile.objs
@@ -14,4 +14,4 @@ common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
 common-obj-y += wavcapture.o
 
 $(obj)/audio.o $(obj)/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
-$(obj)/sdlaudio.o: QEMU_CFLAGS += $(SDL_CFLAGS)
+sdlaudio.o-cflags  := $(SDL_CFLAGS)
diff --git a/backends/Makefile.objs b/backends/Makefile.objs
index 42557d5..bbe8a2d 100644
--- a/backends/Makefile.objs
+++ b/backends/Makefile.objs
@@ -3,6 +3,6 @@ common-obj-$(CONFIG_POSIX) += rng-random.o
 
 common-obj-y += msmouse.o
 common-obj-$(CONFIG_BRLAPI) += baum.o
-$(obj)/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) 
+baum.o-cflags := $(SDL_CFLAGS) 
 
 common-obj-$(CONFIG_TPM) += tpm.o
diff --git a/disas/Makefile.objs b/disas/Makefile.objs
index 41c2374..8dae4da 100644
--- a/disas/Makefile.objs
+++ b/disas/Makefile.objs
@@ -4,7 +4,7 @@ common-obj-$(CONFIG_ARM_DIS) += arm.o
 common-obj-$(CONFIG_ARM_A64_DIS) += arm-a64.o
 common-obj-$(CONFIG_ARM_A64_DIS) += libvixl/
 libvixldir = $(SRC_PATH)/disas/libvixl
-$(obj)/arm-a64.o: QEMU_CFLAGS += -I$(libvixldir)
+arm-a64.o-cflags := -I$(libvixldir)
 common-obj-$(CONFIG_CRIS_DIS) += cris.o
 common-obj-$(CONFIG_HPPA_DIS) += hppa.o
 common-obj-$(CONFIG_I386_DIS) += i386.o
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index 6f2294e..4af420b 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -17,4 +17,4 @@ common-obj-$(CONFIG_GTK) += gtk.o x_keymap.o
 
 $(obj)/sdl.o $(obj)/sdl_zoom.o $(obj)/sdl2.o: QEMU_CFLAGS += $(SDL_CFLAGS)
 
-$(obj)/gtk.o: QEMU_CFLAGS += $(GTK_CFLAGS) $(VTE_CFLAGS)
+gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
-- 
1.7.10.4

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

* Re: [Qemu-devel] [PATCH] Makefiles: convert some obj-specific CFLAGS to use new foo.o-cflags syntax
  2014-05-02 11:40 [Qemu-devel] [PATCH] Makefiles: convert some obj-specific CFLAGS to use new foo.o-cflags syntax Michael Tokarev
@ 2014-05-04  1:45 ` Fam Zheng
  2014-05-04  8:20   ` Michael Tokarev
  0 siblings, 1 reply; 3+ messages in thread
From: Fam Zheng @ 2014-05-04  1:45 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-trivial, qemu-devel

On Fri, 05/02 15:40, Michael Tokarev wrote:
> Current Makefile system allows using foo.o-cflags variables to store
> object-specific CFLAGS.  Convert some usages of old syntax
> (using QEMU_CFLAGS += construct) to the new syntax.

Thanks for doing this! Two minor comments below, but not showstopper,

Reviewed-by: Fam Zheng <famz@redhat.com>

> 
> Do not touch multifile modules for now, as build system isn't ready for this.
> 
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>  Makefile               |    6 ------
>  Makefile.objs          |    2 ++
>  audio/Makefile.objs    |    2 +-
>  backends/Makefile.objs |    2 +-
>  disas/Makefile.objs    |    2 +-
>  ui/Makefile.objs       |    2 +-
>  6 files changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 423e373..0e32b27 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -148,10 +148,6 @@ endif
>  
>  all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
>  
> -vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
> -
> -vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
> -
>  config-host.h: config-host.h-timestamp
>  config-host.h-timestamp: config-host.mak
>  qemu-options.def: $(SRC_PATH)/qemu-options.hx
> @@ -195,8 +191,6 @@ ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
>  
>  recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
>  
> -bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
> -
>  $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
>  	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
>  $(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
> diff --git a/Makefile.objs b/Makefile.objs
> index a6e0e2a..f0069ba 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -64,9 +64,11 @@ common-obj-y += hw/
>  
>  common-obj-y += ui/
>  common-obj-y += bt-host.o bt-vhci.o
> +bt-host.o-cflags := $(BLUEZ_CFLAGS)
>  
>  common-obj-y += dma-helpers.o
>  common-obj-y += vl.o
> +vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
>  common-obj-y += tpm.o
>  
>  common-obj-$(CONFIG_SLIRP) += slirp/
> diff --git a/audio/Makefile.objs b/audio/Makefile.objs
> index d71a877..bdb12c6 100644
> --- a/audio/Makefile.objs
> +++ b/audio/Makefile.objs
> @@ -14,4 +14,4 @@ common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
>  common-obj-y += wavcapture.o
>  
>  $(obj)/audio.o $(obj)/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
> -$(obj)/sdlaudio.o: QEMU_CFLAGS += $(SDL_CFLAGS)
> +sdlaudio.o-cflags  := $(SDL_CFLAGS)

s/  / /

> diff --git a/backends/Makefile.objs b/backends/Makefile.objs
> index 42557d5..bbe8a2d 100644
> --- a/backends/Makefile.objs
> +++ b/backends/Makefile.objs
> @@ -3,6 +3,6 @@ common-obj-$(CONFIG_POSIX) += rng-random.o
>  
>  common-obj-y += msmouse.o
>  common-obj-$(CONFIG_BRLAPI) += baum.o
> -$(obj)/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) 
> +baum.o-cflags := $(SDL_CFLAGS) 

Could remove the ending whitespace since you are touch this line.

Thanks,
Fam

>  
>  common-obj-$(CONFIG_TPM) += tpm.o
> diff --git a/disas/Makefile.objs b/disas/Makefile.objs
> index 41c2374..8dae4da 100644
> --- a/disas/Makefile.objs
> +++ b/disas/Makefile.objs
> @@ -4,7 +4,7 @@ common-obj-$(CONFIG_ARM_DIS) += arm.o
>  common-obj-$(CONFIG_ARM_A64_DIS) += arm-a64.o
>  common-obj-$(CONFIG_ARM_A64_DIS) += libvixl/
>  libvixldir = $(SRC_PATH)/disas/libvixl
> -$(obj)/arm-a64.o: QEMU_CFLAGS += -I$(libvixldir)
> +arm-a64.o-cflags := -I$(libvixldir)
>  common-obj-$(CONFIG_CRIS_DIS) += cris.o
>  common-obj-$(CONFIG_HPPA_DIS) += hppa.o
>  common-obj-$(CONFIG_I386_DIS) += i386.o
> diff --git a/ui/Makefile.objs b/ui/Makefile.objs
> index 6f2294e..4af420b 100644
> --- a/ui/Makefile.objs
> +++ b/ui/Makefile.objs
> @@ -17,4 +17,4 @@ common-obj-$(CONFIG_GTK) += gtk.o x_keymap.o
>  
>  $(obj)/sdl.o $(obj)/sdl_zoom.o $(obj)/sdl2.o: QEMU_CFLAGS += $(SDL_CFLAGS)
>  
> -$(obj)/gtk.o: QEMU_CFLAGS += $(GTK_CFLAGS) $(VTE_CFLAGS)
> +gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
> -- 
> 1.7.10.4
> 

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

* Re: [Qemu-devel] [PATCH] Makefiles: convert some obj-specific CFLAGS to use new foo.o-cflags syntax
  2014-05-04  1:45 ` Fam Zheng
@ 2014-05-04  8:20   ` Michael Tokarev
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2014-05-04  8:20 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-trivial, qemu-devel

04.05.2014 05:45, Fam Zheng wrote:
> On Fri, 05/02 15:40, Michael Tokarev wrote:
>> Current Makefile system allows using foo.o-cflags variables to store
>> object-specific CFLAGS.  Convert some usages of old syntax
>> (using QEMU_CFLAGS += construct) to the new syntax.
> 
> Thanks for doing this! Two minor comments below, but not showstopper,

Thank you for the review.  I've updated both this patch (to remove extra
space chars) and the bashism one (to fix spelling error in the description).

/mjt

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

end of thread, other threads:[~2014-05-04  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02 11:40 [Qemu-devel] [PATCH] Makefiles: convert some obj-specific CFLAGS to use new foo.o-cflags syntax Michael Tokarev
2014-05-04  1:45 ` Fam Zheng
2014-05-04  8:20   ` Michael Tokarev

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