]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Added --use-deps and --include-deps options.
authorTom Tromey <tromey@redhat.com>
Wed, 22 Nov 1995 06:22:54 +0000 (06:22 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 22 Nov 1995 06:22:54 +0000 (06:22 +0000)
Handle auto-generating dependencies.

automake.in

index b4fcfc3b8f436d9369deb3f8580eea9f28a830e3..e5d4ef7eddb19ec9b226351545370ac8f2a9197a 100755 (executable)
@@ -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.
   #