[MLton-commit] r6452

spoons at mlton.org spoons at mlton.org
Mon Mar 3 07:38:29 PST 2008


Changes to build process for parallel MLton.

Avoid using the native or bytecode backends.  Give a unique name and
build number to parallel builds.

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

U   mlton/branches/shared-heap-multicore/Makefile
U   mlton/branches/shared-heap-multicore/bin/regression
U   mlton/branches/shared-heap-multicore/include/Makefile
U   mlton/branches/shared-heap-multicore/mlton/main/main.fun
U   mlton/branches/shared-heap-multicore/runtime/Makefile

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

Modified: mlton/branches/shared-heap-multicore/Makefile
===================================================================
--- mlton/branches/shared-heap-multicore/Makefile	2008-03-03 15:38:12 UTC (rev 6451)
+++ mlton/branches/shared-heap-multicore/Makefile	2008-03-03 15:38:28 UTC (rev 6452)
@@ -17,7 +17,7 @@
 INC := $(LIB)/include
 COMP := $(SRC)/mlton
 RUN := $(SRC)/runtime
-MLTON := $(BIN)/mlton
+MLTON := $(BIN)/multimlton
 AOUT := mlton-compile
 ifeq (mingw, $(TARGET_OS))
 EXE := .exe
@@ -39,14 +39,14 @@
 # If we're compiling with another version of MLton, then we want to do
 # another round of compilation so that we get a MLton built without
 # stubs.
-ifeq (other, $(shell if [ ! -x "$(BIN)/mlton" ]; then echo other; fi))
+ifeq (other, $(shell if [ ! -x "$(MLTON)" ]; then echo other; fi))
 	BOOTSTRAP_OTHER:=true
 else
 	BOOTSTRAP_OTHER:=false
 endif
 
 ifeq ($(origin VERSION), undefined)
-	VERSION := $(shell date +%Y%m%d)
+	VERSION := multi.$(shell date +%Y%m%d)
 endif
 ifeq ($(origin RELEASE), undefined)
 	RELEASE := 1
@@ -108,8 +108,8 @@
 .PHONY: constants
 constants:
 	@echo 'Creating constants file.'
-	"$(BIN)/mlton" -build-constants true >tmp.c
-	"$(BIN)/mlton" -output tmp tmp.c
+	"$(MLTON)" -build-constants true >tmp.c
+	"$(MLTON)" -output tmp tmp.c
 	./tmp >"$(LIB)/$(TARGET)/constants"
 	rm -f tmp tmp.c
 
@@ -228,7 +228,8 @@
 mlbpathmap:
 	touch "$(MLBPATHMAP)"
 	( echo 'MLTON_ROOT $$(LIB_MLTON_DIR)/sml';	\
-	  echo 'SML_LIB $$(LIB_MLTON_DIR)/sml'; ) 	\
+	  echo 'SML_LIB $$(LIB_MLTON_DIR)/sml';  	\
+	  echo 'WORK_QUEUE simpleworkqueue'; ) 		\
 		>>"$(MLBPATHMAP).tmp"
 	mv "$(MLBPATHMAP).tmp" "$(MLBPATHMAP)"
 
@@ -278,6 +279,10 @@
 	rm -rf "$(SOURCEDIR)"
 	rpm -ba --quiet --clean "$(TOPDIR)/SPECS/mlton.spec"
 
+.PHONY: include
+include:
+	$(CP) include/*.h "$(INC)/"
+
 .PHONY: runtime
 runtime:
 	@echo 'Compiling MLton runtime system for $(TARGET).'
@@ -289,8 +294,9 @@
 		basis-library/config/c/$(TARGET_ARCH)-$(TARGET_OS)/c-types.sml	
 	$(CP) runtime/gen/basis-ffi.sml \
 		basis-library/primitive/basis-ffi.sml
-	$(CP) runtime/bytecode/opcodes "$(LIB)/"
+	if [ -r runtime/bytecode/opcodes ] ; then $(CP) runtime/bytecode/opcodes "$(LIB)/"; fi
 	$(CP) runtime/*.h "$(INC)/"
+	$(CP) runtime/plpa/*.h "$(INC)/"
 	mv "$(INC)/c-types.h" "$(LIB)/$(TARGET)/include"
 	for d in basis basis/Real basis/Word gc platform util; do	\
 		mkdir -p "$(INC)/$$d";					\
@@ -410,16 +416,16 @@
 	mkdir -p "$(TLIB)" "$(TBIN)" "$(TMAN)"
 	$(CP) "$(LIB)/." "$(TLIB)/"
 	sed "/^lib=/s;.*;lib='$(prefix)/$(ULIB)';" 			\
-		<"$(BIN)/mlton" >"$(TBIN)/mlton"
+		<"$(MLTON)" >"$(TBIN)/mlton"
 	chmod a+x "$(TBIN)/mlton"
-	if [ -x "$(BIN)/mlton.trace" ]; then                            \
+	if [ -x "$(MLTON).trace" ]; then                            \
 		sed "/^lib=/s;.*;lib='$(prefix)/$(ULIB)';" 		\
-			<"$(BIN)/mlton.trace" >"$(TBIN)/mlton.trace";   \
+			<"$(MLTON).trace" >"$(TBIN)/mlton.trace";   \
 		chmod a+x "$(TBIN)/mlton.trace";                        \
 	fi
-	if [ -x "$(BIN)/mlton.debug" ]; then                            \
+	if [ -x "$(MLTON).debug" ]; then                            \
 		sed "/^lib=/s;.*;lib='$(prefix)/$(ULIB)';" 		\
-			<"$(BIN)/mlton.debug" >"$(TBIN)/mlton.debug";   \
+			<"$(MLTON).debug" >"$(TBIN)/mlton.debug";   \
 		chmod a+x "$(TBIN)/mlton.debug";                        \
 	fi
 	cd "$(BIN)" && $(CP) "$(LEX)$(EXE)" "$(NLFFIGEN)$(EXE)"		\

Modified: mlton/branches/shared-heap-multicore/bin/regression
===================================================================
--- mlton/branches/shared-heap-multicore/bin/regression	2008-03-03 15:38:12 UTC (rev 6451)
+++ mlton/branches/shared-heap-multicore/bin/regression	2008-03-03 15:38:28 UTC (rev 6452)
@@ -70,7 +70,7 @@
 src=`cd "$dir/.." && pwd`
 bin="$src/build/bin"
 lib="$src/build/lib"
-mlton="$bin/mlton"
+mlton="$bin/multimlton"
 if $cross; then
 	flags[${#flags[@]}]="-target"
 	flags[${#flags[@]}]="$crossTarget"

Modified: mlton/branches/shared-heap-multicore/include/Makefile
===================================================================
--- mlton/branches/shared-heap-multicore/include/Makefile	2008-03-03 15:38:12 UTC (rev 6451)
+++ mlton/branches/shared-heap-multicore/include/Makefile	2008-03-03 15:38:28 UTC (rev 6452)
@@ -7,6 +7,7 @@
  ##
 
 all:
+	make -C .. include
 
 .PHONY: clean
 clean:

Modified: mlton/branches/shared-heap-multicore/mlton/main/main.fun
===================================================================
--- mlton/branches/shared-heap-multicore/mlton/main/main.fun	2008-03-03 15:38:12 UTC (rev 6451)
+++ mlton/branches/shared-heap-multicore/mlton/main/main.fun	2008-03-03 15:38:28 UTC (rev 6452)
@@ -111,28 +111,16 @@
          end
 
 fun hasCodegen (cg) =
-   let
-      datatype z = datatype Control.Target.arch
+   let 
       datatype z = datatype Control.codegen
    in
-      case !Control.Target.arch of
-         AMD64 => (case cg of
-                      x86Codegen => false
-                    | _ => true)
-       | X86 => (case cg of
-                    amd64Codegen => false
-                  | _ => true)
-       | _ => (case cg of
-                  amd64Codegen => false
-                | x86Codegen => false
-                | _ => true)
+      case cg of
+        CCodegen => true
+      | _ => false
    end
 fun hasNativeCodegen () =
-   let
-      datatype z = datatype Control.codegen
-   in
-      hasCodegen amd64Codegen
-      orelse hasCodegen x86Codegen
+   let in
+      false 
    end
    
 

Modified: mlton/branches/shared-heap-multicore/runtime/Makefile
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/Makefile	2008-03-03 15:38:12 UTC (rev 6451)
+++ mlton/branches/shared-heap-multicore/runtime/Makefile	2008-03-03 15:38:28 UTC (rev 6452)
@@ -204,7 +204,7 @@
 	platform-gdb.o						\
 	platform/$(TARGET_OS)-gdb.o
 
-OMIT_BYTECODE := no
+OMIT_BYTECODE := yes
 ifeq ($(OMIT_BYTECODE), yes)
 else
   OBJS += bytecode/interpret.o




More information about the MLton-commit mailing list