Apache log directory creation
[hcoop/domtool2.git] / Makefile
CommitLineData
a49a9bfb 1all: mlton
0d2ce070 2
a49a9bfb
AC
3COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \
4 openssl/openssl_sml.so
5
361a1e7f 6.PHONY: all mlton smlnj install
a49a9bfb 7
1c246434 8mlton: bin/domtool-server bin/domtool-client bin/domtool-slave
a49a9bfb
AC
9
10smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm src/domtool.cm
0d2ce070
AC
11
12configDefault/config.sig: src/config.sig.header \
8df2e702
AC
13 configDefault/*.csg configDefault/*.cfs \
14 src/config.sig.footer
15 cat configDefault/*.csg \
16 src/config.sig.header \
0d2ce070
AC
17 configDefault/*.cfs \
18 src/config.sig.footer \
19 >configDefault/config.sig
20
21configDefault/configDefault.sml: src/configDefault.sml.header \
22 configDefault/*.cfg src/configDefault.sml.footer
23 cat src/configDefault.sml.header \
24 configDefault/*.cfg \
25 src/configDefault.sml.footer \
26 >configDefault/configDefault.sml
27
559e89e9
AC
28openssl/openssl_sml.o: openssl/openssl_sml.c
29 gcc -fPIC -c openssl/openssl_sml.c -o openssl/openssl_sml.o
30
31openssl/openssl_sml.so: openssl/openssl_sml.o
32 gcc -shared -Wl,-soname,openssl_sml.so \
33 -o openssl/openssl_sml.so \
34 openssl/openssl_sml.o -lssl
35
a49a9bfb
AC
36src/domtool.cm: Makefile src/prefix.cm src/sources
37 cat src/prefix.cm src/sources >src/domtool.cm
38
39src/domtool-server.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
40 cat src/prefix.mlb src/sources src/suffix.mlb \
41 | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
42 | sed 's/^\(.*\).lex$$/\1.lex.sml/' >src/domtool-server.mlb
43 echo "main-server.sml" >>src/domtool-server.mlb
44
361a1e7f
AC
45src/domtool-client.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
46 cat src/prefix.mlb src/sources src/suffix.mlb \
47 | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
48 | sed 's/^\(.*\).lex$$/\1.lex.sml/' >src/domtool-client.mlb
49 echo "main-client.sml" >>src/domtool-client.mlb
50
1c246434
AC
51src/domtool-slave.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
52 cat src/prefix.mlb src/sources src/suffix.mlb \
53 | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
54 | sed 's/^\(.*\).lex$$/\1.lex.sml/' >src/domtool-slave.mlb
55 echo "main-slave.sml" >>src/domtool-slave.mlb
56
559e89e9
AC
57openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
58 cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
59 -cm libssl.h.cm -D__builtin_va_list="void*" \
60 ../openssl_sml.h
a49a9bfb
AC
61
62openssl/mlton/FFI/libssl.h.mlb: openssl/openssl_sml.h
63 cd openssl/mlton ; mlnlffigen -dir FFI -libhandle LibsslH.libh -include ../libssl-h.sml \
64 -mlbfile libssl.h.mlb -cppopt -D__builtin_va_list="void*" \
65 ../openssl_sml.h
66
67%.lex.sml: %.lex
a088cea6 68 mllex $<
a49a9bfb
AC
69
70%.grm.sig %.grm.sml: %.grm
a088cea6 71 mlyacc $<
a49a9bfb
AC
72
73bin/domtool-server: openssl/mlton/FFI/libssl.h.mlb \
74 src/domtool-server.mlb src/domtool.lex.sml \
75 src/domtool.grm.sig src/domtool.grm.sml \
82a0d609
AC
76 $(COMMON_DEPS) src/*.sig src/*.sml \
77 src/plugins/*.sig src/plugins/*.sml
a49a9bfb 78 mlton -output bin/domtool-server -link-opt -ldl src/domtool-server.mlb
361a1e7f
AC
79
80bin/domtool-client: openssl/mlton/FFI/libssl.h.mlb \
81 src/domtool-client.mlb src/domtool.lex.sml \
82 src/domtool.grm.sig src/domtool.grm.sml \
82a0d609
AC
83 $(COMMON_DEPS) src/*.sig src/*.sml \
84 src/plugins/*.sig src/plugins/*.sml
361a1e7f
AC
85 mlton -output bin/domtool-client -link-opt -ldl src/domtool-client.mlb
86
1c246434
AC
87bin/domtool-slave: openssl/mlton/FFI/libssl.h.mlb \
88 src/domtool-slave.mlb src/domtool.lex.sml \
89 src/domtool.grm.sig src/domtool.grm.sml \
722e651b
AC
90 $(COMMON_DEPS) src/*.sig src/*.sml \
91 src/plugins/*.sig src/plugins/*.sml
1c246434
AC
92 mlton -output bin/domtool-slave -link-opt -ldl src/domtool-slave.mlb
93
361a1e7f 94install:
27e20924
AC
95 cp scripts/domtool-publish /usr/local/sbin/
96 cp openssl/openssl_sml.so /usr/local/lib/
97 cp bin/domtool-server /usr/local/sbin/
1c246434 98 cp bin/domtool-slave /usr/local/sbin/
27e20924 99 cp bin/domtool-client /usr/local/bin/domtool
15e529d6
AC
100
101.PHONY: grab_lib
102
103grab_lib:
104 rsync --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/