xfs
[Top] [All Lists]

dmapi: fix depend targets

To: xfs@xxxxxxxxxxx
Subject: dmapi: fix depend targets
From: Alex Elder <aelder@xxxxxxx>
Date: Fri, 30 Jul 2010 16:51:23 -0500
User-agent: Heirloom mailx 12.4 7/29/08
There's no need to re-make the dependency files all the time.  Make
it so the "depend" target rebuilds the ".dep" file only if necessary.

Signed-off-by: Alex Elder <aelder@xxxxxxx>

---
 include/buildrules |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: b/include/buildrules
===================================================================
--- a/include/buildrules
+++ b/include/buildrules
@@ -8,7 +8,7 @@ include $(TOPDIR)/include/builddefs
 
 clean clobber : $(addsuffix -clean,$(SUBDIRS))
        rm -f $(DIRT)
-       @rm -fr .libs
+       @rm -fr .libs .dep
 
 %-clean:
        $(MAKE) -C $* clean
@@ -72,9 +72,10 @@ ifdef LTLIBRARY
 DEPENDSCRIPT := $(DEPENDSCRIPT) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,'
 endif
 
-depend : $(CFILES) $(HFILES) $(addsuffix -depend,$(SUBDIRS))
+depend : .dep $(addsuffix -depend,$(SUBDIRS))
+
+.dep : $(CFILES) $(HFILES)
        $(DEPENDSCRIPT) > .dep
-       test -s .dep || rm -f .dep
 
 %-depend:
        $(MAKE) -C $* depend

<Prev in Thread] Current Thread [Next in Thread>
  • dmapi: fix depend targets, Alex Elder <=