[m-rev.] for review: IL backend: improve mmake support

Peter Ross peter.ross at miscrit.be
Tue Jul 17 01:47:35 AEST 2001


Hi,

For Fergus to review.

===================================================================


Estimated hours taken: 4
Branches: main

Improve the mmake support for the IL backend.
We still need to add code to support the fact that pragma foreign code
is output into different files.

configure.in:
    To determine the extension of executable files use the new macro
    AC_EXEEXT.

compiler/modules.m:
    In the .dep file add a check to see if we are compiling in an IL
    grade.  If so, use a different top level rule.
    Add rules to generate, remove and so on all the .dll files.

scripts/Mmake.vars.in:
    Minor changes.


Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.273
diff -u -r1.273 configure.in
--- configure.in	10 Jul 2001 16:45:08 -0000	1.273
+++ configure.in	16 Jul 2001 15:39:30 -0000
@@ -330,6 +330,9 @@
 AC_PROG_CC
 AC_SUBST(CC)
 
+AC_EXEEXT
+AC_SUBST(EXEEXT)
+
 # We need to ensure that CFLAGS does not contain `-g', because
 # on some (broken) distributions of Linux (specifically Debian 0.93R6),
 # the `-lc' and `-lg' libraries have different contents; specifically,
@@ -368,7 +371,6 @@
 ] AC_MSG_RESULT(no))
 
 if test "$ac_microsoft" = "yes" ; then
-	EXE_SUFFIX=".exe"
 	OBJ_SUFFIX="obj"
 	LIB_SUFFIX="lib"
 	LIB_PREFIX="lib"
@@ -388,7 +390,6 @@
 	RANLIB="echo"
 	AC_SUBST(RANLIB)
 else
-	EXE_SUFFIX=""
 	OBJ_SUFFIX="o"
 	LIB_SUFFIX="a"
 	LIB_PREFIX=""
@@ -412,7 +413,6 @@
 AC_SUBST(ARFLAGS)
 AC_SUBST(AR_LIBFILE_OPT)
 AC_SUBST(BOEHMGC_MAKEFILE)
-AC_SUBST(EXE_SUFFIX)
 AC_SUBST(OBJ_SUFFIX)
 AC_SUBST(LIB_SUFFIX)
 AC_SUBST(LIB_PREFIX)
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.171
diff -u -r1.171 modules.m
--- compiler/modules.m	16 Jul 2001 08:21:02 -0000	1.171
+++ compiler/modules.m	16 Jul 2001 15:39:32 -0000
@@ -2889,6 +2889,12 @@
 	io__write_string(DepStream, "\n"),
 
 	io__write_string(DepStream, MakeVarName),
+	io__write_string(DepStream, ".dlls = "),
+	write_compact_dependencies_list(Modules, "$(dlls_subdir)", ".dll",
+					Basis, DepStream),
+	io__write_string(DepStream, "\n"),
+
+	io__write_string(DepStream, MakeVarName),
 	io__write_string(DepStream, ".all_ss = "),
 	write_compact_dependencies_list(Modules, "$(ss_subdir)", ".s",
 		Basis, DepStream),
@@ -3269,13 +3275,18 @@
 
 	module_name_to_file_name(SourceModuleName, "", no, ExeFileName),
 	io__write_strings(DepStream, [
+		"ifeq ($(findstring il,$(GRADE)),il)\n",
+		ExeFileName, " : ", ExeFileName, ".exe ",
+			"$(", MakeVarName, ".dlls)\n",
+		"else\n",
 		ExeFileName, " : $(", MakeVarName, ".cs_or_ss) ",
 			"$(", MakeVarName, ".os) ",
 			InitObjFileName, " $(MLOBJS) ", All_MLLibsDepString,
 			"\n",
 		"\t$(ML) $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) -o ",
 			ExeFileName, " ", InitObjFileName, " \\\n",
-		"\t	$(", MakeVarName, ".os) $(MLOBJS) $(ALL_MLLIBS)\n\n"
+		"\t	$(", MakeVarName, ".os) $(MLOBJS) $(ALL_MLLIBS)\n",
+		"endif\n\n"
 	]),
 
 	module_name_to_file_name(SourceModuleName, ".split", yes,
@@ -3485,6 +3496,7 @@
 		CleanTargetName, " :\n",
 		"\t-rm -rf $(", MakeVarName, ".dirs)\n",
 		"\t-rm -f $(", MakeVarName, ".cs) ", InitCFileName, "\n",
+		"\t-rm -f $(", MakeVarName, ".dlls)\n",
 		"\t-rm -f $(", MakeVarName, ".all_ss) ", InitAsmFileName, "\n",
 		"\t-rm -f $(", MakeVarName, ".all_pic_ss) ",
 					InitAsmFileName, "\n",
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.49
diff -u -r1.49 Mmake.vars.in
--- scripts/Mmake.vars.in	9 Jul 2001 04:58:52 -0000	1.49
+++ scripts/Mmake.vars.in	16 Jul 2001 15:39:50 -0000
@@ -421,6 +421,7 @@
 optdates_subdir=$(SUBDIR)optdates/
 trans_opt_dates_subdir=$(SUBDIR)trans_opt_dates/
 cs_subdir=$(SUBDIR)cs/
+dlls_subdir=$(SUBDIR)dlls/
 ss_subdir=$(SUBDIR)cs/
 os_subdir=$(SUBDIR)os/
 rlos_subdir=$(SUBDIR)rlos/
@@ -451,6 +452,7 @@
 optdates_subdir=
 trans_opt_dates_subdir=
 cs_subdir=
+dlls_subdir=
 ss_subdir=
 os_subdir=
 rlos_subdir=
@@ -553,7 +555,7 @@
 empty_string=
 OBJFILE_OPT=@OBJFILE_OPT@$(empty_string)
 
-EXT_FOR_EXE=@EXE_SUFFIX@
+EXT_FOR_EXE=@EXEEXT@
 O=@OBJ_SUFFIX@
 A=@LIB_SUFFIX@
 

--------------------------------------------------------------------------
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