Patchwork [RFC,3/4] build-sys: allow per-object foo.cflags variables

login
register
mail settings
Submitter Michael Tokarev
Date June 18, 2013, 5:34 p.m.
Message ID <1371576844-28743-4-git-send-email-mjt@msgid.tls.msk.ru>
Download mbox | patch
Permalink /patch/252392/
State New
Headers show

Comments

Michael Tokarev - June 18, 2013, 5:34 p.m.
In addition to allowing specifying foo.libs for additional
libraries, recognize also foo.cflags variable when compiling
foo.c into foo.o.

This is more for completness/symmetry with foo.libs.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 rules.mak |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/rules.mak b/rules.mak
index 69764b9..6087c68 100644
--- a/rules.mak
+++ b/rules.mak
@@ -18,7 +18,7 @@  QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
 QEMU_INCLUDES += -I$(<D) -I$(@D)
 
 %.o: %.c
-	$(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  CC    $(TARGET_DIR)$@")
+	$(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($*.cflags) -c -o $@ $<,"  CC    $(TARGET_DIR)$@")
 %.o: %.rc
 	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")