[m-rev.] diff: add `--file' option to mmake

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Sep 22 15:37:16 AEST 2004


Estimated hours taken: 1
Branches: main

Add the option `--file' to mmake.  This allows the user
to specify the name of the file that mmake uses as the Mmakefile.
This can be useful when porting programs between systems
and experimenting with different configurations, particularly
when the programs are not under the control of autoconf.

The option `--file' may be abbreviated to `-f'.  If a file
is specified via `--file' then it will be used in preference to
any file in the current directory named Mmakefile or Mmake.

Unlike GNU make using multiple instances of `--file' will
not cause mmake to jointly use all of the specified files.
Instead it will use the last one specified and ignore the
others.

scripts/mmake.in:
	Add the `--file' option to mmake.

Julien.

Index: mmake.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.43
diff -u -r1.43 mmake.in
--- mmake.in	1 Aug 2003 15:00:38 -0000	1.43
+++ mmake.in	20 Sep 2004 15:28:32 -0000
@@ -47,6 +47,8 @@
 		Save the generated makefile to \`Mmake.makefile'.
 		This is useful for tracking down syntax errors in
 		your Mmake file.
+	-f <filename>, --file <filename>:
+		Use the specified file as the Mmake file.
 	-v, --verbose:
 		Print verbose progress messages.
 	-w-, --no-warn-undefined-vars:
@@ -138,6 +140,11 @@
 			MMAKE="$MMAKE $1"
 			shift
 			;;
+		-f|--file)
+			mmake="$2"
+			shift
+			shift
+			;;
 		-v|--verbose)
 			verbose=true
 			MMAKE="$MMAKE $1"
@@ -216,13 +223,15 @@
 		;;
 esac

-if [ -f Mmakefile ]; then
-	mmake="Mmakefile"
-else
-	if [ -f Mmake ]; then
-		mmake="Mmake"
+if [ "$mmake" = "" ]; then
+	if [ -f Mmakefile ]; then
+		mmake="Mmakefile"
 	else
-		mmake=""
+		if [ -f Mmake ]; then
+			mmake="Mmake"
+		else
+			mmake=""
+		fi
 	fi
 fi


--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list