[m-dev.] For review: Clean-up of clean targets

Warwick Harvey wharvey at cs.monash.edu.au
Wed Aug 18 12:57:10 AEST 1999


For Fergus I suppose.  :-)


Estimated hours taken: 3

Reconciled the implementation and the documentation of the automatically
generated clean targets.  Also removed the `change_clean' targets to
simplify things, since they're not particularly useful.

`clean' now no longer deletes transitive optimization files, and should be
suitable for use when changing compilation models.  When changing the level
of intermodule optimization, a `depend' is required, but a `clean' is also
recommended.

compiler/modules.m:
	Removed the generation and recognition of the `.change_clean'
	target.
	Moved the deletion of the `.trans_opt' and `.trans_opt_date' files
	from the `.clean' target to the `.realclean' target.

doc/user_guide.texi:
	Removed the documentation for the `.change_clean' target, but
	documented how to achieve each of its two intended purposes by using
	other targets.
	Updated the documentation of the clean targets to more accurately
	and completely reflect what they do.

scripts/Mmake.rules:
	Removed a reference to `change_clean'.

Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.106
diff -u -r1.106 modules.m
--- modules.m	1999/08/18 00:41:59	1.106
+++ modules.m	1999/08/18 02:52:54
@@ -561,7 +561,6 @@
 		; Ext = ".clean"
 		; Ext = ".clean_nu"
 		; Ext = ".clean_sicstus"
-		; Ext = ".change_clean"
 		; Ext = ".realclean"
 		; Ext = ".depend"
 		; Ext = ".check"
@@ -2653,6 +2652,12 @@
 		RLOsTargetName, " : $(", MakeVarName, ".rlos)\n\n"
 	]),
 
+
+	%
+	% If you change the clean targets below, please also update the
+	% documentation in doc/user_guide.texi.
+	%
+
 	module_name_to_file_name(SourceModuleName, ".clean", no,
 				CleanTargetName),
 	io__write_strings(DepStream, [
@@ -2667,8 +2672,6 @@
 		"\t-rm -f $(", MakeVarName, ".os) ", InitObjFileName, "\n",
 		"\t-rm -f $(", MakeVarName, ".pic_os) ", InitPicObjFileName,
 									"\n",
-		"\t-rm -f $(", MakeVarName, ".trans_opt_dates)\n",
-		"\t-rm -f $(", MakeVarName, ".trans_opts)\n",
 		"\t-rm -f $(", MakeVarName, ".profs)\n",
 		"\t-rm -f $(", MakeVarName, ".nos)\n",
 		"\t-rm -f $(", MakeVarName, ".qls)\n",
@@ -2678,29 +2681,6 @@
 
 	io__write_string(DepStream, "\n"),
 
-	module_name_to_file_name(SourceModuleName, ".change_clean", no,
-			ChangeCleanTargetName),
-	io__write_strings(DepStream, [
-		".PHONY : ", ChangeCleanTargetName, "\n",
-		ChangeCleanTargetName, " :\n",
-		"\t-rm -f $(", MakeVarName, ".cs) ", InitCFileName, "\n",
-		"\t-rm -f $(", MakeVarName, ".ss) ", InitAsmFileName, "\n",
-		"\t-rm -f $(", MakeVarName, ".os) ", InitObjFileName, "\n",
-		"\t-rm -f $(", MakeVarName, ".pic_os) ", InitPicObjFileName,
-									"\n",
-		"\t-rm -f $(", MakeVarName, ".hs)\n",
-		"\t-rm -f $(", MakeVarName, ".ds)\n",
-		"\t-rm -f ",
-			ExeFileName, " ",
-			SplitExeFileName, " ",
-			SplitLibFileName, " ",
-			InitFileName, " ",
-			LibFileName, " ",
-			SharedLibFileName, " ",
-			DepFileName, " ",
-			DvFileName, "\n\n"
-	]),
-
 	module_name_to_file_name(SourceModuleName, ".realclean", no,
 			RealCleanTargetName),
 	io__write_strings(DepStream, [
@@ -2713,10 +2693,12 @@
 		"\t-rm -f $(", MakeVarName, ".date0s)\n",
 		"\t-rm -f $(", MakeVarName, ".date3s)\n",
 		"\t-rm -f $(", MakeVarName, ".optdates)\n",
+		"\t-rm -f $(", MakeVarName, ".trans_opt_dates)\n",
 		"\t-rm -f $(", MakeVarName, ".ints)\n",
 		"\t-rm -f $(", MakeVarName, ".int0s)\n",
 		"\t-rm -f $(", MakeVarName, ".int3s)\n",
 		"\t-rm -f $(", MakeVarName, ".opts)\n",
+		"\t-rm -f $(", MakeVarName, ".trans_opts)\n",
 		"\t-rm -f $(", MakeVarName, ".ds)\n",
 		"\t-rm -f $(", MakeVarName, ".hs)\n",
 		"\t-rm -f $(", MakeVarName, ".rlos)\n"
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.183
diff -u -r1.183 user_guide.texi
--- user_guide.texi	1999/08/09 08:29:23	1.183
+++ user_guide.texi	1999/08/18 02:52:55
@@ -396,6 +396,8 @@
 @file{@var{main-module}.dv} from @file{@var{main-module}.m}
 and the modules it imports.
 This step must be performed first.
+It is also required whenever you wish to change the level of
+inter-module optimization performed (@pxref{Overall optimization options}).
 
 @item @var{main-module}.ints
 Ensure that the interface files for @var{main-module}
@@ -430,16 +432,17 @@
 that contain the compiled code of the program
 and the error messages produced by the compiler.
 Specifically, this will remove all the @samp{.c}, @samp{.s}, @samp{.o},
- at samp{.no}, @samp{.ql}, and @samp{.err} files
+ at samp{.pic_o}, @samp{.prof}, @samp{.no}, @samp{.ql},
+ at ifset aditi
+ at samp{.schema},
+ at end ifset
+and @samp{.err} files
 belonging to the named @var{main-module} or its imported modules.
-
- at item @var{main-module}.change_clean
-Removes files that need updating when changing compilation model
-(@pxref{Compilation model options}) or
-when enabling inter-module optimization.
-Specifically, this will remove all the @samp{.c}, @samp{.s}, @samp{.o},
- at samp{.dep}, @samp{.dv} and executable files belonging to the named
- at var{main-module} or its imported modules.
+Use this target whenever you wish to change compilation model
+(@pxref{Compilation model options}).
+This target is also recommended whenever you wish to change the level
+of inter-module optimization performed (@pxref{Overall optimization
+options}) in addition to the mandatory @var{main-module}.depend.
 
 @item @var{main-module}.realclean
 Removes all the automatically generated files.
@@ -451,26 +454,42 @@
 @ifset aditi
 @samp{.rlo},
 @end ifset
- at samp{.d}, @samp{.dep} and @samp{.dv}
+ at samp{.h} and @samp{.d} files
 belonging to one of the modules of the program,
-and also the various possible executables for the program ---
+and also the various possible executables, libraries and dependency files
+for the program as a whole ---
 @samp{@var{main-module}},
+ at samp{@var{main-module}.split},
 @samp{@var{main-module}.nu},
 @samp{@var{main-module}.nu.save},
 @samp{@var{main-module}.nu.debug},
 @samp{@var{main-module}.nu.debug.save},
- at samp{@var{main-module}.sicstus}, and
- at samp{@var{main-module}.sicstus.debug}.
+ at samp{@var{main-module}.sicstus},
+ at samp{@var{main-module}.sicstus.debug},
+ at samp{lib at var{main-module}.a},
+ at samp{lib at var{main-module}.so},
+ at samp{@var{main-module}.split.a},
+ at samp{@var{main-module}.init},
+ at samp{@var{main-module}.dep}
+and
+ at samp{@var{main-module}.dv}.
 
 @item clean
 This makes @samp{@var{main-module}.clean} for every @var{main-module}
 for which there is a @file{@var{main-module}.dep} file in the current
-directory.
+directory, as well as deleting the profiling files
+ at samp{Prof.CallPair},
+ at samp{Prof.Counts},
+ at samp{Prof.Decl},
+ at samp{Prof.MemWords}
+and
+ at samp{Prof.MemCells}.
 
 @item realclean
 This makes @samp{@var{main-module}.realclean} for every @var{main-module}
 for which there is a @file{@var{main-module}.dep} file in the current
-directory.
+directory, as well as deleting the profiling files as per the @samp{clean}
+target.
 
 @end table
 
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.70
diff -u -r1.70 Mmake.rules
--- Mmake.rules	1999/07/20 03:39:18	1.70
+++ Mmake.rules	1999/08/18 02:52:55
@@ -298,7 +298,7 @@
 # automatically generated `.d' files.
 #
 
-.PHONY: clean realclean change_clean clean_nu clean_sicstus clean_prof_files
+.PHONY: clean realclean clean_nu clean_sicstus clean_prof_files
 
 clean_prof_files:
 	-rm -f Prof.CallPair Prof.Counts Prof.Decl Prof.MemWords Prof.MemCells
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list