From: Tom Tromey Date: Wed, 22 Nov 1995 06:22:54 +0000 (+0000) Subject: Added --use-deps and --include-deps options. X-Git-Tag: Release-0-25~232 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60ae7f1e14179618bb712c33ec3710e1e8e8aecd;p=thirdparty%2Fautomake.git Added --use-deps and --include-deps options. Handle auto-generating dependencies. --- diff --git a/automake.in b/automake.in index b4fcfc3b8..e5d4ef7ed 100755 --- a/automake.in +++ b/automake.in @@ -30,8 +30,6 @@ version=@VERSION@ prefix=@prefix@ am_dir=@datadir@/automake -usage="Usage: automake [--help] [--version] [Makefile]..." - # These are commonly found files that we look for and automatically # include in DIST_FILES. NOTE if you add something here, make sure # you add it in the right place -- that is, so that the "--help" still @@ -46,10 +44,19 @@ if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi mfiles= +am_usedeps=no +am_incdeps=no while test $# -gt 0; do case "$1" in --help | --h* ) - echo $usage +usage="Usage: automake [--help] [--version] [Makefile]..." + + echo "Usage: automake [OPTION]... [Makefile]..." + echo " + --help print this help, then exit + --version print version number, then exit + --use-deps include code to auto-generate dependencies + --include-deps include generated dependencies in Makefile" echo echo "Files which are automatically distributed, if found:" set $common @@ -67,15 +74,21 @@ while test $# -gt 0; do exit 0 ;; + --use-deps) + am_usedeps=yes + ;; + + --include-deps) + am_incdeps=yes + ;; + -- ) # Stop option processing. - shift break ;; -*) # FIXME consider "-" meaning stdin as input? echo "automake: unrecognized option -- \`$1'" 1>&2 - echo "${usage}" 1>&2 exit 1 ;; @@ -86,6 +99,11 @@ while test $# -gt 0; do shift done +if test "$am_usedeps" = yes && test "$am_incdeps" = yes; then + echo "automake: can't specify both --use-deps and --include-deps" 1>&2 + exit 1 +fi + test -n "$mfiles" || { # Look around. mfiles=`echo */Makefile.am` @@ -102,7 +120,7 @@ test -n "$mfiles" || { if test -n "$mfiles"; then echo "automake: using $mfiles" 1>&2 else - echo "${usage}" 1>&2 + echo "automake: no \"Makefile.am\" found or specified" 1>&2 exit 1 fi } @@ -356,6 +374,23 @@ p echo >&5 fi + + # + # Handle auto-generating dependencies. + # + if test "$am_usedeps" = yes; then + # Include code to auto-generate dependencies. + cat $am_dir/depend.am >&5 + else + if test "$am_incdeps" = yes; then + # Include any already generated dependencies. + if test -d .deps && test -f .deps/empty.P; then + cat .deps/*.P >&5 + fi + fi + fi + + # # Some final checks. #