[MLton-commit] r7130

Matthew Fluet fluet at mlton.org
Wed Jun 10 20:23:46 PDT 2009


Remove some unnecessary variables; reorder targets.
----------------------------------------------------------------------

U   mlton/trunk/mlton/Makefile

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

Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile	2009-06-11 03:23:41 UTC (rev 7129)
+++ mlton/trunk/mlton/Makefile	2009-06-11 03:23:46 UTC (rev 7130)
@@ -12,10 +12,8 @@
 HOST_ARCH := $(shell "$(SRC)/bin/host-arch")
 HOST_OS := $(shell "$(SRC)/bin/host-os")
 LIB := $(BUILD)/lib
-MLTON := mlton
 TARGET := self
 AOUT := mlton-compile
-UP := upgrade-basis.sml
 PATH := $(BIN):$(shell echo $$PATH)
 
 FLAGS := @MLton ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
@@ -53,13 +51,19 @@
 
 SOURCES :=			\
 	$(FILE)			\
-	$(UP)			\
+	upgrade-basis.sml	\
 	$(FRONT_END_SOURCES)	\
 	$(shell if [ -r $(FILE) ]; then mlton -stop f $(FILE); fi)
 
 .PHONY: all
 all: $(AOUT)
 
+control/version.sml: control/version_sml.src
+	cat control/version_sml.src |						\
+		sed "s/\(.*\)MLTONBUILDDATE\(.*\)/\1`date`\2/" |		\
+		sed "s/\(.*\)MLTONBUILDNODE\(.*\)/\1`uname -n`\2/" >		\
+		control/version.sml
+
 front-end/ml.lex.sml: front-end/ml.lex
 	$(MAKE) -C front-end ml.lex.sml
 front-end/ml.grm.sig front-end/ml.grm.sml: front-end/ml.grm
@@ -69,11 +73,10 @@
 front-end/mlb.grm.sig front-end/mlb.grm.sml: front-end/mlb.grm
 	$(MAKE) -C front-end mlb.grm.sig mlb.grm.sml
 
-control/version.sml: control/version_sml.src
-	cat control/version_sml.src |						\
-		sed "s/\(.*\)MLTONBUILDDATE\(.*\)/\1`date`\2/" |		\
-		sed "s/\(.*\)MLTONBUILDNODE\(.*\)/\1`uname -n`\2/" >		\
-		control/version.sml
+# Pass $(PATH) to upgrade-basis because it is run via
+# #!/usr/bin/env bash, which resets the path.
+upgrade-basis.sml:
+	"$(SRC)/bin/upgrade-basis" '$(PATH)' "$(HOST_ARCH)" "$(HOST_OS)" >upgrade-basis.sml
 
 mlton-stubs.mlb: $(shell mlton -stop f ../lib/stubs/mlton-stubs/sources.mlb) $(shell mlton -stop f mlton.mlb)
 	(									\
@@ -81,7 +84,7 @@
 		echo '$$(SML_LIB)/basis/sml-nj.mlb';				\
 		echo '$$(SML_LIB)/basis/mlton.mlb';				\
 		echo '$$(SML_LIB)/basis/basis.mlb';				\
-		echo '$(UP)';							\
+		echo 'upgrade-basis.sml';					\
 		mlton -stop f mlton.mlb | grep -v 'mlb$$' | grep 'mlyacc';	\
 		mlton -stop f ../lib/stubs/mlton-stubs/sources.mlb |		\
 			grep -v 'mlb$$' | 					\
@@ -93,29 +96,18 @@
 			grep -v 'mlyacc';					\
 	) > mlton-stubs.mlb
 
-
 $(AOUT): $(SOURCES)
-	rm -f $(UP)
-	$(MAKE) $(UP)
+	rm -f upgrade-basis.sml
+	$(MAKE) upgrade-basis.sml
 	rm -f control/version.sml
 	$(MAKE) control/version.sml
 	@echo 'Compiling mlton (takes a while)'
 	mlton $(FLAGS) $(FILE)
 
-# Pass $(PATH) to upgrade-basis because it is run via #!/usr/bin/env
-# bash, which resets the path.
-$(UP):
-	"$(SRC)/bin/upgrade-basis" '$(PATH)' "$(HOST_ARCH)" "$(HOST_OS)" >$(UP)
-
 .PHONY: def-use
 def-use:
 	mlton $(FLAGS) -stop tc -prefer-abs-paths true -show-def-use mlton.def-use $(FILE)
 
-.PHONY: warn
-warn:
-	mlton -stop tc -default-ann 'warnUnused true' $(FILE) \
-		>/tmp/z.warn 2>&1
-
 .PHONY: clean
 clean:
 	../bin/clean




More information about the MLton-commit mailing list