[m-rev.] diff: fix mmake bug

Simon Taylor stayl at cs.mu.OZ.AU
Fri Jan 11 22:33:37 AEDT 2002


Estimated hours taken: 0.25
Branches: main

scripts/Mmake.vars.in:
	Fix a bug which stopped the target-specific MLFLAGS
	being passed to c2init.

Index: Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.60
diff -u -u -r1.60 Mmake.vars.in
--- Mmake.vars.in	5 Jan 2002 14:12:35 -0000	1.60
+++ Mmake.vars.in	11 Jan 2002 10:36:44 -0000
@@ -346,9 +346,13 @@
 maybe-target-CFLAGS- = $(CFLAGS-$@)
 maybe-target-CFLAGS-undefined =
 
+# Note we strip any trailing `_init.c' from `$@' so we get the appropriate
+# "base" name, regardless of whether this variable ends up being used as
+# an argument of a `c2init' rule or an `ml' rule.
 TARGET_MLFLAGS = \
-  $(maybe-target-MLFLAGS-$(findstring undefined,$(origin MLFLAGS-$@)))
-maybe-target-MLFLAGS- = $(MLFLAGS-$@)
+  $(maybe-target-MLFLAGS-$(findstring undefined,\
+		$(origin MLFLAGS-$(patsubst %_init.c,%,$@))))
+maybe-target-MLFLAGS- = $(MLFLAGS-$(patsubst %_init.c,%,$@))
 maybe-target-MLFLAGS-undefined =
 
 TARGET_MLOBJS = \
--------------------------------------------------------------------------
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