Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Make the downloading of extra mlton sml lib as part of build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul H. Liu committed Apr 11, 2017
1 parent 67999f6 commit de4ab2e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hrc-makefile.inc
Expand Up @@ -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

Expand Down Expand Up @@ -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 = \
Expand Down
22 changes: 22 additions & 0 deletions 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

0 comments on commit de4ab2e

Please sign in to comment.