add -m flag to skip make (just print what it will do)
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 12 Jun 1995 00:08:14 +0000 (16:08 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 12 Jun 1995 00:08:14 +0000 (16:08 -0800)
SCCS-vsn: usr.sbin/sendmail/src/makesendmail 8.24

usr/src/usr.sbin/sendmail/src/makesendmail

index 8a87f0f..6dbe7a2 100644 (file)
@@ -6,7 +6,7 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#       @(#)makesendmail       8.23 (Berkeley) %G%
+#       @(#)makesendmail       8.24 (Berkeley) %G%
 #
 
 #
 #
 
 #
 #  multiple architectures and Makefiles.
 #
 
 #  multiple architectures and Makefiles.
 #
 
+if [ "x${1-""}" = "x-m" ]
+then
+       # show Makefile name only
+       mflag=1
+else
+       mflag=""
+fi
+
 #
 #  Do heuristic guesses for machines that do not have uname
 #
 #
 #  Do heuristic guesses for machines that do not have uname
 #
@@ -107,7 +115,7 @@ else
        sfx=".${SENDMAIL_SUFFIX}"
 fi
 
        sfx=".${SENDMAIL_SUFFIX}"
 fi
 
-echo "Making sendmail with os=$os, rel=$rel, rbase=$rbase, arch=$arch, sfx=$sfx"
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, arch=$arch, sfx=$sfx"
 
 # now try to find a reasonable object directory
 if [ -r obj.$os.$rel.$arch$sfx ]; then
 
 # now try to find a reasonable object directory
 if [ -r obj.$os.$rel.$arch$sfx ]; then
@@ -181,10 +189,38 @@ else
                echo "Cannot determine how to support $arch.$os.$rel"
                exit 1
        fi
                echo "Cannot determine how to support $arch.$os.$rel"
                exit 1
        fi
+       if [ "$mflag" ]
+       then
+               echo "Will run in virgin $obj using $makefile"
+               exit 0
+       fi
        echo "Creating $obj using $makefile"
        mkdir $obj
        (cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../Makefiles/$makefile Makefile)
 fi
        echo "Creating $obj using $makefile"
        mkdir $obj
        (cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../Makefiles/$makefile Makefile)
 fi
+
+if [ "$mflag" ]
+then
+       makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+       if [ -z "$makefile" ]
+       then
+               echo "ERROR: $obj exists but has no Makefile"
+               exit 1
+       fi
+       case $makefile
+       in
+         ../Makefiles/*)
+               makefile=`echo $makefile | sed 's/...Makefiles.//'`
+               echo "Will run in existing $obj using $makefile"
+               ;;
+
+         *)
+               echo "Will run in existing $obj using custom $makefile"
+               ;;
+       esac
+       exit 0
+fi
+
 echo "Making in $obj"
 cd $obj
 if [ $# = 0 ]
 echo "Making in $obj"
 cd $obj
 if [ $# = 0 ]