[sr-dev] git:kamailio_3.0: make: depends move/rm file fix & optimization

Andrei Pelinescu-Onciul andrei at iptel.org
Wed Mar 17 21:18:13 CET 2010


Module: sip-router
Branch: kamailio_3.0
Commit: ae9b1ec34994686c4d2d902582835ab0b2ed2c59
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ae9b1ec34994686c4d2d902582835ab0b2ed2c59

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Tue Mar  9 21:57:25 2010 +0100

make: depends move/rm file fix & optimization

- fix for make failing if the depends were made and a *.h is moved
  or deleted
- avoid restarting make when depends change (make the depends at
  the same moment when the .o are generated)
(cherry picked from commit 965e651fbe84d370c05a647e022023cecf2d02bd)

---

 Makefile.rules |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/Makefile.rules b/Makefile.rules
index 8f254f4..5ee7d76 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -84,11 +84,9 @@ exec_cmd= $(if $($(quiet)_cmd_$(1)),\
 #implicit rules
 %.o:%.c  $(ALLDEP)
 	$(call exec_cmd,CC)
-
-%.d: %.c $(ALLDEP)
-	@set -e; $(MKDEP) $(CFLAGS) $(C_INCLUDES) $(INCLUDES) $(C_DEFS) $(DEFS) $<\
-	    |  sed 's#\(\($(*D)/\)\{0,1\}$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
-	    test -s $@ || ( rm -f $@; false )
+	@$(MKDEP) $(CFLAGS) $(C_INCLUDES) $(INCLUDES) $(C_DEFS) $(DEFS) $< \
+	|  sed	-e 's/#.*//' -e '/:[ 	]*$$/d' -e '/^[ 	]*$$/d' \
+				-e 's#.*:#$@: $$(wildcard #g' -e 's/\([^\\]\)$$/\1)/'> $*.d
 
 # use RPATH and SER_LIBS if needed (make install and the module depends
 # on some ser libs)
@@ -193,9 +191,6 @@ makecfg.lst:
 .PHONY: all
 all: $(NAME) every-module
 
-.PHONY: dep
-dep: $(depends)
-
 .PHONY: static
 static: $(objs)
 




More information about the sr-dev mailing list