summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-01-28 09:56:08 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-01-28 09:56:08 -0500
commitf78c454c6f46dd11c416e6c5515a9438c19cd506 (patch)
treee8d85a2bec92a14f719babb7d0400856a596eb89 /Makefile.am
parent0ec7908e6f4844fb71e51fbec122d47bde71b403 (diff)
First attempt to switch to Automake, to get shared libraries built in OSX
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am76
1 files changed, 76 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000..fc8787f0
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,76 @@
+BIN := @BIN@
+LIB := @LIB@
+INCLUDE := @INCLUDE@
+SITELISP := @SITELISP@
+
+LIB_UR := $(LIB)/ur
+LIB_C := $(LIB)/c
+LIB_JS := $(LIB)/js
+
+all-local: smlnj mlton
+
+SUBDIRS = src/c
+
+.PHONY: smlnj mlton package
+
+smlnj: src/urweb.cm
+mlton: bin/urweb
+
+clean-local:
+ rm -f src/*.mlton.grm.* src/*.mlton.lex.* \
+ src/urweb.cm src/urweb.mlb
+ rm -rf .cm src/.cm
+
+src/urweb.cm: src/prefix.cm src/sources
+ cat src/prefix.cm src/sources \
+ >src/urweb.cm
+
+src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb
+ cat src/prefix.mlb src/sources src/suffix.mlb \
+ | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig:\1.mlton.grm.sml/; y/:/\n/' \
+ | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \
+ >$@
+
+%.mlton.lex: %.lex
+ cp $< $@
+%.mlton.grm: %.grm
+ cp $< $@
+
+%.mlton.lex.sml: %.mlton.lex
+ mllex $<
+
+%.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm
+ mlyacc $<
+
+MLTON := mlton
+
+#ifdef DEBUG
+# MLTON += -const 'Exn.keepHistory true'
+#endif
+
+#ifdef PROFILE
+# MLTON += -profile $(PROFILE)
+#endif
+
+bin/urweb: src/compiler.mlb src/urweb.mlb src/*.sig src/*.sml \
+ src/urweb.mlton.lex.sml \
+ src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml
+ $(MLTON) -output $@ src/compiler.mlb
+
+install-exec-local:
+ mkdir -p $(BIN)
+ cp bin/urweb $(BIN)/
+ mkdir -p $(LIB_UR)
+ cp lib/ur/*.urs $(LIB_UR)/
+ cp lib/ur/*.ur $(LIB_UR)/
+ mkdir -p $(LIB_JS)
+ cp lib/js/*.js $(LIB_JS)/
+ mkdir -p $(INCLUDE)
+ cp include/*.h $(INCLUDE)/
+ mkdir -p $(SITELISP)
+ cp src/elisp/*.el $(SITELISP)/
+ ldconfig
+
+package:
+ hg archive -t tgz -X tests /tmp/urweb.tgz
+