[m-dev.] for review: fix dl.m for HL grades

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jan 11 17:21:17 AEDT 2001


On 11-Jan-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Fergus, you should really fix that double maintenance problem.

OK, done.

I'll commit this one just on the main branch, not on the release
branch.  (I've committed the bug fixes that I posted earlier on both
branches.)

----------

Estimated hours taken: 1

Eliminate the code duplication problem with the source files
in the extras/dynamic_linking and browser directories.

extras/dynamic_linking/dl.m:
extras/dynamic_linking/name_mangle.m:
	Remove these from the cvs repository.

extras/dynamic_linking/Mmakefile:
	Add rules to build dl.m and name_mangle.m from
	the copies in the browser directory.

Mmakefile:
	Make sure to build the .m files in the extras/dynamic_linking
	directory before creating the extras distribution.

Workspace: /home/pgrad/fjh/ws/gcc/mercury
Index: extras/dynamic_linking/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/dynamic_linking/Mmakefile,v
retrieving revision 1.4.4.1
diff -u -d -r1.4.4.1 Mmakefile
--- extras/dynamic_linking/Mmakefile	2001/01/11 05:54:03	1.4.4.1
+++ extras/dynamic_linking/Mmakefile	2001/01/11 06:13:23
@@ -20,18 +20,51 @@
 main_target: libdl
 depend: dl.depend dl_test.depend dl_test2.depend hello.depend
 
+#-----------------------------------------------------------------------------#
+#
+# Some simple regression tests
+#
+
 .PHONY: check
-check:	dl_test.res libhello.so
+check:	dl_test.res
 
 # The dl_test2 test case only works in non-hl* grades.
 ifeq "$(findstring hl,$(GRADE))" ""
 check: dl_test2.res
 endif
 
-dl_test.res: dl_test dl_test.exp
+dl_test.res: dl_test dl_test.exp libhello.so
 	./dl_test > dl_test.out
 	diff -c dl_test.out dl_test.exp
 
-dl_test2.res: dl_test2 dl_test2.exp
+dl_test2.res: dl_test2 dl_test2.exp libhello.so
 	./dl_test2 > dl_test2.out
 	diff -c dl_test2.out dl_test2.exp
+
+#-----------------------------------------------------------------------------#
+#
+# We want copies of name_mangling.m and dl.m in both
+# extras/dynamic_linking and in mercury/browser.
+# The master copy in our CVS repository is in mercury/browser.
+# The copy here is automatically generated from that copy.
+#
+
+dl.depend dl_test.depend dl_test2.depend: sources
+
+.PHONY: sources
+sources: dl.m name_mangle.m
+
+BROWSER_DIR = $(shell \
+	if [ -d ../../browser ]; then \
+		echo ../../browser; \
+	else \
+		echo ../../../mercury/browser; \
+	fi)
+
+name_mangle.m: $(BROWSER_DIR)/name_mangle.m
+	sed 's/mdb__//g' $< > $@
+
+dl.m: $(BROWSER_DIR)/dl.m
+	sed 's/mdb__//g' $< > $@
+
+#-----------------------------------------------------------------------------#
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmakefile,v
retrieving revision 1.63
diff -u -d -r1.63 Mmakefile
--- Mmakefile	2001/01/10 10:57:20	1.63
+++ Mmakefile	2001/01/11 06:15:03
@@ -217,6 +217,7 @@
 	cd bindist && $(SUBDIR_MMAKE) bindist.configure
 	# the following command might fail on Windows?
 	-cd bindist && $(SUBDIR_MMAKE) bindist.build_vars
+	cd extras/dynamic_linking && $(SUBDIR_MMAKE) sources
 	# clean up
 	cd scripts && mmake realclean
 	cd scripts && mmake canonical_grade

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