summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorGravatar Anders Kaseorg <andersk@mit.edu>2013-11-22 09:36:14 -0500
committerGravatar Anders Kaseorg <andersk@mit.edu>2013-11-22 09:36:14 -0500
commit9e813736bd6839d308850ecb90f0d9879232ef9f (patch)
tree97f00f341bfce7c33604e4f0df24d01515d66593 /Makefile.am
parente5b80fe0886a6753cf2cad4cb5e1d34fc2761472 (diff)
Allow building in a separate build directory
Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- Makefile.am | 30 +++--- src/c/Makefile.am | 2 +- src/compiler.mlb | 2 +- src/sources | 302 +++++++++++++++++++++++++++--------------------------- 4 files changed, 168 insertions(+), 168 deletions(-)
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am30
1 files changed, 15 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am
index fa3ee896..18af883c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,14 +26,12 @@ clean-local:
rm -rf .cm src/.cm
src/urweb.cm: src/prefix.cm src/sources
- cat src/prefix.cm src/sources \
- >src/urweb.cm
+ cat $^ > $@
src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb
- cat src/prefix.mlb src/sources src/suffix.mlb \
- | sed -e 's/^\(.*\).grm$$/\1.mlton.grm.sig:\1.mlton.grm.sml/' -e 'y/:/\n/' \
- -e 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \
- >$@
+ sed -e 's/^\(.*\).grm$$/$$(BUILD)\/\1.mlton.grm.sig:\1.mlton.grm.sml/' -e 'y/:/\n/' \
+ -e 's/^\(.*\).lex$$/$$(BUILD)\/\1.mlton.lex.sml/' \
+ $^ > $@
src/urweb.mlton.lex: src/urweb.lex
cp $< $@
@@ -56,34 +54,36 @@ MLTON = mlton
# MLTON += -profile $(PROFILE)
#endif
-bin/urweb: xml/entities.sml \
- src/compiler.mlb src/urweb.mlb src/*.sig src/*.sml \
+bin/urweb: src/compiler.mlb xml/entities.sml \
+ src/urweb.mlb $(srcdir)/src/*.sig $(srcdir)/src/*.sml src/config.sml \
src/urweb.mlton.lex.sml \
src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml
- $(MLTON) $(MLTONARGS) -output $@ src/compiler.mlb
+ mkdir -p bin
+ $(MLTON) $(MLTONARGS) -mlb-path-var 'SRC $(abs_srcdir)/src' -mlb-path-var 'BUILD $(abs_builddir)/src' -output $@ $<
xml/entities.sml: xml/parse xml/xhtml-lat1.ent xml/xhtml-special.ent xml/xhtml-symbol.ent
$^ > $@
xml/parse: xml/parse.sml
- $(MLTON) $(MLTONARGS) xml/parse.sml
+ mkdir -p xml
+ $(MLTON) $(MLTONARGS) -output $@ $<
install-exec-emacs:
if USE_EMACS
mkdir -p $(DESTDIR)$(SITELISP)
- cp src/elisp/*.el $(DESTDIR)$(SITELISP)/
+ cp $(srcdir)/src/elisp/*.el $(DESTDIR)$(SITELISP)/
endif
install-exec-local-main:
mkdir -p $(DESTDIR)$(BIN)
install bin/urweb $(DESTDIR)$(BIN)/
mkdir -p $(DESTDIR)$(LIB_UR)
- cp lib/ur/*.urs $(DESTDIR)$(LIB_UR)/
- cp lib/ur/*.ur $(DESTDIR)$(LIB_UR)/
+ cp $(srcdir)/lib/ur/*.urs $(DESTDIR)$(LIB_UR)/
+ cp $(srcdir)/lib/ur/*.ur $(DESTDIR)$(LIB_UR)/
mkdir -p $(DESTDIR)$(LIB_JS)
- cp lib/js/*.js $(DESTDIR)$(LIB_JS)/
+ cp $(srcdir)/lib/js/*.js $(DESTDIR)$(LIB_JS)/
mkdir -p $(DESTDIR)$(INCLUDE)
- cp include/urweb/*.h $(DESTDIR)$(INCLUDE)/
+ cp $(srcdir)/include/urweb/*.h $(DESTDIR)$(INCLUDE)/
install-exec-local: install-exec-local-main install-exec-emacs
-ldconfig