diff --git a/hrc-makefile.inc b/hrc-makefile.inc index b204ab9..b8484e7 100644 --- a/hrc-makefile.inc +++ b/hrc-makefile.inc @@ -241,7 +241,8 @@ COMPILER_SRCS = \ COMPILER_STD_OPTS = @MLton -- \ -verbose 1 -runtime 'use-mmap true' \ -codegen native \ - -native-split 900000 -mlb-path-map /opt/mlton-20130715/sml-lib/mlb-path-map + -native-split 900000 \ + -mlb-path-map $(PWD)/sml-lib/mlb-path-map \ # The following don't work on 64-bit # -ieee-fp true -max-heap 800m @@ -304,14 +305,15 @@ HRC_SRCS = $(COMPILER_SRCS) $(HASKELL_SRCS) compiler/hrc.mlb compiler/hrc.sml hrc: $(HRC_EXE) -$(HRC_EXE): make-version $(HRC_SRCS) compiler/hrc.mlb +$(HRC_EXE): make-version $(HRC_SRCS) compiler/hrc.mlb sml-lib/mlb-path-map cd compiler; \ rm -f hrc.*.c hrc.*.s; \ mlton $(COMPILER_OPTS) -stop g $(HRC).mlb && \ mlton $(COMPILER_OPTS) -output ../$(HRC_EXE) hrc.*.c hrc.*.s && \ rm -f hrc.*.c hrc.*.s -### P LSR +sml-lib/mlb-path-map: + $(MAKE) -C sml-lib # Keep these in alphabetic order PLSR_SRCS = \ diff --git a/sml-lib/Makefile b/sml-lib/Makefile new file mode 100644 index 0000000..05eda30 --- /dev/null +++ b/sml-lib/Makefile @@ -0,0 +1,22 @@ +MLTON_SRC_URL="https://sourceforge.net/projects/mlton/files/mlton/20130715/mlton-20130715.src.tgz/download" +MLTON_BIN=$(shell which mlton) +MLTON_LIBDIR=$(abspath $(dir $(MLTON_BIN))/../lib/mlton/sml) +DIR_LIST=basis ckit-lib cml mllpt-lib mlnlffi-lib mlrisc-lib mlyacc-lib smlnj-lib + +mlb-path-map: mlton $(DIR_LIST) + @echo "MLTON_ROOT $(shell pwd)" > mlb-path-map + @echo "SML_LIB $(shell pwd)" >> mlb-path-map + +./mlton: + @echo Downloading mlton source and extract its directory lib/mlton to ./mlton. + curl -L $(MLTON_SRC_URL)|tar zxf - mlton-20130715/lib/mlton --strip-components=2 + +$(DIR_LIST): + @echo linking $@ from system mlton installation to ./$@ + @ln -s "$(MLTON_LIBDIR)/$@" . + +clean: + rm -f $(DIR_LIST) + +cleanall: clean + rm -rf mlton