[m-rev.] for review: lex moves from Mmakefile to Makefile

Ondrej Bojar bojar at csse.unimelb.edu.au
Thu Feb 22 17:47:48 AEDT 2007


For review by Ralph.

Estimated hours taken: 1

Replaced lex Mmakefile with Makefile to promote 'mmc --make' instead of
'mmake'. Moreover, lex installed with mmake was not usable with 'mmc --make'.

extras/lex/Makefile:
extras/lex/Mmakefile:
extras/lex/samples/Makefile:
extras/lex/samples/Mmakefile:
extras/lex/tests/Makefile:
extras/lex/tests/Mmakefile:
     Replaced each Mmakefile with a corresponding Makefile and modified/added
     rules to keep the functionality.

Index: extras/lex/Makefile
===================================================================
RCS file: extras/lex/Makefile
diff -N extras/lex/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/lex/Makefile	22 Feb 2007 06:39:50 -0000
@@ -0,0 +1,48 @@
+# Copyright (C) 2001 Ralph Becket <rbeck at microsoft.com>
+# Copyright (C) 2002-2007 The University of Melbourne
+
+# To build, do the following:
+#
+# $ make all
+# $ make install
+#
+
+# Omit this line if you want to install in the standard location.
+# Edit this line if you want to install the library elsewhere.
+# A directory $(INSTALL_PREFIX)/lib/mercury will be created, if
+# necessary, and everything put there.
+#
+#INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+INSTALL_PREFIX = .
+
+# Omit this line if you want to install the default grades.
+# Edit this line if you want to install with different grades.
+#
+#LIBGRADES = asm_fast.gc hlc.gc asm_fast.gc.tr.debug
+
+# Any application using these libraries will also need to pass the following
+# options to mmc:
+#
+# --mld $(INSTALL_PREFIX)/lib/mercury --ml lex --ml regex
+
+MAIN_TARGET = all
+
+.PHONY: all install check
+
+all: liblex.compile libregex.compile
+
+install: liblex.install libregex.install
+
+ifdef LIBGRADES
+LIBGRADES_FLAGS=--no-libgrade $(LIBGRADES:%=--libgrade %)
+else
+LIBGRADES_FLAGS=
+endif
+
+%.compile:
+	mmc --make $(LIBGRADES_FLAGS) $*
+%.install:
+	mmc --make $(LIBGRADES_FLAGS) --install-prefix $(INSTALL_PREFIX) $@
+
+check: install
+	(cd tests; mmake check)
Index: extras/lex/Mmakefile
===================================================================
RCS file: extras/lex/Mmakefile
diff -N extras/lex/Mmakefile
--- extras/lex/Mmakefile	3 Dec 2002 04:48:31 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-# Copyright (C) 2001 Ralph Becket <rbeck at microsoft.com>
-# Copyright (C) 2002 The University of Melbourne
-
-# To build, do the following:
-#
-# $ mmake depend
-# $ mmake all
-# $ mmake install
-#
-# If you have problems, try the following instead:
-#
-# $ mmake depend
-# $ mmake all
-# $ mmake liblex.install
-# $ mmake libregex.install
-
-# Omit this line if you want to install in the standard location.
-# Edit this line if you want to install the library elsewhere.
-# A directory $(INSTALL_PREFIX)/lib/mercury will be created, if
-# necessary, and everything put there.
-#
-#INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
-INSTALL_PREFIX = .
-
-# Omit this line if you want to install the default grades.
-# Edit this line if you want to install with different grades.
-#
-LIBGRADES = asm_fast.gc hlc.gc asm_fast.gc.tr.debug
-
-# Any application using these libraries will also need the following
-# in its Mmakefile:
-#
-#EXTRA_LIBRARIES = lex regex
-#
-# and the following must be uncommented if the library was not installed
-# in the standard location (the RHS must match the value of INSTALL_PREFIX
-# used to install the libr ary.)
-#
-#EXTRA_LIB_DIRS = $(INSTALL_PREFIX)/extras
-#EXTRA_LIB_DIRS = .
-
-MAIN_TARGET = all
-
-.PHONEY: all depend install check
-
-all: liblex libregex
-
-depend: lex.depend regex.depend
-
-install: liblex.install libregex.install
-
-check: install
-	(cd tests; mmake check)
Index: extras/lex/samples/Makefile
===================================================================
RCS file: extras/lex/samples/Makefile
diff -N extras/lex/samples/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/lex/samples/Makefile	22 Feb 2007 06:39:50 -0000
@@ -0,0 +1,28 @@
+# Copyright (C) 2001-2007 The University of Melbourne
+# Ralph Becket <rafe at cs.mu.oz.au>
+#
+# To build do:
+#
+# $ make
+#
+# The targets are called lex_demo and regex_demo.
+#
+# Ensure you have built and installed the lex and regex libraries.
+# Change the following line as appropriate if you installed them
+# elsewhere:
+#
+#EXTRA_LIB_DIR := $(INSTALL_PREFIX)/lib/mercury
+EXTRA_LIB_DIR := ../lib/mercury
+
+EXTRA_LIBRARIES = lex regex
+EXTRA_LIBRARIES_FLAGS = $(EXTRA_LIBRARIES:%= --ml %)
+
+MAIN_TARGET = all
+
+.PHONY: all check
+
+all: lex_demo regex_demo
+
+%: %.m
+	mmc --make --mld $(EXTRA_LIB_DIR) $(EXTRA_LIBRARIES_FLAGS) $@
+
Index: extras/lex/samples/Mmakefile
===================================================================
RCS file: extras/lex/samples/Mmakefile
diff -N extras/lex/samples/Mmakefile
--- extras/lex/samples/Mmakefile	3 Dec 2002 04:48:33 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-# Copyright (C) 2001-2002 The University of Melbourne
-# Ralph Becket <rafe at cs.mu.oz.au>
-#
-# To build do:
-#
-# $ mmake depend
-# $ mmake
-#
-# The targets are called lex_demo and regex_demo.
-#
-# Ensure you have built and installed the lex and regex libraries.
-# Change the following line as appropriate if you installed them
-# elsewhere:
-#
-#EXTRA_LIB_DIRS := $(INSTALL_PREFIX)/extras/lib/mercury
-EXTRA_LIB_DIRS := ../lib/mercury
-
-EXTRA_LIBRARIES = lex regex
-
-.PHONY: all
-
-MAIN_TARGET = all
-
-all: lex_demo regex_demo
-
-depend: lex_demo.depend regex_demo.depend
Index: extras/lex/tests/Makefile
===================================================================
RCS file: extras/lex/tests/Makefile
diff -N extras/lex/tests/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/lex/tests/Makefile	22 Feb 2007 06:39:50 -0000
@@ -0,0 +1,30 @@
+# Copyright (C) 2002-2007 The University of Melbourne
+# Ralph Becket <rafe at cs.mu.oz.au>
+#
+# To build do:
+#
+# $ make
+#
+# Ensure you have built and installed the lex and regex libraries.
+# Change the following line as appropriate if you installed them
+# elsewhere:
+#
+#EXTRA_LIB_DIR := $(INSTALL_PREFIX)/lib/mercury
+EXTRA_LIB_DIR := ../lib/mercury
+
+EXTRA_LIBRARIES = lex regex
+EXTRA_LIBRARIES_FLAGS = $(EXTRA_LIBRARIES:%= --ml %)
+
+MAIN_TARGET = all
+
+.PHONY: all check
+
+all: test_regex
+
+%: %.m
+	mmc --make --mld $(EXTRA_LIB_DIR) $(EXTRA_LIBRARIES_FLAGS) $@
+
+check: test_regex
+	./test_regex < test_regex.in > test_regex.res
+	diff -u test_regex.exp test_regex.res && echo "Passed" || echo "Failed"
+
Index: extras/lex/tests/Mmakefile
===================================================================
RCS file: extras/lex/tests/Mmakefile
diff -N extras/lex/tests/Mmakefile
--- extras/lex/tests/Mmakefile	3 Dec 2002 04:48:33 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-# Copyright (C) 2002 The University of Melbourne
-# Ralph Becket <rafe at cs.mu.oz.au>
-#
-# To build do:
-#
-# $ mmake depend
-# $ mmake
-#
-# Ensure you have built and installed the lex and regex libraries.
-# Change the following line as appropriate if you installed them
-# elsewhere:
-#
-#EXTRA_LIB_DIRS := $(INSTALL_PREFIX)/extras/lib/mercury
-EXTRA_LIB_DIRS := ../lib/mercury
-
-EXTRA_LIBRARIES = lex regex
-
-MAIN_TARGET = all
-
-.PHONY: all depend
-
-all: test_regex
-
-depend: test_regex.depend
-
-check: depend test_regex
-	./test_regex < test_regex.in > test_regex.res
-	diff -u test_regex.exp test_regex.res && echo "Passed" || echo "Failed"
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list