[Asterisk-cvs] asterisk Makefile,1.158,1.159 mkdep,1.6,1.7

kpfleming at lists.digium.com kpfleming at lists.digium.com
Thu May 19 11:15:06 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv13410

Modified Files:
	Makefile mkdep 
Log Message:
more Makefile tweaks
ensure mkdep can handle creating rules for files that are using double-colon rules


Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- Makefile	19 May 2005 14:53:56 -0000	1.158
+++ Makefile	19 May 2005 15:20:06 -0000	1.159
@@ -342,7 +342,6 @@
 
 ifeq ($(MAKECMDGOALS),ast_expr.a)
 FLEXVER_GT_2_5_31=$(shell ./vercomp flex \>= 2.5.31)
-BISONVER=$(shell bison --version | grep \^bison | sed 's/.* \([0-9]\+\.[-0-9.]\+[a-z]\?\)/\1/' )
 BISONVER_GE_1_85=$(shell ./vercomp bison \>= 1.85 )
 endif
 
@@ -352,36 +351,37 @@
 FLEXOBJS=ast_expr.o
 endif
 
-ast_expr.a: $(FLEXOBJS)
-	@rm -f $@
-	ar r $@ $(FLEXOBJS)
-	ranlib $@
+ast_expr.o:: ast_expr.c
+	@echo "================================================================================="
+	@echo "NOTE: Using older version of expression parser. To use the newer version,"
+	@echo "NOTE: upgrade to flex 2.5.31 or higher, which can be found at"
+	@echo "NOTE: http://sourceforge.net/project/showfiles.php?group_id=72099"
+	@echo "================================================================================="
+
+ast_expr.o:: ast_expr.c
 
 ifeq ($(BISONVER_GE_1_85),false)
 .y.c:
-	@echo "=================================================================================" ;\
-	echo "NOTE: You may have trouble if you do not have bison-1.85 or higher installed!" ;\
-	echo "NOTE: You can pick up a copy at: http://ftp.gnu.org/ or its mirrors" ;\
-	echo "NOTE: You have: $(BISONVER)" ;\
-	echo "================================================================================" ;\
+	@echo "================================================================================="
+	@echo "NOTE: You may have trouble if you do not have bison-1.85 or higher installed!"
+	@echo "NOTE: You can pick up a copy at: http://ftp.gnu.org or its mirrors"
+	@echo "NOTE: You have:"
+	@bison --version
+	@echo "================================================================================"
 	bison -v -d --name-prefix=ast_yy $< -o $@
 else
 .y.c:
 	bison -v -d --name-prefix=ast_yy $< -o $@
 endif
 
-ast_expr.o:: ast_expr.c
-	@echo "=================================================================================" ;\
-	echo "NOTE: Using older version of expression parser. To use the newer version," ;\
-	echo "NOTE: upgrade to flex 2.5.31 or higher, which can be found at" ;\
-	echo "NOTE: http://sourceforge.net/project/showfiles.php?group_id=72099" ;\
-	echo "=================================================================================" ;\
-
-ast_expr.o:: ast_expr.c
-
 ast_expr2f.c: ast_expr2.fl
 	flex ast_expr2.fl
 
+ast_expr.a: $(FLEXOBJS)
+	@rm -f $@
+	ar r $@ $(FLEXOBJS)
+	ranlib $@
+
 cli.o: cli.c build.h
 
 asterisk.o: asterisk.c build.h
@@ -762,7 +762,8 @@
 	for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
 
 .depend:
-	./mkdep ${CFLAGS} `ls *.c`
+	./mkdep ${CFLAGS} $(filter-out ast_expr.c,$(wildcard *.c))
+	./mkdep -a -d ${CFLAGS} ast_expr.c
 
 .tags-depend:
 	@echo -n ".tags-depend: " > $@

Index: mkdep
===================================================================
RCS file: /usr/cvsroot/asterisk/mkdep,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mkdep	17 Dec 2004 07:59:26 -0000	1.6
+++ mkdep	19 May 2005 15:20:06 -0000	1.7
@@ -40,6 +40,7 @@
 D=.depend			# default dependency file is .depend
 append=0
 pflag=
+dflag=
 
 while :
 	do case "$1" in
@@ -58,13 +59,19 @@
 		-p)
 			pflag=p
 			shift ;;
+
+      		# the -d flag produces double-colon rules instead of single-colon rules
+      		-d)
+			dflag=d
+			shift ;;
+
 		*)
 			break ;;
 	esac
 done
 
 if [ $# = 0 ] ; then
-	echo 'usage: mkdep [-p] [-f depend_file] [cc_flags] file ...'
+	echo 'usage: mkdep [-p] [-d] [-f depend_file] [cc_flags] file ...'
 	exit 1
 fi
 
@@ -82,10 +89,12 @@
 umask $um
 trap 'rm -rf $DTMP ; trap 2 ; kill -2 $$' 1 2 3 13 15
 
-if [ x$pflag = x ]; then
-	${CC:-cc} -M "$@" 2>/dev/null | sed -e 's; \./; ;g' > $TMP
-else
+if [ x$pflag = xp ]; then
 	${CC:-cc} -M "$@" 2>/dev/null | sed -e 's;\.o :; :;' -e 's; \./; ;g' > $TMP
+elif [ x$dflag = xd ]; then
+	${CC:-cc} -M "$@" 2>/dev/null | sed -e 's;\.o:;\.o::;' -e 's; \./; ;g' > $TMP
+else
+	${CC:-cc} -M "$@" 2>/dev/null | sed -e 's; \./; ;g' > $TMP
 fi
 
 if [ $? != 0 ]; then




More information about the svn-commits mailing list