[libpri-commits] kpfleming: branch 1.4 r606 - in /branches/1.4: Makefile mkdep

SVN commits to the libpri project libpri-commits at lists.digium.com
Wed Jul 30 10:39:38 CDT 2008


Author: kpfleming
Date: Wed Jul 30 10:39:37 2008
New Revision: 606

URL: http://svn.digium.com/view/libpri?view=rev&rev=606
Log:
use better version.c creation process, and better dependency tracking process too

Removed:
    branches/1.4/mkdep
Modified:
    branches/1.4/Makefile

Modified: branches/1.4/Makefile
URL: http://svn.digium.com/view/libpri/branches/1.4/Makefile?view=diff&rev=606&r1=605&r2=606
==============================================================================
--- branches/1.4/Makefile (original)
+++ branches/1.4/Makefile Wed Jul 30 10:39:37 2008
@@ -76,7 +76,7 @@
 CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
 endif
 
-all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
+all: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
 
 update:
 	@if [ -d .svn ]; then \
@@ -131,12 +131,13 @@
 pridump: pridump.o
 	$(CC) -o pridump pridump.o -L. -lpri $(CFLAGS)
 
-ifneq ($(wildcard .depend),)
-include .depend
-endif
+MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$@).d -MP
 
-%.lo : %.c
-	$(CC) $(CFLAGS) -o $@ -c $<
+%.o: %.c
+	$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
+
+%.lo: %.c
+	$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
 
 $(STATIC_LIBRARY): $(STATIC_OBJS)
 	ar rcs $(STATIC_LIBRARY) $(STATIC_OBJS)
@@ -147,7 +148,7 @@
 	$(LDCONFIG) $(LDCONFIG_FLAGS) .
 	ln -sf libpri.so.$(SONAME) libpri.so
 
-version.c:
+version.c: FORCE
 	@build_tools/make_version_c > $@.tmp
 	@cmp -s $@.tmp $@ || mv $@.tmp $@
 	@rm -f $@.tmp
@@ -156,11 +157,12 @@
 	rm -f *.o *.so *.lo *.so.$(SONAME)
 	rm -f testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
 	rm -f pritest pridump
-	rm -f .depend
+	rm -f .*.d
 
-depend: .depend
+.PHONY:
 
-.depend: 
-	CC="$(CC)" ./mkdep ${CFLAGS} `ls *.c`
+FORCE:
 
-.PHONY: version.c
+ifneq ($(wildcard .*.d),)
+   include .*.d
+endif




More information about the libpri-commits mailing list