diff: mmake support for `.trans_opt' etc.

Fergus Henderson fjh at cs.mu.oz.au
Sat Jan 10 20:07:46 AEDT 1998


Estimated hours taken: 2

Add Mmake support for `.trans_opt' files.
Also fix up the handling of profiling files for `mmake clean'.

compiler/modules.m:
compiler/trans_opt.m:
	Rename `.trans_optdate' as `.trans_opt_date'.

compiler/modules.m:
	Output definitions for $(foo.profs), $(foo.trans_opts), and
	$(foo.trans_opt_dates) variables in the generated `.dep' files.
	Add code to the generated rules for `mmake clean' to remove
	these files.

scripts/Mmake.rules:
	Add rules for creating `.trans_opt' and `.trans_opt_date' files.
	Change things so that `Prof.*' get removed by `mmake clean'
	rather than only by `mmake realclean'.

scripts/Mmake.vars.in:
	Add MCTOI and MCTOIFLAGS variable, for creating `.trans_opt' files.

cvs diff  compiler/modules.m compiler/trans_opt.m scripts/Mmake.rules scripts/Mmake.vars.in
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.47
diff -u -r1.47 modules.m
--- modules.m	1998/01/06 23:50:58	1.47
+++ modules.m	1998/01/10 09:02:44
@@ -492,7 +492,7 @@
 			{ set__to_sorted_list(TransOptDepsSet, 
 				TransOptDateDeps) },
 			io__write_strings(DepStream,
-				[ModuleName, ".trans_optdate : "]),
+				[ModuleName, ".trans_opt_date : "]),
 			write_dependencies_list(TransOptDateDeps, ".trans_opt", 
 				DepStream)
 		;
@@ -533,7 +533,7 @@
 
 
 		io__write_strings(DepStream, ["\n\n",
-			ModuleName, ".trans_optdate ",
+			ModuleName, ".trans_opt_date ",
 			ModuleName, ".optdate ",
 			ModuleName, ".c ",
 			ModuleName, ".err ",
@@ -562,7 +562,7 @@
 			io__write_strings(DepStream, [
 				"\n\n", 
 				ModuleName, ".c ",
-				ModuleName, ".trans_optdate ",
+				ModuleName, ".trans_opt_date ",
 				ModuleName, ".err ", 
 				ModuleName, ".o :"
 			]),
@@ -638,7 +638,7 @@
 		io__open_input(DependencyFileName, OpenResult),
 		( { OpenResult = ok(Stream) } ->
 			io__set_input_stream(Stream, OldStream),
-			{ string__append(ModuleName, ".trans_optdate", 
+			{ string__append(ModuleName, ".trans_opt_date", 
 				TransOptFileName0) },
 			{ string__to_char_list(TransOptFileName0, 
 				TransOptFileName) },
@@ -1072,6 +1072,12 @@
 	io__write_string(DepStream, "\n"),
 
 	io__write_string(DepStream, ModuleName),
+	io__write_string(DepStream, ".trans_opt_dates = "),
+	write_compact_dependencies_list(Modules, ".trans_opt_date", Basis,
+								DepStream),
+	io__write_string(DepStream, "\n"),
+
+	io__write_string(DepStream, ModuleName),
 	io__write_string(DepStream, ".ds = "),
 	write_compact_dependencies_list(Modules, ".d", Basis, DepStream),
 	io__write_string(DepStream, "\n"),
@@ -1096,6 +1102,17 @@
 	io__write_string(DepStream, ModuleName),
 	io__write_string(DepStream, ".opts = "),
 	write_compact_dependencies_list(Modules, ".opt", Basis, DepStream),
+	io__write_string(DepStream, "\n"),
+
+	io__write_string(DepStream, ModuleName),
+	io__write_string(DepStream, ".trans_opts = "),
+	write_compact_dependencies_list(Modules, ".trans_opt", Basis,
+								DepStream),
+	io__write_string(DepStream, "\n"),
+
+	io__write_string(DepStream, ModuleName),
+	io__write_string(DepStream, ".profs = "),
+	write_compact_dependencies_list(Modules, ".prof", Basis, DepStream),
 	io__write_string(DepStream, "\n\n"),
 
 	io__write_strings(DepStream, [
@@ -1199,6 +1216,9 @@
 		"\t-rm -f $(", ModuleName, ".cs) ", ModuleName, "_init.c\n",
 		"\t-rm -f $(", ModuleName, ".ss) ", ModuleName, "_init.s\n",
 		"\t-rm -f $(", ModuleName, ".os) ", ModuleName, "_init.o\n",
+		"\t-rm -f $(", ModuleName, ".trans_opt_dates)\n",
+		"\t-rm -f $(", ModuleName, ".trans_opts)\n",
+		"\t-rm -f $(", ModuleName, ".profs)\n",
 		"\t-rm -f $(", ModuleName, ".nos)\n",
 		"\t-rm -f $(", ModuleName, ".qls)\n",
 		"\t-rm -f $(", ModuleName, ".errs)\n"
Index: compiler/trans_opt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.4
diff -u -r1.4 trans_opt.m
--- trans_opt.m	1998/01/06 23:51:06	1.4
+++ trans_opt.m	1998/01/10 08:43:02
@@ -120,7 +120,7 @@
 
 		{ string__append(ModuleName, ".trans_opt", OptName) },
 		update_interface(OptName),
-		touch_interface_datestamp(ModuleName, ".trans_optdate")
+		touch_interface_datestamp(ModuleName, ".trans_opt_date")
 	).
 	
 :- pred trans_opt__write_preds(list(pred_id), module_info, 
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.46
diff -u -r1.46 Mmake.rules
--- Mmake.rules	1997/11/21 12:34:19	1.46
+++ Mmake.rules	1998/01/10 08:47:26
@@ -11,12 +11,15 @@
 #-----------------------------------------------------------------------------#
 
 # Beware that the order of suffixes is significant.
-.SUFFIXES: .m .nl .no .err .int .int2 .int3 .opt .dep .depend .doit \
-		.ugly .date .date3 .optdate .c .nu .o .pic_o \
+.SUFFIXES: .m .nl .no .err \
+		.int .int2 .int3 .opt .trans_opt \
+		.dep .depend .doit .ugly \
+		.date .date3 .optdate .trans_opt_date \
+		.c .nu .o .pic_o \
 		.i .s .pic_s \
 		.ql .pl
 
-.PRECIOUS: %.date %.date3 %.optdate
+.PRECIOUS: %.date %.date3 %.optdate %.trans_opt_date
 
 # All the builtin rules must use $@ as the target, so that they work
 # when $(VPATH) is set.
@@ -58,6 +61,9 @@
 .m.optdate:
 	$(MCOI) $(MCOIFLAGS) $<
 
+.m.trans_opt_date:
+	$(MCTOI) $(MCTOIFLAGS) $<
+
 # Be very careful about changing the following rules.
 # The `@:' is a silent do-nothing command.
 # It is used to force GNU Make to recheck the timestamp
@@ -76,6 +82,9 @@
 .optdate.opt:
 	@:
 
+.trans_opt_date.trans_opt:
+	@:
+
 .m.ugly:
 	$(MC) --convert-to-mercury $(MCFLAGS) $<
 
@@ -136,10 +145,11 @@
 
 .PHONY: clean realclean clean_nu clean_sicstus
 
-realclean: clean clean_prof_files
+realclean: clean
+
+clean: clean_prof_files
 
 clean_prof_files:
-	-rm -f Prof.CallPair Prof.Counts Prof.Decl
-	-rm -f *.prof
+	-rm -f Prof.CallPair Prof.Counts Prof.Decl Prof.MemWords Prof.MemCells
 
 #-----------------------------------------------------------------------------#
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.12
diff -u -r1.12 Mmake.vars.in
--- Mmake.vars.in	1997/11/21 08:08:32	1.12
+++ Mmake.vars.in	1998/01/06 02:35:43
@@ -34,10 +34,12 @@
 MCI		= $(MC) --make-interface
 MCSI		= $(MC) --make-short-interface
 MCOI		= $(MC) --make-optimization-interface
+MCTOI		= $(MC) --make-transitive-optimization-interface
 MCFLAGS		= $(EXTRA_MCFLAGS)
 MCIFLAGS	= $(MCFLAGS)
 MCSIFLAGS	= $(MCFLAGS)
 MCOIFLAGS	= $(MCFLAGS)
+MCTOIFLAGS	= $(MCFLAGS)
 MCDFLAGS	= $(MCFLAGS)
 MCGFLAGS	= $(MCFLAGS)
 MCSFLAGS	= $(MCFLAGS)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list