[m-rev.] for review: invisible mgnuc options

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri May 20 10:37:03 AEST 2005


For review by anyone.

Zoltan

Reduce the amount of clutter on mgnuc command lines by moving arguments that
are always the same for a given directory into a file that is always consulted
by mgnuc in the current directory.

scripts/mgnuc.in:
	Always include as C compiler arguments the contents of a file named
	.mgnuc_copts in the current directory, if it exists. (It is named
	.mgnuc_copts instead of .mgnuc_opts because it may not contain
	general mgnuc options, such as --no-mercury-stdlib-dir.)

Mmake.workspace:
	Comment out the additions of search paths to CFLAGS.

*/Mmakefile:
	Delete the additions of search paths to CFLAGS.

*/.mgnuc_copts:
	New files containing the directory-specific search paths, and in some
	cases the required macro definitions. These replace what was taken out
	of Mmake.workspace and */Mmakefile. In some cases, the old search paths
	included inappropriate directories; the .mgnuc_copt files don't.

tests/.mgnuc_copts.ws:
	New files containing the directory-specific search paths; bootcheck
	makes tests/.mgnuc_copts from it.

tools/bootcheck:
	Copy the various .mgnuc_copts files from the stage1 to stages 2 and 3.
	They aren't needed in stage3 right now, but that may change.

	Create tests/.mgnuc_copts.

browser/util.m:
	Delete an unused and inappropriate #include.

scripts/Mmake.rules:
	Use a single invocation of mkdir -p to create all subdirectories
	needed by Java. Update a piece of documentation.

scripts/Mmakefile:
	Reorganize the process of invoking config.status to avoid invoking
	it on inappropriate files, and to ensure the right permissions
	on the files it is invoked on.

scripts/prepare_tmp_dir_grade_part:
	Copy the .mgnuc_copts files when populating tmp_dir.

cvs diff: Diffing .
Index: Mmake.workspace
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/Mmake.workspace,v
retrieving revision 1.18
diff -u -r1.18 Mmake.workspace
--- Mmake.workspace	6 May 2005 08:41:59 -0000	1.18
+++ Mmake.workspace	15 May 2005 08:48:02 -0000
@@ -120,21 +120,23 @@
 		$(RUNTIME_DIR)/$(RT_LIB_NAME).init
 MLFLAGS      += --no-mercury-stdlib-dir
 
-#
-# Work out the C include directories.
-#
-C_INCL_DIRS   = -I$(BOEHM_GC_DIR) -I$(BOEHM_GC_DIR)/include -I$(MPS_GC_DIR)
-ifneq ($(LINK_BOEHM_GC_ONLY),yes)
-C_INCL_DIRS  += -I$(RUNTIME_DIR)
-ifneq ($(LINK_RUNTIME_ONLY),yes)
-C_INCL_DIRS  += -I$(LIBRARY_DIR) -I$(LIBRARY_DIR)/$(mihs_subdir)
-ifneq ($(LINK_STDLIB_ONLY),yes)
-C_INCL_DIRS  += -I$(MDBCOMP_DIR) -I$(MDBCOMP_DIR)/$(mihs_subdir) \
-		-I$(BROWSER_DIR) -I$(BROWSER_DIR)/$(mihs_subdir) -I$(TRACE_DIR)
-endif
-endif
-endif
-CFLAGS       += $(C_INCL_DIRS)
+# now in .mgnuc_copts files
+# #
+# # Work out the C include directories.
+# #
+# C_INCL_DIRS   = -I$(BOEHM_GC_DIR) -I$(BOEHM_GC_DIR)/include -I$(MPS_GC_DIR)
+# ifneq ($(LINK_BOEHM_GC_ONLY),yes)
+# C_INCL_DIRS  += -I$(RUNTIME_DIR)
+# ifneq ($(LINK_RUNTIME_ONLY),yes)
+# C_INCL_DIRS  += -I$(LIBRARY_DIR) -I$(LIBRARY_DIR)/$(mihs_subdir)
+# ifneq ($(LINK_STDLIB_ONLY),yes)
+# C_INCL_DIRS  += -I$(MDBCOMP_DIR) -I$(MDBCOMP_DIR)/$(mihs_subdir) \
+# 		-I$(BROWSER_DIR) -I$(BROWSER_DIR)/$(mihs_subdir) -I$(TRACE_DIR)
+# endif
+# endif
+# endif
+# CFLAGS       += $(C_INCL_DIRS)
+
 # now in FLAGS files
 # MCFLAGS    += $(C_INCL_DIRS:-I%=--c-include-directory %)
 
cvs diff: Diffing analysis
Index: analysis/.mgnuc_copts
===================================================================
RCS file: analysis/.mgnuc_copts
diff -N analysis/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ analysis/.mgnuc_copts	17 May 2005 06:01:19 -0000
@@ -0,0 +1,10 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
+-I../trace
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
Index: browser/.mgnuc_copts
===================================================================
RCS file: browser/.mgnuc_copts
diff -N browser/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ browser/.mgnuc_copts	17 May 2005 06:01:24 -0000
@@ -0,0 +1,9 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
Index: browser/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/Mmakefile,v
retrieving revision 1.46
diff -u -r1.46 Mmakefile
--- browser/Mmakefile	6 May 2005 08:42:07 -0000	1.46
+++ browser/Mmakefile	15 May 2005 11:01:10 -0000
@@ -53,9 +53,7 @@
 # Don't change these without good reason - if you want to do a temporary
 # change, change ../Mmake.params, or create Mmake.browser.params.
 
-CFLAGS	     += $(DLL_CFLAGS) \
-		-I$(MDBCOMP_DIR) -I$(MDBCOMP_DIR)/$(mihs_subdir) \
-		-I$(TRACE_DIR)
+CFLAGS	     += $(DLL_CFLAGS)
 ifeq ($(INSTALLABLE_PREFIX),yes)
 MLFLAGS      += -R$(FINAL_INSTALL_MERC_LIB_DIR)	\
 		-R$(FINAL_INSTALL_MERC_GC_LIB_DIR)
Index: browser/util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/util.m,v
retrieving revision 1.27
diff -u -r1.27 util.m
--- browser/util.m	24 Jan 2005 07:41:05 -0000	1.27
+++ browser/util.m	15 May 2005 11:05:25 -0000
@@ -83,7 +83,6 @@
 	#include ""mercury_wrapper.h""
 	#include ""mercury_string.h""
 	#include ""mercury_trace_base.h""
-	#include ""mercury_trace_internal.h""
 	#include ""mercury_library_types.h""
 ").
 
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/.mgnuc_copts
===================================================================
RCS file: compiler/.mgnuc_copts
diff -N compiler/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ compiler/.mgnuc_copts	17 May 2005 06:01:30 -0000
@@ -0,0 +1,12 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
+-I../trace
+-I../analysis
+-I../analysis/Mercury/mihs
Index: compiler/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.84
diff -u -r1.84 Mmakefile
--- compiler/Mmakefile	6 May 2005 08:42:09 -0000	1.84
+++ compiler/Mmakefile	15 May 2005 11:16:56 -0000
@@ -49,7 +49,6 @@
 	cd $(GCC_SRC_DIR)/gcc && $(MAKE) mercury_gcc_backend_libs
 
 MCFLAGS	     += --flags COMP_FLAGS $(CONFIG_OVERRIDE)
-CFLAGS       += -I$(ANALYSIS_DIR) -I$(ANALYSIS_DIR)/$(mihs_subdir)
 MLOBJS       := ../main.$O ../analysis/lib$(ANALYSIS_LIB_NAME).$A $(MLOBJS)
 ALL_MLLIBS    = $(MLLIBS) $(EXTRA_MLLIBS) $(GCC_BACKEND_LIBS)
 MLFLAGS      += --no-main --shared
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
Index: deep_profiler/.mgnuc_copts
===================================================================
RCS file: deep_profiler/.mgnuc_copts
diff -N deep_profiler/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ deep_profiler/.mgnuc_copts	17 May 2005 06:01:36 -0000
@@ -0,0 +1,12 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
+-I../trace
+-I../analysis
+-I../analysis/Mercury/mihs
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/.mgnuc_copts
===================================================================
RCS file: library/.mgnuc_copts
diff -N library/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/.mgnuc_copts	17 May 2005 06:01:39 -0000
@@ -0,0 +1,7 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../trace
+-I../robdd
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.142
diff -u -r1.142 Mmakefile
--- library/Mmakefile	6 May 2005 08:42:14 -0000	1.142
+++ library/Mmakefile	15 May 2005 10:44:14 -0000
@@ -97,7 +97,7 @@
 
 #-----------------------------------------------------------------------------#
 
-CFLAGS	     += $(DLL_CFLAGS) -I$(TRACE_DIR) -I$(ROBDD_DIR)
+CFLAGS	     += $(DLL_CFLAGS)
 ifeq ($(INSTALLABLE_PREFIX),yes)
 MLFLAGS      += -R$(FINAL_INSTALL_MERC_LIB_DIR) \
 		-R$(FINAL_INSTALL_MERC_GC_LIB_DIR)
Index: library/io.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.329
diff -u -r1.329 io.m
--- library/io.m	18 May 2005 05:25:58 -0000	1.329
+++ library/io.m	20 May 2005 00:22:20 -0000
@@ -3692,6 +3692,17 @@
 #endif
 ").
 
+	% Chunk_size gives the maximum number of recursive calls we want to
+	% allow in the binary_input_stream_foldl*_inner predicates. Without
+	% such a limit, the depth of recursion, which depends on the size of
+	% the file they read, will cause exhaustion of the det stack in debug
+	% grades, since there is no tail recursion in such grades.
+	%
+	% With this arrangement, the maximum number of stack frames needed
+	% to process a file of size N is N/1000 + 1000, the former being the
+	% number of frames of binary_input_stream_foldl*_chunk predicates,
+	% the latter being the max number of frames of the *_inner predicates.
+	%
 :- func chunk_size = int.
 
 chunk_size = 1000.
cvs diff: Diffing mdbcomp
Index: mdbcomp/.mgnuc_copts
===================================================================
RCS file: mdbcomp/.mgnuc_copts
diff -N mdbcomp/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mdbcomp/.mgnuc_copts	17 May 2005 06:01:03 -0000
@@ -0,0 +1,8 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../trace
Index: mdbcomp/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/Mmakefile,v
retrieving revision 1.7
diff -u -r1.7 Mmakefile
--- mdbcomp/Mmakefile	6 May 2005 08:42:17 -0000	1.7
+++ mdbcomp/Mmakefile	17 May 2005 06:00:15 -0000
@@ -43,7 +43,7 @@
 # Don't change these without good reason - if you want to do a temporary
 # change, change ../Mmake.params, or create Mmake.mdbcomp.params.
 
-CFLAGS	     += $(DLL_CFLAGS) -I$(TRACE_DIR)
+CFLAGS	     += $(DLL_CFLAGS)
 MCFLAGS      += --flags MDBCOMP_FLAGS $(CONFIG_OVERRIDE)
 ifeq ($(INSTALLABLE_PREFIX),yes)
 MLFLAGS      += -R$(FINAL_INSTALL_MERC_LIB_DIR)	\
cvs diff: Diffing profiler
Index: profiler/.mgnuc_copts
===================================================================
RCS file: profiler/.mgnuc_copts
diff -N profiler/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ profiler/.mgnuc_copts	17 May 2005 06:01:54 -0000
@@ -0,0 +1,10 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
+-I../trace
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/.mgnuc_copts
===================================================================
RCS file: runtime/.mgnuc_copts
diff -N runtime/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ runtime/.mgnuc_copts	15 May 2005 10:49:31 -0000
@@ -0,0 +1,4 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-DMERCURY_BOOTSTRAP_H
+-DMERCURY_CONF_BOOTSTRAP_H
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.122
diff -u -r1.122 Mmakefile
--- runtime/Mmakefile	9 May 2005 08:05:02 -0000	1.122
+++ runtime/Mmakefile	15 May 2005 10:49:44 -0000
@@ -210,7 +210,7 @@
 
 #-----------------------------------------------------------------------------#
 
-CFLAGS	+= $(DLL_CFLAGS) -DMERCURY_BOOTSTRAP_H -DMERCURY_CONF_BOOTSTRAP_H
+CFLAGS	+= $(DLL_CFLAGS)
 
 # We intentionally compile with C level debugging enabled so that problems
 # in the runtime can be debugged without having to recompile it.  The cost
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.147
diff -u -r1.147 Mmake.rules
--- scripts/Mmake.rules	28 Jan 2005 07:11:58 -0000	1.147
+++ scripts/Mmake.rules	15 May 2005 09:15:52 -0000
@@ -81,43 +81,51 @@
 
 ifneq ($(MMAKE_USE_MMC_MAKE),yes)
 
-# beware the code for `%.depend' and `%.dep'/`%.dv' is duplicated
+# Beware the code for `%.depend' and `%.dep'/`%.dv' is duplicated,
+# with each copy having two variants that differ only by a @.
+# javac doesn't create the destination directory for class files
+# so we must create it manually
+# the following mkdirs work around a bug in GNU Make
 $(deps_subdir)%.dep $(deps_subdir)%.dv:
 	$(MCD) $(ALL_GRADEFLAGS) $(ALL_MCDFLAGS) $*
 ifeq ($(MMAKE_USE_SUBDIRS),yes)
-	# javac doesn't create the destination directory for class files
-	# so we must create it manually
-	-[ -d $(classes_subdir) ] || mkdir $(classes_subdir)
-	# the following mkdirs work around a bug in GNU Make
-	-[ -d Mercury/dates ] || mkdir Mercury/dates
-	-[ -d Mercury/date0s ] || mkdir Mercury/date0s
-	-[ -d Mercury/date3s ] || mkdir Mercury/date3s
-	-[ -d Mercury/optdates ] || mkdir Mercury/optdates
-	-[ -d Mercury/trans_opt_dates ] || mkdir Mercury/trans_opt_dates
-	-[ -d Mercury/c_dates ] || mkdir Mercury/c_dates
-	-[ -d Mercury/il_dates ] || mkdir Mercury/il_dates
-	-[ -d Mercury/s_dates ] || mkdir Mercury/s_dates
-	-[ -d Mercury/pic_s_dates ] || mkdir Mercury/pic_s_dates
+ifeq ($(MMAKE_USE_SUBDIRS_EXPLICIT),yes)
+	-mkdir -p $(classes_subdir) \
+		Mercury/dates Mercury/date0s Mercury/date3s \
+		Mercury/optdates Mercury/trans_opt_dates \
+		Mercury/c_dates Mercury/il_dates \
+		Mercury/s_dates Mercury/pic_s_dates
+else
+	@-mkdir -p $(classes_subdir) \
+		Mercury/dates Mercury/date0s Mercury/date3s \
+		Mercury/optdates Mercury/trans_opt_dates \
+		Mercury/c_dates Mercury/il_dates \
+		Mercury/s_dates Mercury/pic_s_dates
+endif
 endif
 
-# beware the code for `%.depend' and `%.dep'/`%.dv' is duplicated
+# Beware the code for `%.depend' and `%.dep'/`%.dv' is duplicated,
+# with each copy having two variants that differ only by a @.
+# javac doesn't create the destination directory for class files
+# so we must create it manually
+# the following mkdirs work around a bug in GNU Make
 .PHONY: %.depend
 %.depend :
 	$(MCD) $(ALL_GRADEFLAGS) $(ALL_MCDFLAGS) $*
 ifeq ($(MMAKE_USE_SUBDIRS),yes)
-	# javac doesn't create the destination directory for class files
-	# so we must create it manually
-	-[ -d $(classes_subdir) ] || mkdir $(classes_subdir)
-	# the following mkdirs work around a bug in GNU Make
-	-[ -d Mercury/dates ] || mkdir Mercury/dates
-	-[ -d Mercury/date0s ] || mkdir Mercury/date0s
-	-[ -d Mercury/date3s ] || mkdir Mercury/date3s
-	-[ -d Mercury/optdates ] || mkdir Mercury/optdates
-	-[ -d Mercury/trans_opt_dates ] || mkdir Mercury/trans_opt_dates
-	-[ -d Mercury/c_dates ] || mkdir Mercury/c_dates
-	-[ -d Mercury/il_dates ] || mkdir Mercury/il_dates
-	-[ -d Mercury/s_dates ] || mkdir Mercury/s_dates
-	-[ -d Mercury/pic_s_dates ] || mkdir Mercury/pic_s_dates
+ifeq ($(MMAKE_USE_SUBDIRS_EXPLICIT),yes)
+	-mkdir -p $(classes_subdir) \
+		Mercury/dates Mercury/date0s Mercury/date3s \
+		Mercury/optdates Mercury/trans_opt_dates \
+		Mercury/c_dates Mercury/il_dates \
+		Mercury/s_dates Mercury/pic_s_dates
+else
+	@-mkdir -p $(classes_subdir) \
+		Mercury/dates Mercury/date0s Mercury/date3s \
+		Mercury/optdates Mercury/trans_opt_dates \
+		Mercury/c_dates Mercury/il_dates \
+		Mercury/s_dates Mercury/pic_s_dates
+endif
 endif
 
 endif	# MMAKE_USE_MMC_MAKE != yes
@@ -273,7 +281,7 @@
 # These rules are only available in *il* backends, because we'd like to avoid
 # processing user code that is in a .cpp file, and we'd like to avoid going via
 # IL to generate a DLL if we are in a non-IL grade.
-ifeq ($(findstring il,$(GRADE)),il)        
+ifeq ($(findstring il,$(GRADE)),il)
 
 # Note that we use `-' rather than `/' as the option character for options
 # to $(MS_CL), to avoid confusion with Unix-style path names.
@@ -301,6 +309,10 @@
 # the new .err file is also of size zero,
 # the time-stamp doesn't get updated!
 # (Is that a bug in unix? In bash?)
+# zs: It is neither. The timestamp is updated by the write system call:
+# if the new file is of zero size, write is never called.
+# touch has code to test specifically for this situation,
+# and adds a byte to the file and then removes it.
 
 .m.err:
 	$(MCE) $(ALL_GRADEFLAGS) $(ALL_MCFLAGS) $(*F) $(ERR_REDIRECT)
@@ -379,13 +391,13 @@
 # we only activate these rules when in an IL grade.
 #
 
-ifeq ($(findstring il,$(GRADE)),il)        
+ifeq ($(findstring il,$(GRADE)),il)
 
 .il.dll:
 	$(MS_ILASM) $(ALL_MS_ILASMFLAGS) /dll /quiet /OUT=$@ $<
 
 .il.exe:
-	$(MS_ILASM) $(ALL_MS_ILASMFLAGS) /quiet /OUT=$@ $< 
+	$(MS_ILASM) $(ALL_MS_ILASMFLAGS) /quiet /OUT=$@ $<
 
 .cpp.dll:
 	$(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
Index: scripts/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mmakefile,v
retrieving revision 1.36
diff -u -r1.36 Mmakefile
--- scripts/Mmakefile	9 May 2005 08:10:22 -0000	1.36
+++ scripts/Mmakefile	18 May 2005 06:04:18 -0000
@@ -14,26 +14,63 @@
 
 #-----------------------------------------------------------------------------#
 
-SCRIPTS = mmake mmc mdb mtc c2init mgnuc ml mprof mprof_merge_runs \
-	  mtags vpath_find mercury_update_interface \
-	  mkfifo_using_mknod mercury_cleanup_install canonical_grade \
-	  mercury_config mercury.bat prepare_tmp_dir_fixed_part
-DEBUGGER_SCRIPTS = mdbrc xul_tree.xsl
+NONCONF_SCRIPTS = \
+	mercury_cleanup_install \
+	mprof_merge_runs \
+	mtags \
+	mtc \
+	vpath_find
+
+CONF_SCRIPTS = \
+	c2init \
+	canonical_grade \
+	mdb \
+	mdprof \
+	mercury.bat \
+	mercury_config \
+	mercury_update_interface \
+	mgnuc \
+	mkfifo_using_mknod \
+	ml \
+	mmake \
+	mmc \
+	mprof \
+	prepare_tmp_dir_fixed_part
+
+SCRIPTS = $(NONCONF_SCRIPTS) $(CONF_SCRIPTS)
+
+CONF_FILES = \
+	Mercury.config.bootstrap \
+	Mercury.config \
+	Mmake.vars \
+	parse_ml_options.sh-subr
+
+CONF_DEBUG_SCIRPTS = \
+	mdbrc.in
+
+DEBUGGER_SCRIPTS = $(CONF_DEBUG_SCIRPTS) xul_tree.xsl
 EMACS_SCRIPTS = gud.el
 
 #-----------------------------------------------------------------------------#
 
-# ensure there were no mispelt autoconf variable names \
-
 # .SUFFIXES: .in
 
-# we test membership of SCRIPTS, because testing $(@D) (the directory part
-# of $*) does the wrong thing for Mercury.config. Not testing anything would
-# make this rule apply even to ../Mmake.common.
+# we test membership of CONF_SCRIPTS and CONF_FILES, because testing $(@D)
+# (the directory part of $*) does the wrong thing for Mercury.config.
+# Not testing anything would make this rule apply even to ../Mmake.common.
+# The grep is there to ensure that there were no mispelt autoconf variable
+# names.
 
 %::	%.in $(MERCURY_DIR)/config.status
-	@for script in $(SCRIPTS) ; do \
-		if test "$*" = "$$script" ; then \
+	@for file in $(CONF_SCRIPTS) ; do \
+		if test "$*" = "$$file" ; then \
+		$(MERCURY_DIR)/config.status --file=$* ; \
+		if grep -n '[^$$]@' $@; then false; else true; fi ; \
+		chmod a+x $* ; \
+		fi \
+	done
+	@for file in $(CONF_FILES) ; do \
+		if test "$*" = "$$file" ; then \
 		$(MERCURY_DIR)/config.status --file=$* ; \
 		if grep -n '[^$$]@' $@; then false; else true; fi \
 		fi \
@@ -42,8 +79,7 @@
 #-----------------------------------------------------------------------------#
 
 .PHONY: all
-all: $(SCRIPTS) $(DEBUGGER_SCRIPTS) $(EMACS_SCRIPTS)
-all: Mmake.vars Mercury.config Mercury.config.bootstrap
+all: $(CONF_FILES) $(SCRIPTS) $(DEBUGGER_SCRIPTS) $(EMACS_SCRIPTS)
 
 #-----------------------------------------------------------------------------#
 
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.106
diff -u -r1.106 mgnuc.in
--- scripts/mgnuc.in	6 May 2005 08:42:25 -0000	1.106
+++ scripts/mgnuc.in	15 May 2005 08:39:56 -0000
@@ -589,9 +589,9 @@
 	exec $AS $AS_OPTS "$@" ;;
 esac
 
-if test -r .mgnuc_opts
+if test -r .mgnuc_copts
 then
-	INVISIBLE_OPTS=`cat .mgnuc_opts`
+	INVISIBLE_OPTS=`cat .mgnuc_copts`
 else
 	INVISIBLE_OPTS=""
 fi
Index: scripts/prepare_tmp_dir_grade_part
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/prepare_tmp_dir_grade_part,v
retrieving revision 1.2
diff -u -r1.2 prepare_tmp_dir_grade_part
--- scripts/prepare_tmp_dir_grade_part	6 May 2005 08:42:25 -0000	1.2
+++ scripts/prepare_tmp_dir_grade_part	18 May 2005 09:19:31 -0000
@@ -27,16 +27,19 @@
 mkdir tmp_dir/runtime
 mkdir tmp_dir/runtime/machdeps
 cp runtime/Mmake* tmp_dir/runtime
+cp runtime/.mgnuc* tmp_dir/runtime
 cp runtime/*.in tmp_dir/runtime
 cp runtime/*.[ch] tmp_dir/runtime
 cp runtime/*.il tmp_dir/runtime
 cp runtime/machdeps/*.h tmp_dir/runtime/machdeps
 mkdir tmp_dir/trace
 cp trace/Mmake* tmp_dir/trace
+cp trace/.mgnuc* tmp_dir/trace
 cp trace/*.[ch] tmp_dir/trace
 mkdir tmp_dir/library
 cp library/Mmake* tmp_dir/library
 cp library/Mercury.* tmp_dir/library
+cp library/.mgnuc* tmp_dir/library
 cp library/*FLAGS* tmp_dir/library
 cp library/print_extra_inits tmp_dir/library
 cp library/library_strong_name.sn tmp_dir/library
@@ -44,11 +47,13 @@
 mkdir tmp_dir/mdbcomp
 cp mdbcomp/Mmake* tmp_dir/mdbcomp
 cp mdbcomp/Mercury.* tmp_dir/mdbcomp
+cp mdbcomp/.mgnuc* tmp_dir/mdbcomp
 cp mdbcomp/*FLAGS* tmp_dir/mdbcomp
 cp mdbcomp/*.m tmp_dir/mdbcomp
 mkdir tmp_dir/browser
 cp browser/Mmake* tmp_dir/browser
 cp browser/Mercury.* tmp_dir/browser
+cp browser/.mgnuc* tmp_dir/browser
 cp browser/*FLAGS* tmp_dir/browser
 cp browser/*.m tmp_dir/browser
 exit 0
cvs diff: Diffing slice
Index: slice/.mgnuc_copts
===================================================================
RCS file: slice/.mgnuc_copts
diff -N slice/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ slice/.mgnuc_copts	17 May 2005 06:02:05 -0000
@@ -0,0 +1,10 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
+-I../trace
cvs diff: Diffing tests
Index: tests/.mgnuc_copts.ws
===================================================================
RCS file: tests/.mgnuc_copts.ws
diff -N tests/.mgnuc_copts.ws
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/.mgnuc_copts.ws	17 May 2005 06:02:26 -0000
@@ -0,0 +1,10 @@
+-I at WORKSPACE@/boehm_gc
+-I at WORKSPACE@/boehm_gc/include
+-I at WORKSPACE@/runtime
+-I at WORKSPACE@/library
+-I at WORKSPACE@/library/Mercury/mihs
+-I at WORKSPACE@/mdbcomp
+-I at WORKSPACE@/mdbcomp/Mercury/mihs
+-I at WORKSPACE@/browser
+-I at WORKSPACE@/browser/Mercury/mihs
+-I at WORKSPACE@/trace
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
Index: tools/bootcheck
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.171
diff -u -r1.171 bootcheck
--- tools/bootcheck	6 May 2005 08:42:37 -0000	1.171
+++ tools/bootcheck	16 May 2005 13:09:52 -0000
@@ -624,6 +624,7 @@
 
         cp $root/compiler/Mmake* $root/compiler/Mercury.options .
         cp $root/compiler/*_FLAGS.in .
+        cp $root/compiler/.mgnu* .
         cd $root/$stage2dir
         mkdir library
         cd library
@@ -635,6 +636,7 @@
         cp $root/library/Mmake* $root/library/Mercury.options .
         cp $root/library/*_FLAGS.in .
         cp $root/library/INTER_FLAGS .
+        cp $root/library/.mgnu* .
         $LN_S $root/library/$STD_LIB_NAME.init .
         $LN_S $root/library/RESERVED_MACRO_NAMES .
         cd $root/$stage2dir
@@ -643,6 +645,7 @@
         $LN_S $root/mdbcomp/*.m .
         cp $root/mdbcomp/Mmake* $root/mdbcomp/Mercury.options .
         cp $root/mdbcomp/*_FLAGS.in .
+        cp $root/mdbcomp/.mgnu* .
         $LN_S $root/mdbcomp/$MDCOMP_LIB_NAME.init .
         $LN_S $root/mdbcomp/RESERVED_MACRO_NAMES .
         cd $root/$stage2dir
@@ -651,6 +654,7 @@
         $LN_S $root/browser/*.m .
         cp $root/browser/Mmake* $root/browser/Mercury.options .
         cp $root/browser/*_FLAGS.in .
+        cp $root/browser/.mgnu* .
         $LN_S $root/browser/$BROWSER_LIB_NAME.init .
         $LN_S $root/browser/RESERVED_MACRO_NAMES .
         cd $root/$stage2dir
@@ -659,6 +663,7 @@
         $LN_S $root/analysis/*.m .
         cp $root/analysis/Mmake* $root/analysis/Mercury.options .
         cp $root/analysis/*_FLAGS.in .
+        cp $root/analysis/.mgnu* .
         $LN_S $root/analysis/$ANALYSIS_LIB_NAME.init .
 
         cd $root/$stage2dir
@@ -683,6 +688,7 @@
             $LN $root/runtime/mercury_il.il .
             $LN_S $root/runtime/*.in .
             cp $root/runtime/Mmake* .
+            cp $root/runtime/.mgnu* .
             $LN_S $root/runtime/machdeps .
             $LN_S $root/runtime/RESERVED_MACRO_NAMES .
             cd $root/$stage2dir
@@ -692,6 +698,7 @@
             $LN_S $root/trace/*.h .
             $LN_S $root/trace/*.c .
             cp $root/trace/Mmake* .
+            cp $root/trace/.mgnu* .
             $LN_S $root/trace/RESERVED_MACRO_NAMES .
             cd $root/$stage2dir
             rm -f robdd
@@ -742,12 +749,14 @@
             $LN_S $root/slice/*.m .
             cp $root/slice/Mmake* $root/slice/Mercury.options .
             cp $root/slice/*_FLAGS.in .
+            cp $root/slice/.mgnu* .
             cd $root/$stage2dir
             mkdir profiler
             cd profiler
             $LN_S $root/profiler/*.m .
             cp $root/profiler/Mmake* $root/profiler/Mercury.options .
             cp $root/profiler/*_FLAGS.in .
+            cp $root/profiler/.mgnu* .
             cd $root/$stage2dir
             mkdir deep_profiler
             cd deep_profiler
@@ -755,6 +764,7 @@
             cp $root/deep_profiler/Mmake* .
             cp $root/deep_profiler/Mercury.options .
             cp $root/deep_profiler/*_FLAGS.in .
+            cp $root/deep_profiler/.mgnu* .
             cd $root/$stage2dir
         else
             $LN_S $root/slice .
@@ -1051,6 +1061,7 @@
 
     cp $root/compiler/Mmake* $root/compiler/Mercury.options .
     cp $root/compiler/*_FLAGS.in .
+    cp $root/compiler/.mgnu* .
     cd $root/$stage3dir
     mkdir library
     cd library
@@ -1061,6 +1072,7 @@
     cp $root/library/Mmake* $root/library/Mercury.options .
     cp $root/library/*_FLAGS.in .
     cp $root/library/INTER_FLAGS .
+    cp $root/library/.mgnu* .
     $LN_S $root/library/$STD_LIB_NAME.init .
     cd $root/$stage3dir
     mkdir mdbcomp
@@ -1068,6 +1080,7 @@
     $LN_S $root/mdbcomp/*.m .
     cp $root/mdbcomp/Mmake* $root/mdbcomp/Mercury.options .
     cp $root/mdbcomp/*_FLAGS.in .
+    cp $root/mdbcomp/.mgnu* .
     $LN_S $root/mdbcomp/$MDBCOMP_LIB_NAME.init .
     cd $root/$stage3dir
     mkdir browser
@@ -1075,6 +1088,7 @@
     $LN_S $root/browser/*.m .
     cp $root/browser/Mmake* $root/browser/Mercury.options .
     cp $root/browser/*_FLAGS.in .
+    cp $root/browser/.mgnu* .
     $LN_S $root/browser/$BROWSER_LIB_NAME.init .
     cd $root/$stage3dir
     mkdir analysis
@@ -1082,6 +1096,7 @@
     $LN_S $root/analysis/*.m .
     cp $root/analysis/Mmake* $root/analysis/Mercury.options .
     cp $root/analysis/*_FLAGS.in .
+    cp $root/analysis/.mgnu* .
     $LN_S $root/analysis/$ANALYSIS_LIB_NAME.init .
     cd $root/$stage3dir
     $LN_S $root/$stage2dir/boehm_gc .
@@ -1441,6 +1456,40 @@
         sed -e "s:@WORKSPACE@:$WORKSPACE:" \
             < ${tests_prefix}tests/WS_FLAGS.ws \
             > ${tests_prefix}tests/WS_FLAGS
+
+        sed -e "s:@WORKSPACE@:$WORKSPACE:" \
+            < ${tests_prefix}tests/.mgnuc_copts.ws \
+            > ${tests_prefix}tests/.mgnuc_copts
+
+        all_test_dirs="
+            benchmarks
+            debugger
+            debugger/declarative
+            dppd
+            general
+            general/accumulator
+            general/string_format
+            general/structure_reuse
+            grade_subdirs
+            hard_coded
+            hard_coded/exceptions
+            hard_coded/purity
+            hard_coded/sub-modules
+            hard_coded/typeclasses
+            invalid
+            invalid/purity
+            misc_tests
+            mmc_make
+            recompilation
+            tabling
+            term
+            valid
+            warnings"
+
+        for d in $all_test_dirs
+        do
+            cp ${tests_prefix}tests/.mgnuc_copts ${tests_prefix}tests/$d
+        done
 
         WORKSPACE_FLAGS=yes
         export WORKSPACE_FLAGS
cvs diff: Diffing trace
Index: trace/.mgnuc_copts
===================================================================
RCS file: trace/.mgnuc_copts
diff -N trace/.mgnuc_copts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ trace/.mgnuc_copts	17 May 2005 06:02:36 -0000
@@ -0,0 +1,11 @@
+-I../boehm_gc
+-I../boehm_gc/include
+-I../runtime
+-I../library
+-I../library/Mercury/mihs
+-I../mdbcomp
+-I../mdbcomp/Mercury/mihs
+-I../browser
+-I../browser/Mercury/mihs
+-DMR_NO_BACKWARDS_COMPAT
+-DMERCURY_CONF_BOOTSTRAP_H
Index: trace/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/Mmakefile,v
retrieving revision 1.42
diff -u -r1.42 Mmakefile
--- trace/Mmakefile	28 Jan 2005 07:12:05 -0000	1.42
+++ trace/Mmakefile	15 May 2005 10:48:58 -0000
@@ -86,8 +86,7 @@
 
 #-----------------------------------------------------------------------------#
 
-CFLAGS		+= -I$(BROWSER_DIR) -I$(MDBCOMP_DIR) -g $(DLL_CFLAGS) \
-			-DMR_NO_BACKWARDS_COMPAT -DMERCURY_CONF_BOOTSTRAP_H
+CFLAGS		+= -g $(DLL_CFLAGS)
 MGNUCFLAGS	+= --no-ansi
 
 #-----------------------------------------------------------------------------#
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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