[MLton-commit] r7425

Matthew Fluet fluet at mlton.org
Thu Feb 18 08:47:26 PST 2010


Automate building and installing of cm2mlb tool.
----------------------------------------------------------------------

_U  mlton/trunk/util/cm2mlb/
A   mlton/trunk/util/cm2mlb/.ignore
A   mlton/trunk/util/cm2mlb/Makefile
A   mlton/trunk/util/cm2mlb/cm2mlb.cm
U   mlton/trunk/util/cm2mlb/cm2mlb.sml
D   mlton/trunk/util/cm2mlb/sources.cm

----------------------------------------------------------------------


Property changes on: mlton/trunk/util/cm2mlb
___________________________________________________________________
Name: svn:ignore
   + cm2mlb.*-*


Added: mlton/trunk/util/cm2mlb/.ignore
===================================================================
--- mlton/trunk/util/cm2mlb/.ignore	2010-02-18 15:16:15 UTC (rev 7424)
+++ mlton/trunk/util/cm2mlb/.ignore	2010-02-18 16:47:25 UTC (rev 7425)
@@ -0,0 +1 @@
+cm2mlb.*-*
\ No newline at end of file

Added: mlton/trunk/util/cm2mlb/Makefile
===================================================================
--- mlton/trunk/util/cm2mlb/Makefile	2010-02-18 15:16:15 UTC (rev 7424)
+++ mlton/trunk/util/cm2mlb/Makefile	2010-02-18 16:47:25 UTC (rev 7425)
@@ -0,0 +1,39 @@
+## Copyright (C) 2010 Matthew Fluet.
+ #
+ # MLton is released under a BSD-style license.
+ # See the file MLton-LICENSE for details.
+ ##
+
+#
+# SML/NJ tools and heap suffix
+#
+ML_BUILD             := ml-build
+ML_BUILD_FLAGS       := 
+ML_HEAP_SUFFIX       := $(shell echo 'TextIO.output (TextIO.stdErr, SMLofNJ.SysInfo.getHeapSuffix ());' | sml 2>&1 1> /dev/null)
+
+#
+# cm2mlb root .cm 
+#
+CM2MLB_CM := cm2mlb.cm
+#
+# cm2mlb heap image
+#
+CM2MLB_HEAP := cm2mlb.$(ML_HEAP_SUFFIX)
+
+all: $(CM2MLB_HEAP)
+
+$(CM2MLB_HEAP): cm2mlb.cm cm2mlb.sml gen-mlb.sml cm2mlb-map
+	rm -f $(CM2MLB_HEAP)
+	$(ML_BUILD) $(ML_BUILD_FLAGS) $(CM2MLB_CM) CM2MLB.main $(CM2MLB_HEAP)
+	touch $(CM2MLB_HEAP)
+
+.PHONY: clean
+clean:
+	../../bin/clean
+
+SMLDIR := $(dir $(shell which sml))
+.PHONY: install
+install: $(CM2MLB_HEAP)
+	rm -f $(SMLDIR).heap/$(CM2MLB_HEAP) $(SMLDIR)cm2mlb
+	cp $(CM2MLB_HEAP) $(SMLDIR).heap
+	(cd $(SMLDIR) ; ln -s .run-sml cm2mlb)
\ No newline at end of file

Copied: mlton/trunk/util/cm2mlb/cm2mlb.cm (from rev 7423, mlton/trunk/util/cm2mlb/sources.cm)
===================================================================
--- mlton/trunk/util/cm2mlb/sources.cm	2010-02-18 15:15:29 UTC (rev 7423)
+++ mlton/trunk/util/cm2mlb/cm2mlb.cm	2010-02-18 16:47:25 UTC (rev 7425)
@@ -0,0 +1,10 @@
+Library
+        structure CM2MLB
+is
+        $/pgraph.cm
+        $smlnj/cm.cm
+        $smlnj/viscomp/core.cm
+        $/smlnj-lib.cm
+        $/basis.cm
+        gen-mlb.sml
+        cm2mlb.sml

Modified: mlton/trunk/util/cm2mlb/cm2mlb.sml
===================================================================
--- mlton/trunk/util/cm2mlb/cm2mlb.sml	2010-02-18 15:16:15 UTC (rev 7424)
+++ mlton/trunk/util/cm2mlb/cm2mlb.sml	2010-02-18 16:47:25 UTC (rev 7425)
@@ -17,7 +17,7 @@
  * the root directory of the SML/NJ installation.  You may need to be root in
  * order to do these.
  * 1. From the SML/NJ REPL:
- *      CM.make "sources.cm";
+ *      CM.make "cm2mlb.cm";
  *      CM2MLB.export ();
  * 2. ln -s <smlnj>/bin/.run-sml <smlnj>/bin/cm2mlb
  * 3. mv cm2mlb.x86-linux <smlnj>/bin/.heap

Deleted: mlton/trunk/util/cm2mlb/sources.cm
===================================================================
--- mlton/trunk/util/cm2mlb/sources.cm	2010-02-18 15:16:15 UTC (rev 7424)
+++ mlton/trunk/util/cm2mlb/sources.cm	2010-02-18 16:47:25 UTC (rev 7425)
@@ -1,10 +0,0 @@
-Group
-        structure CM2MLB
-is
-        $/pgraph.cm
-        $smlnj/cm.cm
-        $smlnj/viscomp/core.cm
-        $/smlnj-lib.cm
-        $/basis.cm
-        gen-mlb.sml
-        cm2mlb.sml




More information about the MLton-commit mailing list