[Ocfs2-tools-commits] zab commits r482 - trunk

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Dec 14 13:13:45 CST 2004


Author: zab
Date: 2004-12-14 13:13:43 -0600 (Tue, 14 Dec 2004)
New Revision: 482

Modified:
   trunk/Postamble.make
   trunk/Preamble.make
Log:
o use -MD and -MP to get automagic header deps
  make sure to make clean if you remove files


Modified: trunk/Postamble.make
===================================================================
--- trunk/Postamble.make	2004-12-13 23:06:30 UTC (rev 481)
+++ trunk/Postamble.make	2004-12-14 19:13:43 UTC (rev 482)
@@ -37,7 +37,7 @@
 LOCAL_CPPFLAGS = $($(subst /,_,$(basename $@))_CPPFLAGS)
 
 %.o: %.c
-	$(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(INCLUDES) $(DEFINES) $(VERMAGIC) -o $@ -c $<
+	$(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(INCLUDES) $(DEFINES) $(VERMAGIC) $(CDEPFLAGS) -o $@ -c $<
 
 %.p: %.c
 	$(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(INCLUDES) $(DEFINES) $(VERMAGIC) -E -o $@ -c $<
@@ -121,7 +121,7 @@
 	$(MAKE) -C $(subst -clean,,$@) clean
 
 clean: clean-subdirs $(CLEAN_RULES)
-	rm -f *.o *.p core $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(LIBRARIES) stamp-md5
+	rm -f *.o *.p .*.d core $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(LIBRARIES) stamp-md5
 
 
 DIST_SUBDIRS = $(addsuffix -dist,$(SUBDIRS))
@@ -146,8 +146,13 @@
         done
 
 dist-all: dist-copy dist-subdirs
-	 
 
+LOCAL_DFILES := $(wildcard *.d)
+ifneq ($(LOCAL_DFILES),)
+.PHONY: $(LOCAL_DFILES)
+-include $(LOCAL_DFILES)
+endif
+
 ifeq (Cscope.make,$(wildcard Cscope.make))
 include Cscope.make
 endif

Modified: trunk/Preamble.make
===================================================================
--- trunk/Preamble.make	2004-12-13 23:06:30 UTC (rev 481)
+++ trunk/Preamble.make	2004-12-14 19:13:43 UTC (rev 482)
@@ -24,6 +24,8 @@
 
 CFLAGS += $($(subst /,_,$(basename $@))_CFLAGS)
 CFLAGS += -pipe
+# protect with configure?
+CDEPFLAGS = -MD -MP
 
 LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 



More information about the Ocfs2-tools-commits mailing list