diff --git a/Makefile b/Makefile index 5777b59917d0732ffcc5e393e79987f7d1e4a4b5..c959baf2bb7cfb61d61a88b91e1e00383b1d1e46 100755 --- a/Makefile +++ b/Makefile @@ -342,7 +342,6 @@ ast_expr: vercomp 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 @@ else 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 @@ depend: .depend 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: " > $@ diff --git a/mkdep b/mkdep index 9d15f1e7587cc6123ee7dcad10be2754c9e65f20..84f969b1d6046f1a38a140b408fe34849af0f470 100755 --- a/mkdep +++ b/mkdep @@ -40,6 +40,7 @@ D=.depend # default dependency file is .depend append=0 pflag= +dflag= while : do case "$1" in @@ -58,13 +59,19 @@ while : -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 @@ fi 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