Remove ACL entries for users with no permissions
[hcoop/domtool2.git] / Makefile
CommitLineData
a49a9bfb 1all: mlton
0d2ce070 2
a49a9bfb 3COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \
9c8a9ef4
AM
4 openssl/openssl_sml.so config.sml
5
6config.sml:
7 echo -e 'structure Config :> CONFIG = struct\nopen ConfigDefault\nend' > $@
a49a9bfb 8
361a1e7f 9.PHONY: all mlton smlnj install
a49a9bfb 10
44a5ce2f 11mlton: bin/domtool-server bin/domtool-client bin/domtool-slave \
2bc5ed22 12 bin/domtool-admin bin/domtool-doc bin/dbtool bin/vmail \
7b0b0440 13 bin/smtplog bin/setsa
a49a9bfb
AC
14
15smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm src/domtool.cm
0d2ce070
AC
16
17configDefault/config.sig: src/config.sig.header \
8df2e702
AC
18 configDefault/*.csg configDefault/*.cfs \
19 src/config.sig.footer
20 cat configDefault/*.csg \
21 src/config.sig.header \
0d2ce070
AC
22 configDefault/*.cfs \
23 src/config.sig.footer \
24 >configDefault/config.sig
25
26configDefault/configDefault.sml: src/configDefault.sml.header \
27 configDefault/*.cfg src/configDefault.sml.footer
28 cat src/configDefault.sml.header \
29 configDefault/*.cfg \
30 src/configDefault.sml.footer \
31 >configDefault/configDefault.sml
32
559e89e9
AC
33openssl/openssl_sml.o: openssl/openssl_sml.c
34 gcc -fPIC -c openssl/openssl_sml.c -o openssl/openssl_sml.o
35
36openssl/openssl_sml.so: openssl/openssl_sml.o
37 gcc -shared -Wl,-soname,openssl_sml.so \
38 -o openssl/openssl_sml.so \
39 openssl/openssl_sml.o -lssl
40
d541c618 41src/domtool.cm: src/prefix.cm src/sources
a49a9bfb
AC
42 cat src/prefix.cm src/sources >src/domtool.cm
43
7a2b27f0
AC
44MAKE_MLB_BASE := cat src/prefix.mlb src/sources src/suffix.mlb \
45 | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
46 | sed 's/^\(.*\).lex$$/\1.lex.sml/'
47
d541c618 48src/domtool-server.mlb: src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 49 $(MAKE_MLB_BASE) >src/domtool-server.mlb
a49a9bfb
AC
50 echo "main-server.sml" >>src/domtool-server.mlb
51
d541c618 52src/domtool-client.mlb: src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 53 $(MAKE_MLB_BASE) >src/domtool-client.mlb
361a1e7f
AC
54 echo "main-client.sml" >>src/domtool-client.mlb
55
d541c618 56src/domtool-slave.mlb: src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 57 $(MAKE_MLB_BASE) >src/domtool-slave.mlb
1c246434
AC
58 echo "main-slave.sml" >>src/domtool-slave.mlb
59
d541c618 60src/domtool-admin.mlb: src/prefix.mlb src/sources src/suffix.mlb
5ee41dd0
AC
61 $(MAKE_MLB_BASE) >src/domtool-admin.mlb
62 echo "main-admin.sml" >>src/domtool-admin.mlb
63
d541c618 64src/domtool-doc.mlb: src/prefix.mlb src/sources src/suffix.mlb
44a5ce2f
AC
65 $(MAKE_MLB_BASE) >src/domtool-doc.mlb
66 echo "main-doc.sml" >>src/domtool-doc.mlb
67
d541c618
AC
68src/dbtool.mlb: src/prefix.mlb src/sources src/suffix.mlb
69 $(MAKE_MLB_BASE) >src/dbtool.mlb
70 echo "main-dbtool.sml" >>src/dbtool.mlb
71
08688401
AC
72src/vmail.mlb: src/prefix.mlb src/sources src/suffix.mlb
73 $(MAKE_MLB_BASE) >src/vmail.mlb
74 echo "main-vmail.sml" >>src/vmail.mlb
75
2e96b9d4
AC
76src/setsa.mlb: src/prefix.mlb src/sources src/suffix.mlb
77 $(MAKE_MLB_BASE) >src/setsa.mlb
78 echo "main-setsa.sml" >>src/setsa.mlb
79
2bc5ed22
AC
80src/smtplog.mlb: src/prefix.mlb src/sources src/suffix.mlb
81 $(MAKE_MLB_BASE) >src/smtplog.mlb
82 echo "main-smtplog.sml" >>src/smtplog.mlb
83
559e89e9
AC
84openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
85 cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
86 -cm libssl.h.cm -D__builtin_va_list="void*" \
87 ../openssl_sml.h
a49a9bfb
AC
88
89openssl/mlton/FFI/libssl.h.mlb: openssl/openssl_sml.h
90 cd openssl/mlton ; mlnlffigen -dir FFI -libhandle LibsslH.libh -include ../libssl-h.sml \
91 -mlbfile libssl.h.mlb -cppopt -D__builtin_va_list="void*" \
92 ../openssl_sml.h
93
94%.lex.sml: %.lex
a088cea6 95 mllex $<
a49a9bfb
AC
96
97%.grm.sig %.grm.sml: %.grm
a088cea6 98 mlyacc $<
a49a9bfb 99
7a2b27f0
AC
100COMMON_MLTON_DEPS := openssl/mlton/FFI/libssl.h.mlb \
101 src/domtool.lex.sml \
102 src/domtool.grm.sig src/domtool.grm.sml \
103 $(COMMON_DEPS) src/*.sig src/*.sml \
9ffe2f0f
AC
104 src/plugins/*.sig src/plugins/*.sml \
105 src/mail/*.sig src/mail/*.sml
7a2b27f0 106
e0b80e65
AC
107MLTON := mlton -link-opt -ldl
108
109ifdef DEBUG
110 MLTON += -const 'Exn.keepHistory true'
111endif
112
7a2b27f0 113bin/domtool-server: $(COMMON_MLTON_DEPS) src/domtool-server.mlb
e0b80e65 114 $(MLTON) -output bin/domtool-server src/domtool-server.mlb
361a1e7f 115
7a2b27f0 116bin/domtool-client: $(COMMON_MLTON_DEPS) src/domtool-client.mlb
e0b80e65 117 $(MLTON) -output bin/domtool-client src/domtool-client.mlb
361a1e7f 118
7a2b27f0 119bin/domtool-slave: $(COMMON_MLTON_DEPS) src/domtool-slave.mlb
e0b80e65 120 $(MLTON) -output bin/domtool-slave src/domtool-slave.mlb
1c246434 121
5ee41dd0 122bin/domtool-admin: $(COMMON_MLTON_DEPS) src/domtool-admin.mlb
e0b80e65 123 $(MLTON) -output bin/domtool-admin src/domtool-admin.mlb
5ee41dd0 124
44a5ce2f 125bin/domtool-doc: $(COMMON_MLTON_DEPS) src/domtool-doc.mlb
e0b80e65 126 $(MLTON) -output bin/domtool-doc src/domtool-doc.mlb
44a5ce2f 127
d541c618 128bin/dbtool: $(COMMON_MLTON_DEPS) src/dbtool.mlb
e0b80e65 129 $(MLTON) -output bin/dbtool src/dbtool.mlb
d541c618 130
08688401 131bin/vmail: $(COMMON_MLTON_DEPS) src/vmail.mlb
e0b80e65 132 $(MLTON) -output bin/vmail src/vmail.mlb
08688401 133
2e96b9d4 134bin/setsa: $(COMMON_MLTON_DEPS) src/setsa.mlb
ac64d96d 135 $(MLTON) -output bin/setsa src/setsa.mlb
2e96b9d4 136
2bc5ed22 137bin/smtplog: $(COMMON_MLTON_DEPS) src/smtplog.mlb
e0b80e65 138 $(MLTON) -output bin/smtplog src/smtplog.mlb
2bc5ed22 139
361a1e7f 140install:
27e20924 141 cp scripts/domtool-publish /usr/local/sbin/
8ae99fef
AC
142 cp scripts/domtool-reset-global /usr/local/sbin/
143 cp scripts/domtool-reset-local /usr/local/sbin/
385c3534
AC
144 cp scripts/domtool-adduser /usr/local/bin/
145 cp scripts/domtool-addcert /usr/local/bin/
146 cp scripts/domtool-addacl /usr/local/bin/
147 cp scripts/domtool-rmuser /usr/local/bin/
62260c5f
AC
148 cp scripts/domtool-admin-sudo /usr/local/bin/
149 cp scripts/domtool-server-logged /usr/local/bin/
c9731b9b
AC
150 cp scripts/domtool-slave-logged /usr/local/bin/
151 cp scripts/domtool-server /etc/init.d/
152 cp scripts/domtool-slave /etc/init.d/
27e20924 153 cp openssl/openssl_sml.so /usr/local/lib/
76bad1b2
AC
154 -cp bin/domtool-server /usr/local/sbin/
155 -cp bin/domtool-slave /usr/local/sbin/
156 -cp bin/domtool-client /usr/local/bin/domtool
157 -cp bin/domtool-admin /usr/local/bin/
158 -cp bin/domtool-doc /usr/local/bin/
d541c618 159 -cp bin/dbtool /usr/local/bin/
08688401 160 -cp bin/vmail /usr/local/bin/
2e96b9d4 161 -cp bin/setsa /usr/local/bin/
2bc5ed22 162 -cp bin/smtplog /usr/local/bin/
d541c618 163 cp src/plugins/domtool-postgres /usr/local/sbin/
ae147938 164 cp src/plugins/domtool-mysql /usr/local/sbin/
15e529d6
AC
165
166.PHONY: grab_lib
167
168grab_lib:
728f7033 169 rsync -r --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/