[m-rev.] for review: fix mmake -f

Ian MacLarty maclarty at cs.mu.OZ.AU
Thu Aug 11 10:15:43 AEST 2005


For review by anyone.

Estimated hours taken: 2

Fix the -f mmake option.  Previously `mmake install' would ignore this option
when compiling different grades in the temporary directory.

scripts/mmake.in:
	Export a MMAKEFILE variable which stores the Mmakefile being used.
	This causes child calls to mmake to use the same Mmakefile if no
	-f option is given to the child calls.

Index: scripts/mmake.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.45
diff -u -r1.45 mmake.in
--- scripts/mmake.in	23 Dec 2004 04:19:35 -0000	1.45
+++ scripts/mmake.in	10 Aug 2005 11:31:07 -0000
@@ -227,15 +227,19 @@
 esac

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

 case $use_subdirs in
@@ -348,7 +352,9 @@
 	echo export MMAKE_USE_MMC_MAKE
 	echo MERCURY_DEFAULT_GRADE=$MERCURY_DEFAULT_GRADE
 	echo export MERCURY_DEFAULT_GRADE
-	echo cat ${MMAKE_VARS} $dvs $ds $include_makefile $mmake $deps \
+	echo MMAKEFILE=$MMAKEFILE
+	echo export MMAKEFILE
+	echo cat ${MMAKE_VARS} $dvs $ds $include_makefile $MMAKEFILE $deps \
 		${MMAKE_RULES}">>" $tmp
 	echo ${MMAKE_MAKE} ${MMAKE_MAKE_OPTS} -f $tmp -r ${set_target_asm} "$@"
 fi
@@ -357,6 +363,7 @@
 export MMAKE_USE_SUBDIRS
 export MMAKE_USE_MMC_MAKE
 export MERCURY_DEFAULT_GRADE
+export MMAKEFILE
 # XXX The $dvs and $ds variables can be so long as to overflow the
 # command line size limits, so we use xargs.  However echo doesn't quote
 # the file names correctly, but this is not a problem in practice because
@@ -366,7 +373,7 @@
 {
 cat ${MMAKE_VARS}
 echo $dvs $ds | xargs cat
-cat $include_makefile $mmake $deps ${MMAKE_RULES}
+cat $include_makefile $MMAKEFILE $deps ${MMAKE_RULES}
 } > $tmp
 case $# in
 	# Note that we can't use `exec' here, because if we did that,

--------------------------------------------------------------------------
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