Fix use of wrong username for Rmuser
[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
5ee41dd0 8mlton: bin/domtool-server bin/domtool-client bin/domtool-slave bin/domtool-admin
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
7a2b27f0
AC
39MAKE_MLB_BASE := cat src/prefix.mlb src/sources src/suffix.mlb \
40 | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
41 | sed 's/^\(.*\).lex$$/\1.lex.sml/'
42
a49a9bfb 43src/domtool-server.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 44 $(MAKE_MLB_BASE) >src/domtool-server.mlb
a49a9bfb
AC
45 echo "main-server.sml" >>src/domtool-server.mlb
46
361a1e7f 47src/domtool-client.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 48 $(MAKE_MLB_BASE) >src/domtool-client.mlb
361a1e7f
AC
49 echo "main-client.sml" >>src/domtool-client.mlb
50
1c246434 51src/domtool-slave.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 52 $(MAKE_MLB_BASE) >src/domtool-slave.mlb
1c246434
AC
53 echo "main-slave.sml" >>src/domtool-slave.mlb
54
5ee41dd0
AC
55src/domtool-admin.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
56 $(MAKE_MLB_BASE) >src/domtool-admin.mlb
57 echo "main-admin.sml" >>src/domtool-admin.mlb
58
559e89e9
AC
59openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
60 cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
61 -cm libssl.h.cm -D__builtin_va_list="void*" \
62 ../openssl_sml.h
a49a9bfb
AC
63
64openssl/mlton/FFI/libssl.h.mlb: openssl/openssl_sml.h
65 cd openssl/mlton ; mlnlffigen -dir FFI -libhandle LibsslH.libh -include ../libssl-h.sml \
66 -mlbfile libssl.h.mlb -cppopt -D__builtin_va_list="void*" \
67 ../openssl_sml.h
68
69%.lex.sml: %.lex
a088cea6 70 mllex $<
a49a9bfb
AC
71
72%.grm.sig %.grm.sml: %.grm
a088cea6 73 mlyacc $<
a49a9bfb 74
7a2b27f0
AC
75COMMON_MLTON_DEPS := openssl/mlton/FFI/libssl.h.mlb \
76 src/domtool.lex.sml \
77 src/domtool.grm.sig src/domtool.grm.sml \
78 $(COMMON_DEPS) src/*.sig src/*.sml \
79 src/plugins/*.sig src/plugins/*.sml
80
81bin/domtool-server: $(COMMON_MLTON_DEPS) src/domtool-server.mlb
a49a9bfb 82 mlton -output bin/domtool-server -link-opt -ldl src/domtool-server.mlb
361a1e7f 83
7a2b27f0 84bin/domtool-client: $(COMMON_MLTON_DEPS) src/domtool-client.mlb
361a1e7f
AC
85 mlton -output bin/domtool-client -link-opt -ldl src/domtool-client.mlb
86
7a2b27f0 87bin/domtool-slave: $(COMMON_MLTON_DEPS) src/domtool-slave.mlb
1c246434
AC
88 mlton -output bin/domtool-slave -link-opt -ldl src/domtool-slave.mlb
89
5ee41dd0
AC
90bin/domtool-admin: $(COMMON_MLTON_DEPS) src/domtool-admin.mlb
91 mlton -output bin/domtool-admin -link-opt -ldl src/domtool-admin.mlb
92
361a1e7f 93install:
27e20924 94 cp scripts/domtool-publish /usr/local/sbin/
8ae99fef
AC
95 cp scripts/domtool-reset-global /usr/local/sbin/
96 cp scripts/domtool-reset-local /usr/local/sbin/
27e20924
AC
97 cp openssl/openssl_sml.so /usr/local/lib/
98 cp bin/domtool-server /usr/local/sbin/
1c246434 99 cp bin/domtool-slave /usr/local/sbin/
27e20924 100 cp bin/domtool-client /usr/local/bin/domtool
5ee41dd0 101 cp bin/domtool-admin /usr/local/bin/
15e529d6
AC
102
103.PHONY: grab_lib
104
105grab_lib:
106 rsync --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/