comparison Makefile.in @ 378:168667cdaa95

Proper configuration and installation
author Adam Chlipala <adamc@hcoop.net>
date Sun, 19 Oct 2008 12:47:10 -0400
parents
children 0eb7bb4872d0
comparison
equal deleted inserted replaced
377:78358e5df273 378:168667cdaa95
1 BIN := @BIN@
2 LIB := @LIB@
3 INCLUDE := @INCLUDE@
4 SITELISP := @SITELISP@
5
6 LIB_UR := $(LIB)/ur
7 LIB_C := $(LIB)/c
8
9 all: smlnj mlton c
10
11 .PHONY: all smlnj mlton c clean install
12
13 smlnj: src/urweb.cm
14 mlton: bin/urweb
15 c: clib/urweb.o clib/driver.o
16
17 clean:
18 rm -f src/*.mlton.grm.* src/*.mlton.lex.* \
19 src/urweb.cm src/urweb.mlb \
20 clib/*.o
21 rm -rf .cm src/.cm
22
23 clib/urweb.o: src/c/urweb.c
24 gcc -O3 -I include -c src/c/urweb.c -o clib/urweb.o
25
26 clib/driver.o: src/c/driver.c
27 gcc -O3 -I include -c src/c/driver.c -o clib/driver.o
28
29 src/urweb.cm: src/prefix.cm src/sources
30 cat src/prefix.cm src/sources \
31 >src/urweb.cm
32
33 src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb
34 cat src/prefix.mlb src/sources src/suffix.mlb \
35 | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig\n\1.mlton.grm.sml/' \
36 | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \
37 >src/urweb.mlb
38
39 %.mlton.lex: %.lex
40 cp $< $@
41 %.mlton.grm: %.grm
42 cp $< $@
43
44 %.mlton.lex.sml: %.mlton.lex
45 mllex $<
46
47 %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm
48 mlyacc $<
49
50 MLTON := mlton
51
52 ifdef DEBUG
53 MLTON += -const 'Exn.keepHistory true'
54 endif
55
56 bin/urweb: src/urweb.mlb src/*.sig src/*.sml \
57 src/urweb.mlton.lex.sml \
58 src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml
59 $(MLTON) -output $@ src/urweb.mlb
60
61 install:
62 cp bin/urweb $(BIN)/
63 mkdir -p $(LIB_UR)
64 cp lib/*.urs $(LIB_UR)/
65 cp lib/*.ur $(LIB_UR)/
66 mkdir -p $(LIB_C)
67 cp clib/*.o $(LIB_C)/
68 mkdir -p $(INCLUDE)
69 cp include/*.h $(INCLUDE)/
70 mkdir -p $(SITELISP)
71 cp src/elisp/*.el $(SITELISP)/