[MLton-commit] r7346

Wesley Terpstra wesley at mlton.org
Mon Nov 2 10:43:30 PST 2009


Hack the windows version


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

U   mlton/trunk/package/mingw/Makefile

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

Modified: mlton/trunk/package/mingw/Makefile
===================================================================
--- mlton/trunk/package/mingw/Makefile	2009-11-02 18:25:14 UTC (rev 7345)
+++ mlton/trunk/package/mingw/Makefile	2009-11-02 18:43:29 UTC (rev 7346)
@@ -6,12 +6,15 @@
 PKG_WIXOBJ=$(patsubst %,%.wixobj,$(PKG))
 
 ifeq (,$(VERSION))
-all:
-	@echo Specific a release VERSION.
-else
-all:	MLton-$(VERSION).exe MLton-$(VERSION).msi
+VERSION := $(shell date +%Y%m%d)
 endif
 
+# Windows versions have to be (0-255).(0-255).(0-65536)
+# So lets just use YY.MM.DD for the version (leading 0s stripped)
+WINVERSION := $(shell echo $(VERSION) | sed -r 's/20(..)(..)(..)/\1.\2.\3/;s/0*([1-9]+)/\1/g')
+
+all:	MLton-$(VERSION).exe MLton-$(VERSION).msi
+
 MLton-$(VERSION).exe:	data.7z
 	cat 7zS.sfx MLton.conf data.7z > $@
 
@@ -35,7 +38,8 @@
 
 .PHONY: mlton.wxs
 mlton.wxs:	mlton.wxs.in guid.exe
-	sed "s/@VERSION@/$(VERSION)/g;s/@GUID@/`./guid $(VERSION)`/g" < $< > $@
+	sed "s/@VERSION@/$(WINVERSION)/g;s/@GUID@/`./guid $(VERSION)`/g" \
+	< $< > $@
 
 self32.lst:
 	rm -rf staging




More information about the MLton-commit mailing list