diff: bindist/Mmakefile fixes

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Nov 9 09:39:22 AEDT 1998


Estimated hours taken: 0.25

bindist/Mmakefile:
	Change it to work properly if the `tests' directory
	is at the same level as the `mercury' directory
	rather than being a subdirectory.
	Also change an incorrect variable name in a comment to fix
	an Mmake warning about using an undefined variable.

Index: bindist/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/bindist/Mmakefile,v
retrieving revision 1.11
diff -u -r1.11 Mmakefile
--- Mmakefile	1998/04/08 11:06:42	1.11
+++ Mmakefile	1998/11/08 21:47:30
@@ -42,7 +42,7 @@
 .PHONY: binary_distribution
 binary_distribution: bindist.configure bindist.build_vars
 	# Make a quick check that there is a mercury installation in
-	# $(INSTALL_DIR) by looking for mmc and mercury_compile.
+	# $(INSTALL_PREFIX) by looking for mmc and mercury_compile.
 	test -f $(INSTALL_BINDIR)/mmc
 	test -f $(INSTALL_MERC_BIN_DIR)/mercury_compile
 	# create a temporary directory in which to assemble the distribution
@@ -82,13 +82,21 @@
 	-cd ../extras/graphics/samples/maze; mmake realclean
 	-cd ../extras/trailed_update; mmake realclean
 	-cd ../extras/trailed_update/samples; mmake realclean
-	-cd ../tests; mmake realclean
+	-if [ -d ../tests ]; then					\
+		cd ../tests; mmake realclean;				\
+	else								\
+		cd ../../tests; mmake realclean;			\
+	fi
 	cp -r ../samples $(MERCURY_VERSION)/samples
 	cp -r ../extras $(MERCURY_VERSION)/extras
-	cp -r ../tests $(MERCURY_VERSION)/tests
-	for file in $(MISC_FILES); do \
-		sed	-e 's/<VERSION>/$(VERSION)/g' \
-			-e 's/<FULLARCH>/$(FULLARCH)/g' \
+	if [ -d ../tests ]; then					\
+		cp -r ../tests $(MERCURY_VERSION)/tests;		\
+	else								\
+		cp -r ../../tests $(MERCURY_VERSION)/tests;		\
+	fi
+	for file in $(MISC_FILES); do					\
+		sed	-e 's/<VERSION>/$(VERSION)/g'			\
+			-e 's/<FULLARCH>/$(FULLARCH)/g'			\
 			bindist.$$file > $(MERCURY_VERSION)/$$file || exit 1; \
 	done
 	# (XXX don't use redirection or pipes, because on gnu-win32

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list