[m-rev.] diff: fix `--rebuild'

Simon Taylor stayl at cs.mu.OZ.AU
Wed Feb 19 14:15:51 AEDT 2003



Estimated hours taken: 0.25
Branches: main

compiler/handle_options.m:
	Fix a bug which caused `--rebuild' to be disabled.

tests/mmc_make/Mmakefile:
tests/mmc_make/rebuild.m:
	Test case.	

Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.173
diff -u -u -r1.173 handle_options.m
--- compiler/handle_options.m	16 Feb 2003 13:04:36 -0000	1.173
+++ compiler/handle_options.m	19 Feb 2003 02:44:05 -0000
@@ -499,6 +499,18 @@
 	% the interface files were built using `--use-subdirs').
 	option_implies(make, use_subdirs, bool(yes)),
 	option_implies(invoked_by_mmc_make, use_subdirs, bool(yes)),
+	option_implies(invoked_by_mmc_make, make, bool(no)),
+
+	% --make handles creation of the module dependencies itself,
+	% and they don't need to be recreated when compiling to C.
+	option_implies(invoked_by_mmc_make,
+		generate_mmc_make_module_dependencies, bool(no)),
+
+	% --make does not handle --transitive-intermodule-optimization.
+	% --transitive-intermodule-optimization is in the process of
+	% being rewritten anyway.
+	option_implies(make, transitive_optimization, bool(no)),
+	option_implies(invoked_by_mmc_make, transitive_optimization, bool(no)),
 
 	option_implies(verbose_check_termination, check_termination,bool(yes)),
 	option_implies(check_termination, termination, bool(yes)),
@@ -587,18 +599,6 @@
 		"`--no-target-code-only'"),
 
 	option_implies(use_grade_subdirs, use_subdirs, bool(yes)),
-
-	% --make handles creation of the module dependencies itself,
-	% and they don't need to be recreated when compiling to C.
-	option_implies(invoked_by_mmc_make,
-		generate_mmc_make_module_dependencies, bool(no)),
-	option_implies(invoked_by_mmc_make, make, bool(no)),
-	option_implies(invoked_by_mmc_make, rebuild, bool(no)),
-
-	% --make does not handle --transitive-intermodule-optimization.
-	% --transitive-intermodule-optimization is in the process of
-	% being rewritten anyway.
-	option_implies(make, transitive_optimization, bool(no)),
 
 	option_implies(very_verbose, verbose, bool(yes)),
 	option_implies(verbose, verbose_commands, bool(yes)),
Index: tests/mmc_make/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/mmc_make/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- tests/mmc_make/Mmakefile	23 Jan 2003 00:24:17 -0000	1.1
+++ tests/mmc_make/Mmakefile	19 Feb 2003 03:02:38 -0000
@@ -10,7 +10,8 @@
 
 PROGS =	\
 		complex_test \
-		hello
+		hello \
+		rebuild
 
 # These tests only work if the workspace was compiled with `--use-subdirs'.
 ifneq ($(origin WORKSPACE),undefined)
@@ -28,6 +29,12 @@
 
 complex_test.log: install_libs
 
+# Just test that the executable is rebuilt.
+rebuild.runtest:
+	$(MCM) --rebuild rebuild
+	$(MCM) --rebuild --verbose-make rebuild > rebuild.err2 2>&1
+	grep '^Making rebuild$(EXT_FOR_EXE)$$' rebuild.err2
+
 .PHONY: install_libs
 install_libs: start_runtests_local
 	cd lib; \
@@ -35,7 +42,7 @@
 			libcomplex_numbers.install
 
 realclean_local:
-	rm -rf install
+	rm -rf install rebuild.err2
 	cd lib; $(MCM) complex_numbers.realclean
 
 #-----------------------------------------------------------------------------#
Index: tests/mmc_make/rebuild.m
===================================================================
RCS file: tests/mmc_make/rebuild.m
diff -N tests/mmc_make/rebuild.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/mmc_make/rebuild.m	18 Feb 2003 18:39:35 -0000
@@ -0,0 +1,13 @@
+% "Hello World" in Mercury.
+
+% This source file is hereby placed in the public domain.  -fjh (the author).
+
+:- module rebuild.
+:- interface.
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+main --> io__write_string("Hello, world\n").
--------------------------------------------------------------------------
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