[m-rev.] diff: handle MLOBJS-target make variables

Simon Taylor stayl at cs.mu.OZ.AU
Sun Jan 6 01:17:55 AEDT 2002



Estimated hours taken: 0.5
Branches: main

Allow MLOBJS-module Mmake variables.

scripts/Mmake.vars.in:
	Define TARGET_MLOBJS, ALL_MLOBJS and ALL_MLPICOBJS.

scripts/Mmake.rules:
compiler/modules.m:
	Use ALL_MLOBJS and ALL_MLPICOBJS instead of
	MLOBJS and MLPICOBJS.

Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.210
diff -u -u -r1.210 modules.m
--- compiler/modules.m	12 Dec 2001 00:30:10 -0000	1.210
+++ compiler/modules.m	5 Jan 2002 13:31:06 -0000
@@ -3543,11 +3543,12 @@
 	{ MainRule =
 		[ExeFileName, " : $(", MakeVarName, ".cs_or_ss) ",
 			"$(", MakeVarName, ".os) ",
-			InitObjFileName, " $(MLOBJS) ", All_MLLibsDepString,
-			"\n",
+			InitObjFileName, " $(ALL_MLOBJS) ",
+			All_MLLibsDepString, "\n",
 		"\t$(ML) $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) -o ",
 			ExeFileName, " ", InitObjFileName, " \\\n",
-		"\t	$(", MakeVarName, ".os) $(MLOBJS) $(ALL_MLLIBS)\n"] },
+		"\t	$(", MakeVarName, ".os) $(ALL_MLOBJS) $(ALL_MLLIBS)\n"]
+	},
 	{ EndIf = ["endif\n"] },
 
 	globals__io_get_target(Target),
@@ -3575,10 +3576,11 @@
 	]),
 
 	io__write_strings(DepStream, [
-		SplitLibFileName, " : $(", MakeVarName, ".dir_os) $(MLOBJS)\n",
+		SplitLibFileName,
+			" : $(", MakeVarName, ".dir_os) $(ALL_MLOBJS)\n",
 		"\trm -f ", SplitLibFileName, "\n",
 		"\t$(AR) $(ALL_ARFLAGS) $(AR_LIBFILE_OPT)",
-		SplitLibFileName, " $(MLOBJS)\n",
+		SplitLibFileName, " $(ALL_MLOBJS)\n",
 		"\tfind $(", MakeVarName, ".dirs) -name ""*.$O"" -print | \\\n",
 		"\t	xargs $(AR) q ", SplitLibFileName, "\n",
 		"\t$(RANLIB) $(ALL_RANLIBFLAGS) ", SplitLibFileName, "\n\n"
@@ -3635,19 +3637,19 @@
 	io__write_strings(DepStream, [
 		SharedLibFileName, " : $(", MakeVarName, ".cs_or_ss) ",
 			"$(", MakeVarName, ".pic_os) ",
-			"$(MLPICOBJS) ", All_MLLibsDepString, "\n",
+			"$(ALL_MLPICOBJS) ", All_MLLibsDepString, "\n",
 		"\t$(ML) --make-shared-lib $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) ",
 			"-o ", SharedLibFileName, " \\\n",
-		"\t\t$(", MakeVarName, ".pic_os) $(MLPICOBJS) ",
+		"\t\t$(", MakeVarName, ".pic_os) $(ALL_MLPICOBJS) ",
 			"$(ALL_MLLIBS)\n\n"
 	]),
 
 	io__write_strings(DepStream, [
 		LibFileName, " : $(", MakeVarName, ".cs_or_ss) ",
-			"$(", MakeVarName, ".os) $(MLOBJS)\n",
+			"$(", MakeVarName, ".os) $(ALL_MLOBJS)\n",
 		"\trm -f ", LibFileName, "\n",
 		"\t$(AR) $(ALL_ARFLAGS) $(AR_LIBFILE_OPT)", LibFileName, " ",
-			"$(", MakeVarName, ".os) $(MLOBJS)\n",
+			"$(", MakeVarName, ".os) $(ALL_MLOBJS)\n",
 		"\t$(RANLIB) $(ALL_RANLIBFLAGS) ", LibFileName, "\n\n"
 	]),
 
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.111
diff -u -u -r1.111 Mmake.rules
--- scripts/Mmake.rules	14 Aug 2001 16:48:42 -0000	1.111
+++ scripts/Mmake.rules	5 Jan 2002 13:30:32 -0000
@@ -385,11 +385,11 @@
 
 #-----------------------------------------------------------------------------#
 #
-# Code to handle dependencies on $(MLOBJS) and $(MLPICOBJS).
+# Code to handle dependencies on $(ALL_MLOBJS) and $(ALL_MLPICOBJS).
 #
 
 # The generated `.dep' files include rules for targets which may depend
-# on $(MLOBJS) or $(MLPICOBJS).  However, the definition of $(MLOBJS)
+# on $(ALL_MLOBJS) or $(ALL_MLPICOBJS).  However, the definition of $(MLOBJS)
 # or $(MLPICOBJS) is in the user's Mmakefile, and the `.dep' files get
 # included *before* the Mmakefile.  The `.dep' files cannot contain
 # those dependency directly, because $(MLOBJS) and $(MLPICOBJS) variables
@@ -397,11 +397,11 @@
 #
 # Instead, the generated `.dep' files just add the appropriate targets to
 # the $(MLOBJS_DEPS) or $(MLPICOBJS_DEPS) variables, and then we record the
-# dependency of those files on $(MLOBJS) or $(MLPICOBJS) here in Mmake.rules,
-# which gets included after the user's Mmakefile.
+# dependency of those files on $(ALL_MLOBJS) or $(ALL_MLPICOBJS) here in
+# Mmake.rules, which gets included after the user's Mmakefile.
 
-$(MLOBJS_DEPS) : $(MLOBJS)
-$(MLPICOBJS_DEPS) : $(MLPICOBJS)
+$(MLOBJS_DEPS) : $(ALL_MLOBJS)
+$(MLPICOBJS_DEPS) : $(ALL_MLPICOBJS)
 
 #-----------------------------------------------------------------------------#
 #
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.59
diff -u -u -r1.59 Mmake.vars.in
--- scripts/Mmake.vars.in	18 Dec 2001 12:13:15 -0000	1.59
+++ scripts/Mmake.vars.in	5 Jan 2002 13:29:28 -0000
@@ -192,8 +192,11 @@
 LIB_MLFLAGS	= $(patsubst %,-R%,$(EXTRA_C_LIB_DIRS)) \
 		  $(patsubst %,-L%,$(EXTRA_C_LIB_DIRS))
 
+ALL_MLOBJS	= $(MLOBJS) $(EXTRA_MLOBJS) $(TARGET_MLOBJS)
 MLOBJS		=
-MLPICOBJS	= $(MLOBJS:.o=.$(EXT_FOR_PIC_OBJECTS))
+EXTRA_MLOBJS	=
+ALL_MLPICOBJS	= $(ALL_MLOBJS:.o=.$(EXT_FOR_PIC_OBJECTS))
+
 ALL_MLLIBS	= $(MLLIBS) $(EXTRA_MLLIBS) $(TARGET_MLLIBS) $(LIB_MLLIBS)
 # XXX ALL_MLLIBS_DEP should contain a list of the file names of the
 # libraries specified in ALL_MLLIBS, but I can't see how to know whether
@@ -276,7 +279,7 @@
 # support for RM_C was removed from the compiler.
 RM_C = :
 
-# lists of targets that depend on $(MLOBJS) and $(MLPICOBJS)
+# lists of targets that depend on $(ALL_MLOBJS) and $(ALL_MLPICOBJS)
 MLOBJS_DEPS = 
 MLPICOBJS_DEPS = 
 
@@ -347,6 +350,11 @@
   $(maybe-target-MLFLAGS-$(findstring undefined,$(origin MLFLAGS-$@)))
 maybe-target-MLFLAGS- = $(MLFLAGS-$@)
 maybe-target-MLFLAGS-undefined =
+
+TARGET_MLOBJS = \
+  $(maybe-target-MLOBJS-$(findstring undefined,$(origin MLOBJS-$@)))
+maybe-target-MLOBJS- = $(MLOBJS-$@)
+maybe-target-MLOBJS-undefined =
 
 TARGET_MLLIBS = \
   $(maybe-target-MLLIBS-$(findstring undefined,$(origin MLLIBS-$@)))
--------------------------------------------------------------------------
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