[m-rev.] work around mer_browser/mdbcomp dependency problem

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Dec 9 23:47:22 AEDT 2003


Estimated hours taken: 1
Branches: main

browser/Mmakefile:
	Work around a problem where the mdbcomp library was being
	included in the mer_browser library, rather than just being
	referenced from it.

Workspace: /home/ceres/fjh/mercury
Index: browser/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/Mmakefile,v
retrieving revision 1.32
diff -u -d -r1.32 Mmakefile
--- browser/Mmakefile	5 Nov 2003 08:05:55 -0000	1.32
+++ browser/Mmakefile	9 Dec 2003 12:41:41 -0000
@@ -95,6 +95,33 @@
 depend:	$(DEPENDS)
 $(DEPENDS): Mercury.modules
 
+# This directory contains two libraries, mer_browser and mer_mdbcomp,
+# and mer_browser depends on mer_mdbcomp.  But Mmake will by default
+# assume that each library contains any file referenced from the
+# top-level module which occurs in the current directory, which leads
+# it to incorrectly assume that the mer_browser library should include
+# the mdbcomp.m and program_representation.m files.
+# To avoid this problem, we temporarily rename those files away
+# when building the dependencies for mer_browser.
+# We use the phony .NOTPARALLEL target to disable parallel make,
+# to ensure that we don't try to execute any other rule while
+# the files are renamed.
+# We also need to be careful to ensure that the files get renamed
+# back properly even if 
+# XXX This is all a bit hacky.
+.NOTPARALLEL:
+$(BROWSER_LIB_NAME).dep $(BROWSER_LIB_NAME).depend:
+	trap 'mv RENAMED_mdbcomp.m mdbcomp.m; \
+		mv RENAMED_program_representation.m program_representation.m; \
+		exit 1' 1 2 3 13 15; \
+	mv mdbcomp.m RENAMED_mdbcomp.m; \
+	mv program_representation.m RENAMED_program_representation.m ;\
+	$(MCD) $(ALL_GRADEFLAGS) $(ALL_MCDFLAGS) $*; \
+	status=$$?; \
+	mv RENAMED_mdbcomp.m mdbcomp.m; \
+	mv RENAMED_program_representation.m program_representation.m; \
+	exit $$status
+
 # This directory contains source files for which the module
 # name doesn't match the file name, so smart recompilation
 # won't work without the Mercury.modules file.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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