[m-rev.] for review: fixes to extras/*

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jan 10 16:38:34 AEDT 2003


Branches: main, release
Estimated hours taken: 4

Fix a problem where different packages in the `extras' distribution
were being installed in different directories when you specified
INSTALL_PREFIX in the Mmake.params file.  Some honoured the INSTALL_PREFIX
setting, some appended "/extras", and some ignored it completely.

Also, add `clean' and `realclean' targets for the extras directory hierarchy,
and fix a few other minor bugs.

extras/lazy_evaluation/Mmakefile:
	Include Mmake.params, which previously wasn't included at all
	in this file.

extras/logged_output/Mmakefile:
extras/odbc/Mmakefile:
extras/quickcheck/Mmakefile:
	Append "/extras" to INSTALL_PREFIX, which previously wasn't done
	at all in these directories.

extras/cgi/Mmakefile:
extras/complex_numbers/Mmakefile:
extras/concurrency/Mmakefile:
extras/curs/Mmakefile:
extras/curses/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/moose/Mmakefile:
extras/posix/Mmakefile:
	Move the line `INSTALL_PREFIX := $(INSTALL_PREFIX/extras)'
	to before the include of Mmake.params, so as not to override
	the user's setting (only override the default setting).

extras/Mmakefile:
extras/concurrency/Mmakefile:
	Add `clean' and `realclean' targets.

extras/posix/Mmakefile:
	Add MGNUCFLAGS = --no-ansi, since this is needed on some systems.

extras/quickcheck/Mmakefile:
	Add "depend", "all", and "install" targets.
	Ensure that the "check" target runs the test program.

extras/quickcheck/qcheck.m:
	Set the exit status to non-zero if a test fails.

extras/references/Mmakefile:
	Adjust the setting of LIBGRADES to account for the fact that
	$(GRADE) is no longer implicitly included in $(LIBGRADES).

Workspace: /home/ceres/fjh/mercury
Index: extras/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/Mmakefile,v
retrieving revision 1.1
diff -u -d -r1.1 Mmakefile
--- extras/Mmakefile	6 Mar 2002 10:10:26 -0000	1.1
+++ extras/Mmakefile	22 Nov 2002 12:46:10 -0000
@@ -35,6 +35,8 @@
 depend: $(SUBDIRS:%=%_depend)
 all: $(SUBDIRS)
 install: all $(SUBDIRS:%=%_install)
+clean: $(SUBDIRS:%=%_clean)
+realclean: $(SUBDIRS:%=%_realclean)
 
 $(SUBDIRS:%=%_depend): %_depend:
 	cd $* && $(MMAKE) $(MMAKEFLAGS) depend
@@ -44,5 +46,11 @@
 
 $(SUBDIRS:%=%_install): %_install:
 	cd $* && $(MMAKE) $(MMAKEFLAGS) install
+
+$(SUBDIRS:%=%_clean): %_clean:
+	cd $* && $(MMAKE) $(MMAKEFLAGS) clean
+
+$(SUBDIRS:%=%_realclean): %_realclean:
+	cd $* && $(MMAKE) $(MMAKEFLAGS) realclean
 
 .PHONY: $(SUBDIRS)
Index: extras/cgi/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/cgi/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- extras/cgi/Mmakefile	6 Mar 2002 10:10:29 -0000	1.3
+++ extras/cgi/Mmakefile	22 Nov 2002 12:50:35 -0000
@@ -4,6 +4,8 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 -include ../Mmake.params
 
 LIBRARY = libmercury_www
@@ -13,8 +15,6 @@
 depend: mercury_www.depend
 
 distclean: realclean
-
-INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
 install: libmercury_www.install
 
Index: extras/complex_numbers/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- extras/complex_numbers/Mmakefile	6 Mar 2002 10:10:29 -0000	1.4
+++ extras/complex_numbers/Mmakefile	22 Nov 2002 12:51:15 -0000
@@ -4,6 +4,8 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 -include ../Mmake.params
 
 MAIN_TARGET = all
@@ -12,7 +14,6 @@
 
 depend:	complex_numbers.depend
 
-INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 install: libcomplex_numbers.install
 
 .PHONY: check
Index: extras/concurrency/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/concurrency/Mmakefile,v
retrieving revision 1.5
diff -u -d -r1.5 Mmakefile
--- extras/concurrency/Mmakefile	6 Mar 2002 10:10:29 -0000	1.5
+++ extras/concurrency/Mmakefile	22 Nov 2002 12:51:32 -0000
@@ -4,17 +4,19 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
--include ../Mmake.params
-
-default_target: all
-
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
 TESTS = philo philo2 philo3 midimon
 
+-include ../Mmake.params
+
+default_target: all
+
 depend:		concurrency.depend $(TESTS:%=%.depend)
 all:		libconcurrency tests
 install:	libconcurrency.install
+clean:		concurrency.clean $(TESTS:%=%.clean)
+realclean:	concurrency.realclean $(TESTS:%=%.realclean)
 tests:		$(TESTS)
 
 .PHONY: check
Index: extras/curs/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curs/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- extras/curs/Mmakefile	6 Mar 2002 10:10:29 -0000	1.3
+++ extras/curs/Mmakefile	22 Nov 2002 12:49:01 -0000
@@ -39,10 +39,10 @@
 #
 #EXTRA_LIBRARIES = curs
 
--include ../Mmake.params
-
 # Needed to avoid conflicts with `bool'
 CFLAGS = -DMERCURY_BOOTSTRAP_H
+
+-include ../Mmake.params
 
 MAIN_TARGET = libcurs
 depend: curs.depend
Index: extras/curses/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- extras/curses/Mmakefile	6 Mar 2002 10:10:30 -0000	1.4
+++ extras/curses/Mmakefile	22 Nov 2002 12:51:58 -0000
@@ -4,22 +4,22 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
--include ../Mmake.params
-
 # This is needed to avoid conflicts with `bool'
 CFLAGS = -DMERCURY_BOOTSTRAP_H	
 
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
+# The following definition is correct for Linux.  You may need to change
+# this line to include the appropriate curses library for your OS. 
+MLLIBS = -lncurses
+
+-include ../Mmake.params
+
 default_target:	libmcurses
 
 depend:	mcurses.depend
 
 install: libmcurses.install
-
-# The following definition is correct for Linux.  You may need to change
-# this line to include the appropriate curses library for your OS. 
-MLLIBS = -lncurses
 
 .PHONY: check
 check:
Index: extras/dynamic_linking/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/dynamic_linking/Mmakefile,v
retrieving revision 1.7
diff -u -d -r1.7 Mmakefile
--- extras/dynamic_linking/Mmakefile	6 Mar 2002 10:10:30 -0000	1.7
+++ extras/dynamic_linking/Mmakefile	22 Nov 2002 12:52:10 -0000
@@ -4,8 +4,6 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
--include ../Mmake.params
-
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
 # Use shared libraries, since they're needed for dynamic linking
@@ -18,6 +16,8 @@
 # enable C-level debugging
 CFLAGS = -g
 MLFLAGS += --no-strip
+
+-include ../Mmake.params
 
 main_target: libdl
 depend: dl.depend dl_test.depend dl_test2.depend hello.depend
Index: extras/lazy_evaluation/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/lazy_evaluation/Mmakefile,v
retrieving revision 1.1
diff -u -d -r1.1 Mmakefile
--- extras/lazy_evaluation/Mmakefile	6 Mar 2002 10:10:30 -0000	1.1
+++ extras/lazy_evaluation/Mmakefile	22 Nov 2002 12:52:21 -0000
@@ -4,6 +4,7 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+-include ../Mmake.params
 default_target: all
 depend: lazy_list.depend lazy_list_test.depend
 all: liblazy_list lazy_list_test
Index: extras/logged_output/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/logged_output/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/logged_output/Mmakefile	21 Nov 2000 23:52:29 -0000	1.2
+++ extras/logged_output/Mmakefile	22 Nov 2002 12:53:15 -0000
@@ -4,6 +4,8 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #----------------------------------------------------------------------------#
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 -include ../Mmake.params
 
 MAIN_TARGET=main
Index: extras/moose/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/moose/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- extras/moose/Mmakefile	6 Mar 2002 10:10:30 -0000	1.3
+++ extras/moose/Mmakefile	22 Nov 2002 12:53:42 -0000
@@ -4,8 +4,6 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
--include ../Mmake.params
-
 # GRADE = asm_fast.gc.debug
 # GRADE = asm_fast.gc.prof
 
@@ -13,6 +11,8 @@
 # MCFLAGS = --intermodule-optimization -O6
 
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
+-include ../Mmake.params
 
 .PHONY: default_target
 default_target:	moose
Index: extras/odbc/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/odbc/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- extras/odbc/Mmakefile	21 Nov 2000 23:52:31 -0000	1.4
+++ extras/odbc/Mmakefile	22 Nov 2002 12:54:59 -0000
@@ -4,8 +4,6 @@
 # Public License - see the file COPYING in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
--include ../Mmake.params
-
 # extras/odbc/Mmakefile - Mmake file for building the ODBC interface.
 
 #-----------------------------------------------------------------------------#
@@ -28,6 +26,10 @@
 
 # Pathname for the ODBC SDK (only for MODBC_MS)
 ODBC_SDK_DIR=/odbcsdk
+
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
+-include ../Mmake.params
 
 #-----------------------------------------------------------------------------#
 
Index: extras/posix/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/posix/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- extras/posix/Mmakefile	2 Apr 2002 09:45:31 -0000	1.4
+++ extras/posix/Mmakefile	22 Nov 2002 12:55:42 -0000
@@ -4,9 +4,13 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 -include ../Mmake.params
 
-INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+# The following is needed (on some systems) to enable declarations of
+# Posix functions in standard C header files.
+MGNUCFLAGS = --no-ansi
 
 # This library has some parts that are implemented in C
 # rather than in Mercury.  The following lines ensure that
Index: extras/quickcheck/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/quickcheck/Mmakefile,v
retrieving revision 1.1
diff -u -d -r1.1 Mmakefile
--- extras/quickcheck/Mmakefile	31 Jul 2001 13:47:32 -0000	1.1
+++ extras/quickcheck/Mmakefile	22 Nov 2002 13:12:30 -0000
@@ -4,14 +4,23 @@
 # Public License - see the file COPYING.LIB in the Mercury distribution.
 #-----------------------------------------------------------------------------#
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 -include ../Mmake.params
 
 MAIN_TARGET = all
 
-all:	test_qcheck
+.PHONY: depend
+depend:	qcheck.depend test_qcheck.depend
 
-depend:	test_qcheck.depend
+.PHONY: all
+all:	libqcheck test_qcheck
+
+.PHONY: install
+install: libqcheck.install
 
 .PHONY: check
-check:
-	true
+check:  test_qcheck
+	./test_qcheck
+	@echo "All tests passed"
+
Index: extras/quickcheck/qcheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/quickcheck/qcheck.m,v
retrieving revision 1.2
diff -u -d -r1.2 qcheck.m
--- extras/quickcheck/qcheck.m	31 Jul 2001 13:47:32 -0000	1.2
+++ extras/quickcheck/qcheck.m	22 Nov 2002 13:07:09 -0000
@@ -163,6 +163,11 @@
 	% float, string, string, discriminated union and certain functions.
 	% Details are explained in the tutorials.
 	%
+	% If any test fails, quickcheck will report the failed test,
+	% and call io__set_exit_status(1).
+	% If all tests pass, quickcheck will print a summary of the
+	% tests executed.
+	%
 	% Quickcheck makes the assumption that the distincation between
 	% a function and a discriminated union is that num_functors(FuncType) 
 	% is -1, while num_functors(UnionType) is not -1.
@@ -300,7 +305,7 @@
 		TrivialCount, Distributions, FailedConditionCount),
 	(if 	{ NoFlag = yes }	
 	 then
-	    	{ true }	
+	    	io__set_exit_status(1)
 	 else
 	    	io__write_string("\nTest Description : "),
 	    	io__write_string(Name),
Index: extras/references/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- extras/references/Mmakefile	21 Nov 2000 23:52:32 -0000	1.4
+++ extras/references/Mmakefile	22 Nov 2002 12:31:58 -0000
@@ -10,7 +10,7 @@
 
 # Install in an "extras" subdirectory of the main installation tree
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
-LIBGRADES = asm_fast.tr asm_fast.gc.tr.debug
+LIBGRADES = asm_fast.gc.tr asm_fast.tr asm_fast.gc.tr.debug
 
 MAIN_TARGET = libglobal
 
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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