Skip to contentSkip to conversation

master - make: support per-object defines

PATCH Peter Rajnoha 1 participant 1 message Dec 4, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fc37d4fb0dfc47c49b8acdc773a4ad67d59b51b8
Commit:        fc37d4fb0dfc47c49b8acdc773a4ad67d59b51b8
Parent:        6c6bcc00e401262db3b906259674a3231a119603
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Dec 4 12:35:02 2013 +0100
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Wed Dec 4 13:30:08 2013 +0100

make: support per-object defines

In the case we have a dir with multiple objects and for an individual object file we need special define - allow to define it without adding extra rules.

To ensure dmeventd.o compilation will use EXTRA_FLAGS:
CFLAGS_dmeventd.o += $(EXTRA_FLAGS)

Then it's better to use:
dmeventd.o: CFLAGS += $(EXTRA_FLAGS)

---
 WHATS_NEW    |    1 +
 make.tmpl.in |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index 9155ddf..d512ab5 100644
@@ -1,5 +1,6 @@
 Version 2.02.105 -
 =====================================
+  Support per-object compilation cflags via CFLAGS_object.o.
   Automatically detect support for compiler/linker options to use RELRO and PIE.
   Add --splitsnapshot to lvconvert to separate out cow LV.
   Reinstate origin reload to complete lvconvert -s with active LVs. (2.02.98)
make.tmpl.in +1 -1
index 35a47be..944be9b 100644
@@ -345,7 +345,7 @@ endif
 $(TARGETS): $(OBJECTS)
 
 %.o: %.c
-	$(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $< -o $@
+	$(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
 
 %.pot: %.c Makefile
 	$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \