[m-dev.] diff: mmake: if [ -d Mercury ] then enable --use-subdirs

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 29 13:53:38 AEST 1998


On 29-May-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Estimated hours taken: 0.25
> 
> scripts/mmake.in:
> 	If the current directory contains a `Mercury' subdirectory,
> 	then enable `--use-subdirs' by default.

Oops, here's the actual diff.

Index: mmake.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.21
diff -u -u -r1.21 mmake.in
--- mmake.in	1998/04/02 13:23:06	1.21
+++ mmake.in	1998/05/29 03:41:41
@@ -20,8 +20,10 @@
 Usage: mmake [<mmake options>] [-- <make options>] <target>...
 Options:
 	--use-subdirs:
-		Build intermediate files in subdirectories,
+		Build intermediate files in a \`Mercury' subdirectory,
 		rather than in the current directory.
+		(If the current directory already contains a \`Mercury'
+		subdirectory, then this option is the default.)
 	-s, --save-makefile:
 		Save the generated makefile to \`Mmake.makefile'.
 		This is useful for tracking down syntax errors in
@@ -64,10 +66,11 @@
 MMAKE=$0
 verbose=false
 save_makefile=false
-use_subdirs=${MMAKE_USE_SUBDIRS=no}
+use_subdirs=${MMAKE_USE_SUBDIRS=`
+	if [ -d Mercury ]; then echo yes; else echo no; fi`}
 
 while [ $# -gt 0 ]; do
-	case $1 in
+	case "$1" in
 		-h|--help)
 			echo "$Help"
 			exit 0

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list