mod_auth_kerb: Enabled KDC Verification and Negotiate
[hcoop/domtool2.git] / Makefile
CommitLineData
2679ec89
CE
1# Supported flags
2# BUILD32=1 Target 32-bit x86 (Doesn't Work)
3# TC=1 Stop after typchecking when building using mlton
4# DEBUG=1 Keep debugging information when building using mlton
5
6b718954 6all: mlton bin/vmailpasswd elisp/domtool-tables.el
7aa78013
AC
7
8bin/vmailpasswd: src/mail/vmailpasswd.c
2679ec89
CE
9 $(CC) $(CFLAGS) -lcrypt -o $@ $<
10
11ifeq ($(BUILD32), 1)
12 CFLAGS += -m32
13endif
0d2ce070 14
a49a9bfb 15COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \
931aae14 16 openssl/openssl_sml.so pcre/pcre_sml.so config.sml
9c8a9ef4 17
4542571e
AC
18EMACS_DIR := /usr/local/share/emacs/site-lisp/domtool-mode
19
2679ec89
CE
20clean:
21 rm -f bin/*
22 rm -f openssl/openssl_sml.so
23 rm -f openssl/openssl_sml.o
24 rm -f pcre/pcre_sml.so
25 rm -f pcre/pcre_sml.o
26
9c8a9ef4 27config.sml:
883dd79c 28 /bin/echo -e 'structure Config :> CONFIG = struct\nopen ConfigDefault\nend' > $@
a49a9bfb 29
690a19c3 30.PHONY: all mlton smlnj install install_sos
a49a9bfb 31
44a5ce2f 32mlton: bin/domtool-server bin/domtool-client bin/domtool-slave \
2bc5ed22 33 bin/domtool-admin bin/domtool-doc bin/dbtool bin/vmail \
a8e88df7 34 bin/smtplog bin/setsa bin/mysql-fixperms bin/webbw bin/domtool-tail \
b3f18c35 35 bin/fwtool bin/domtool-config
a49a9bfb 36
931aae14
AC
37smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm pcre/smlnj/FFI/libpcre.h.cm \
38 src/domtool.cm
979844d5 39 CFLAGS += -m32
0d2ce070 40
979844d5 41configDefault/config.sig: config/core/core.sig src/config.sig.header \
8df2e702
AC
42 configDefault/*.csg configDefault/*.cfs \
43 src/config.sig.footer
44 cat configDefault/*.csg \
45 src/config.sig.header \
0d2ce070
AC
46 configDefault/*.cfs \
47 src/config.sig.footer \
48 >configDefault/config.sig
49
979844d5 50configDefault/configDefault.sml: config/core/core.sml src/configDefault.sml.header \
0d2ce070
AC
51 configDefault/*.cfg src/configDefault.sml.footer
52 cat src/configDefault.sml.header \
53 configDefault/*.cfg \
54 src/configDefault.sml.footer \
55 >configDefault/configDefault.sml
56
559e89e9 57openssl/openssl_sml.o: openssl/openssl_sml.c
2679ec89 58 gcc $(CFLAGS) -fPIC -c openssl/openssl_sml.c -o openssl/openssl_sml.o
559e89e9
AC
59
60openssl/openssl_sml.so: openssl/openssl_sml.o
2679ec89 61 gcc $(CFLAGS) -shared -Wl,-soname,openssl_sml.so \
559e89e9
AC
62 -o openssl/openssl_sml.so \
63 openssl/openssl_sml.o -lssl
64
931aae14 65pcre/pcre_sml.o: pcre/pcre_sml.c
2679ec89 66 gcc $(CFLAGS) -fPIC -c pcre/pcre_sml.c -o pcre/pcre_sml.o
931aae14
AC
67
68pcre/pcre_sml.so: pcre/pcre_sml.o
2679ec89 69 gcc $(CFLAGS) -shared -Wl,-soname,pcre_sml.so \
931aae14
AC
70 -o pcre/pcre_sml.so \
71 pcre/pcre_sml.o -lpcre
72
d541c618 73src/domtool.cm: src/prefix.cm src/sources
a49a9bfb
AC
74 cat src/prefix.cm src/sources >src/domtool.cm
75
7a2b27f0
AC
76MAKE_MLB_BASE := cat src/prefix.mlb src/sources src/suffix.mlb \
77 | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
78 | sed 's/^\(.*\).lex$$/\1.lex.sml/'
79
d541c618 80src/domtool-server.mlb: src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 81 $(MAKE_MLB_BASE) >src/domtool-server.mlb
a49a9bfb
AC
82 echo "main-server.sml" >>src/domtool-server.mlb
83
d541c618 84src/domtool-client.mlb: src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 85 $(MAKE_MLB_BASE) >src/domtool-client.mlb
361a1e7f
AC
86 echo "main-client.sml" >>src/domtool-client.mlb
87
d541c618 88src/domtool-slave.mlb: src/prefix.mlb src/sources src/suffix.mlb
7a2b27f0 89 $(MAKE_MLB_BASE) >src/domtool-slave.mlb
1c246434
AC
90 echo "main-slave.sml" >>src/domtool-slave.mlb
91
d541c618 92src/domtool-admin.mlb: src/prefix.mlb src/sources src/suffix.mlb
5ee41dd0
AC
93 $(MAKE_MLB_BASE) >src/domtool-admin.mlb
94 echo "main-admin.sml" >>src/domtool-admin.mlb
95
d541c618 96src/domtool-doc.mlb: src/prefix.mlb src/sources src/suffix.mlb
44a5ce2f
AC
97 $(MAKE_MLB_BASE) >src/domtool-doc.mlb
98 echo "main-doc.sml" >>src/domtool-doc.mlb
99
d541c618
AC
100src/dbtool.mlb: src/prefix.mlb src/sources src/suffix.mlb
101 $(MAKE_MLB_BASE) >src/dbtool.mlb
102 echo "main-dbtool.sml" >>src/dbtool.mlb
103
08688401
AC
104src/vmail.mlb: src/prefix.mlb src/sources src/suffix.mlb
105 $(MAKE_MLB_BASE) >src/vmail.mlb
106 echo "main-vmail.sml" >>src/vmail.mlb
107
2e96b9d4
AC
108src/setsa.mlb: src/prefix.mlb src/sources src/suffix.mlb
109 $(MAKE_MLB_BASE) >src/setsa.mlb
110 echo "main-setsa.sml" >>src/setsa.mlb
111
2bc5ed22
AC
112src/smtplog.mlb: src/prefix.mlb src/sources src/suffix.mlb
113 $(MAKE_MLB_BASE) >src/smtplog.mlb
114 echo "main-smtplog.sml" >>src/smtplog.mlb
115
00a077ab
AC
116src/mysql-fixperms.mlb: src/prefix.mlb src/sources src/suffix.mlb
117 $(MAKE_MLB_BASE) >src/mysql-fixperms.mlb
118 echo "main-mysql-fixperms.sml" >>src/mysql-fixperms.mlb
119
a8e88df7
CE
120src/fwtool.mlb: src/prefix.mlb src/sources src/suffix.mlb
121 $(MAKE_MLB_BASE) >src/fwtool.mlb
122 echo "main-fwtool.sml" >>src/fwtool.mlb
123
0d437aa6
CE
124src/domtool-config.mlb: src/prefix.mlb src/sources src/suffix.mlb
125 $(MAKE_MLB_BASE) >src/domtool-config.mlb
126 echo "main-config.sml" >>src/domtool-config.mlb
127
559e89e9
AC
128openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
129 cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
130 -cm libssl.h.cm -D__builtin_va_list="void*" \
131 ../openssl_sml.h
a49a9bfb
AC
132
133openssl/mlton/FFI/libssl.h.mlb: openssl/openssl_sml.h
134 cd openssl/mlton ; mlnlffigen -dir FFI -libhandle LibsslH.libh -include ../libssl-h.sml \
135 -mlbfile libssl.h.mlb -cppopt -D__builtin_va_list="void*" \
136 ../openssl_sml.h
137
931aae14
AC
138pcre/smlnj/FFI/libpcre.h.cm: pcre/pcre_sml.h
139 cd pcre/smlnj ; ml-nlffigen -d FFI -lh LibpcreH.libh -include ../libpcre-h.sml \
140 -cm libpcre.h.cm -D__builtin_va_list="void*" \
141 ../pcre_sml.h
142
143pcre/mlton/FFI/libpcre.h.mlb: pcre/pcre_sml.h
144 cd pcre/mlton ; mlnlffigen -dir FFI -libhandle LibpcreH.libh -include ../libpcre-h.sml \
145 -mlbfile libpcre.h.mlb -cppopt -D__builtin_va_list="void*" \
146 ../pcre_sml.h
147
a49a9bfb 148%.lex.sml: %.lex
a088cea6 149 mllex $<
a49a9bfb
AC
150
151%.grm.sig %.grm.sml: %.grm
a088cea6 152 mlyacc $<
a49a9bfb 153
7a2b27f0 154COMMON_MLTON_DEPS := openssl/mlton/FFI/libssl.h.mlb \
931aae14 155 pcre/mlton/FFI/libpcre.h.mlb \
7a2b27f0
AC
156 src/domtool.lex.sml \
157 src/domtool.grm.sig src/domtool.grm.sml \
158 $(COMMON_DEPS) src/*.sig src/*.sml \
9ffe2f0f
AC
159 src/plugins/*.sig src/plugins/*.sml \
160 src/mail/*.sig src/mail/*.sml
7a2b27f0 161
e0b80e65
AC
162MLTON := mlton -link-opt -ldl
163
2679ec89
CE
164ifeq ($(BUILD32),1)
165 MLTON += -codegen c -target i386 -cc-opt -m32
166endif
167
168ifeq ($(DEBUG), 1)
e0b80e65
AC
169 MLTON += -const 'Exn.keepHistory true'
170endif
171
2679ec89
CE
172ifeq ($(TC), 1)
173 MLTON += -stop tc
174endif
175
7a2b27f0 176bin/domtool-server: $(COMMON_MLTON_DEPS) src/domtool-server.mlb
e0b80e65 177 $(MLTON) -output bin/domtool-server src/domtool-server.mlb
361a1e7f 178
7a2b27f0 179bin/domtool-client: $(COMMON_MLTON_DEPS) src/domtool-client.mlb
e0b80e65 180 $(MLTON) -output bin/domtool-client src/domtool-client.mlb
361a1e7f 181
7a2b27f0 182bin/domtool-slave: $(COMMON_MLTON_DEPS) src/domtool-slave.mlb
e0b80e65 183 $(MLTON) -output bin/domtool-slave src/domtool-slave.mlb
1c246434 184
5ee41dd0 185bin/domtool-admin: $(COMMON_MLTON_DEPS) src/domtool-admin.mlb
e0b80e65 186 $(MLTON) -output bin/domtool-admin src/domtool-admin.mlb
5ee41dd0 187
44a5ce2f 188bin/domtool-doc: $(COMMON_MLTON_DEPS) src/domtool-doc.mlb
e0b80e65 189 $(MLTON) -output bin/domtool-doc src/domtool-doc.mlb
44a5ce2f 190
d541c618 191bin/dbtool: $(COMMON_MLTON_DEPS) src/dbtool.mlb
e0b80e65 192 $(MLTON) -output bin/dbtool src/dbtool.mlb
d541c618 193
08688401 194bin/vmail: $(COMMON_MLTON_DEPS) src/vmail.mlb
e0b80e65 195 $(MLTON) -output bin/vmail src/vmail.mlb
08688401 196
2e96b9d4 197bin/setsa: $(COMMON_MLTON_DEPS) src/setsa.mlb
ac64d96d 198 $(MLTON) -output bin/setsa src/setsa.mlb
2e96b9d4 199
2bc5ed22 200bin/smtplog: $(COMMON_MLTON_DEPS) src/smtplog.mlb
e0b80e65 201 $(MLTON) -output bin/smtplog src/smtplog.mlb
2bc5ed22 202
00a077ab
AC
203bin/mysql-fixperms: $(COMMON_MLTON_DEPS) src/mysql-fixperms.mlb
204 $(MLTON) -output bin/mysql-fixperms src/mysql-fixperms.mlb
205
a8e88df7
CE
206bin/fwtool: $(COMMON_MLTON_DEPS) src/fwtool.mlb
207 $(MLTON) -output bin/fwtool src/fwtool.mlb
208
e7957d00 209bin/webbw: $(COMMON_MLTON_DEPS) src/stats/webbw.mlb src/stats/*.sml
f086616f
AC
210 mlton -output bin/webbw src/stats/webbw.mlb
211
e7957d00
AC
212bin/domtool-tail: $(COMMON_MLTON_DEPS) src/tail/tail.mlb src/tail/*.sml
213 mlton -output bin/domtool-tail src/tail/tail.mlb
214
0d437aa6
CE
215bin/domtool-config: $(COMMON_MLTON_DEPS) src/domtool-config.mlb src/main-config.sml
216 $(MLTON) -output bin/domtool-config src/domtool-config.mlb
217
6b718954
AC
218elisp/domtool-tables.el: lib/*.dtl bin/domtool-doc
219 bin/domtool-doc -basis -emacs >$@
220
690a19c3
AC
221install_sos:
222 cp openssl/openssl_sml.so /usr/local/lib/
223 cp pcre/pcre_sml.so /usr/local/lib/
224
225install: install_sos
27e20924 226 cp scripts/domtool-publish /usr/local/sbin/
8ae99fef
AC
227 cp scripts/domtool-reset-global /usr/local/sbin/
228 cp scripts/domtool-reset-local /usr/local/sbin/
385c3534
AC
229 cp scripts/domtool-adduser /usr/local/bin/
230 cp scripts/domtool-addcert /usr/local/bin/
c235081a 231 cp scripts/domtool-readdcerts /usr/local/bin/
385c3534
AC
232 cp scripts/domtool-addacl /usr/local/bin/
233 cp scripts/domtool-rmuser /usr/local/bin/
62260c5f
AC
234 cp scripts/domtool-admin-sudo /usr/local/bin/
235 cp scripts/domtool-server-logged /usr/local/bin/
c9731b9b
AC
236 cp scripts/domtool-slave-logged /usr/local/bin/
237 cp scripts/domtool-server /etc/init.d/
238 cp scripts/domtool-slave /etc/init.d/
76bad1b2
AC
239 -cp bin/domtool-server /usr/local/sbin/
240 -cp bin/domtool-slave /usr/local/sbin/
241 -cp bin/domtool-client /usr/local/bin/domtool
242 -cp bin/domtool-admin /usr/local/bin/
243 -cp bin/domtool-doc /usr/local/bin/
d541c618 244 -cp bin/dbtool /usr/local/bin/
a8e88df7 245 -cp bin/fwtool /usr/local/bin/
08688401 246 -cp bin/vmail /usr/local/bin/
2e96b9d4 247 -cp bin/setsa /usr/local/bin/
2bc5ed22 248 -cp bin/smtplog /usr/local/bin/
00a077ab 249 -cp bin/mysql-fixperms /usr/local/bin/
7aa78013 250 -cp bin/vmailpasswd /usr/local/bin/
f086616f 251 -cp bin/webbw /usr/local/sbin/
e7957d00
AC
252 -cp bin/domtool-tail /usr/local/bin/
253 -chmod +s /usr/local/bin/domtool-tail
0d437aa6 254 cp bin/domtool-config /usr/local/bin/
d541c618 255 cp src/plugins/domtool-postgres /usr/local/sbin/
ae147938 256 cp src/plugins/domtool-mysql /usr/local/sbin/
e903f398 257 -mkdir -p $(EMACS_DIR)
4542571e 258 cp elisp/*.el $(EMACS_DIR)/
15e529d6 259
5982c377 260.PHONY: grab_lib install_server install_slave
15e529d6
AC
261
262grab_lib:
728f7033 263 rsync -r --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/
5982c377 264
20a7e975
CE
265install_serverslave:
266 /etc/init.d/domtool-server stop
267 /etc/init.d/domtool-slave stop
268 make install
269 /etc/init.d/domtool-server start
270 /etc/init.d/domtool-slave start
271
5982c377 272install_server:
20a7e975
CE
273 /etc/init.d/domtool-server stop
274 make install
275 /etc/init.d/domtool-server start
29920c95
AC
276
277install_slave:
20a7e975
CE
278 /etc/init.d/domtool-slave stop
279 make install
280 /etc/init.d/domtool-slave start