[m-dev.] diff: preliminary Mmake support for `.il'

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 17 17:52:33 AEDT 2000


This is the easy part... as noted below, I left out the hard part.

----------

Estimated hours taken: 1

Add Mmake support for generating `.il' files.
Note that this change does NOT add rules for generating
`.dll' or `.exe' files from the `.il' files.

scripts/Mmake.vars.in:
	Set the ils_subdir variable.
	
scripts/Mmake.rules:
	Add a pattern rule for creating `.il' files.

compiler/modules.m:
	Add code to emit the dependencies for `.il' files.
	Add code to emit the `<main-module>.ils' variable
	and the `<main-module>.ils' target.
	Also fix a bug where it wasn't handling the `.rlos'
	target correctly when --use-subdirs was enabled.

Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.137
diff -u -d -r1.137 modules.m
--- compiler/modules.m	2000/11/12 05:51:12	1.137
+++ compiler/modules.m	2000/11/17 06:42:54
@@ -649,6 +649,8 @@
 		; Ext = ".check"
 		; Ext = ".ints"
 		; Ext = ".int3s"
+		; Ext = ".rlos"
+		; Ext = ".ils"
 		; Ext = ".opts"
 		; Ext = ".trans_opts"
 		% The current interface to `mercury_update_interface'
@@ -1694,6 +1696,7 @@
 		module_name_to_file_name(ModuleName, ".c", no, CFileName),
 		module_name_to_file_name(ModuleName, ".$O", no, ObjFileName),
 		module_name_to_file_name(ModuleName, ".rlo", no, RLOFileName),
+		module_name_to_file_name(ModuleName, ".il", no, ILFileName),
 		module_name_to_file_name(ModuleName, ".pic_o", no,
 							PicObjFileName),
 		module_name_to_split_c_file_pattern(ModuleName, ".$O",
@@ -1706,7 +1709,8 @@
 			PicObjFileName, " ",
 			ObjFileName, " ",
 			SplitObjPattern, " ",
-			RLOFileName, " : ",
+			RLOFileName, " ",
+			ILFileName, " : ",
 			SourceFileName
 		] ),
 		write_dependencies_list(ParentDeps, ".int0", DepStream),
@@ -2663,6 +2667,12 @@
 	io__write_string(DepStream, "\n"),
 
 	io__write_string(DepStream, MakeVarName),
+	io__write_string(DepStream, ".ils = "),
+	write_compact_dependencies_list(Modules, "$(ils_subdir)", ".il",
+					Basis, DepStream),
+	io__write_string(DepStream, "\n"),
+
+	io__write_string(DepStream, MakeVarName),
 	io__write_string(DepStream, ".pic_os = "),
 	write_compact_dependencies_list(Modules, "$(os_subdir)",
 					".$(EXT_FOR_PIC_OBJECTS)",
@@ -3045,6 +3055,8 @@
 						TransOptsTargetName),
 	module_name_to_file_name(ModuleName, ".rlos", no,
 						RLOsTargetName),
+	module_name_to_file_name(ModuleName, ".ils", no,
+						ILsTargetName),
 
 	io__write_strings(DepStream, [
 		".PHONY : ", CheckTargetName, "\n",
@@ -3059,7 +3071,9 @@
 		TransOptsTargetName, " : $(", MakeVarName,
 						".trans_opt_dates)\n\n",
 		".PHONY : ", RLOsTargetName, "\n",
-		RLOsTargetName, " : $(", MakeVarName, ".rlos)\n\n"
+		RLOsTargetName, " : $(", MakeVarName, ".rlos)\n\n",
+		".PHONY : ", ILsTargetName, "\n",
+		ILsTargetName, " : $(", MakeVarName, ".ils)\n\n"
 	]),
 
 
@@ -3082,6 +3096,7 @@
 		"\t-rm -f $(", MakeVarName, ".os) ", InitObjFileName, "\n",
 		"\t-rm -f $(", MakeVarName, ".pic_os) ", InitPicObjFileName,
 									"\n",
+		"\t-rm -f $(", MakeVarName, ".ils)\n",
 		"\t-rm -f $(", MakeVarName, ".profs)\n",
 		"\t-rm -f $(", MakeVarName, ".errs)\n",
 		"\t-rm -f $(", MakeVarName, ".schemas)\n"
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.83
diff -u -d -r1.83 Mmake.rules
--- scripts/Mmake.rules	2000/06/22 08:50:25	1.83
+++ scripts/Mmake.rules	2000/11/17 06:16:05
@@ -21,7 +21,8 @@
 		.c .nu .$O .pic_o \
 		.i .s .pic_s \
 		.ql .pl \
-		.rlo
+		.rlo \
+		.il
 
 #-----------------------------------------------------------------------------#
 #
@@ -167,13 +168,20 @@
 # duplicated in compiler/modules.m.
 #
 
+# C back-end
 $(cs_subdir)%.c : %.m
 	rm -f $(cs_subdir)$*.c
 	$(MCG) $(ALL_GRADEFLAGS) $(ALL_MCGFLAGS) $< > $*.err 2>&1
 
+# Aditi-RL back-end
 $(rlos_subdir)%.rlo : %.m
 	rm -f $(rlos_subdir)$*.c
 	$(MCG) $(ALL_GRADEFLAGS) $(ALL_MCGFLAGS) --aditi-only $< > $*.err 2>&1
+
+# .NET back-end
+$(ils_subdir)%.il : %.m
+	rm -f $(ils_subdir)$*.c
+	$(MCG) $(ALL_GRADEFLAGS) $(ALL_MCGFLAGS) --il-only $< > $*.err 2>&1
 
 # If we are removing the .c files, we need to tell Make that we're
 # generating the .$O files directly from the .m files, but
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.36
diff -u -d -r1.36 Mmake.vars.in
--- scripts/Mmake.vars.in	2000/06/22 08:50:25	1.36
+++ scripts/Mmake.vars.in	2000/11/17 06:16:49
@@ -364,6 +364,7 @@
 cs_subdir=$(SUBDIR)cs/
 os_subdir=$(SUBDIR)os/
 rlos_subdir=$(SUBDIR)rlos/
+ils_subdir=$(SUBDIR)ils/
 dirs_subdir=$(SUBDIR)dirs/
 
 else
@@ -388,6 +389,7 @@
 cs_subdir=
 os_subdir=
 rlos_subdir=
+ils_subdir=
 dirs_subdir=
 
 endif
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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