X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/826fb70b752d7e8879f505f3d4ff161d2bb0a4a8..fb9aeb18e3091035c1d82484a4348418f2f32adf:/Makefile diff --git a/Makefile b/Makefile index 5a47071..89ae22c 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,44 @@ +# Supported flags +# BUILD32=1 Target 32-bit x86 (Doesn't Work) +# TC=1 Stop after typchecking when building using mlton +# DEBUG=1 Keep debugging information when building using mlton + all: mlton bin/vmailpasswd elisp/domtool-tables.el bin/vmailpasswd: src/mail/vmailpasswd.c - $(CC) -lcrypt -o $@ $< + $(CC) $(CFLAGS) -lcrypt -o $@ $< + +ifeq ($(BUILD32), 1) + CFLAGS += -m32 +endif COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \ openssl/openssl_sml.so pcre/pcre_sml.so config.sml EMACS_DIR := /usr/local/share/emacs/site-lisp/domtool-mode +clean: + rm -f bin/* + rm -f openssl/openssl_sml.so + rm -f openssl/openssl_sml.o + rm -f pcre/pcre_sml.so + rm -f pcre/pcre_sml.o + config.sml: - echo -e 'structure Config :> CONFIG = struct\nopen ConfigDefault\nend' > $@ + /bin/echo -e 'structure Config :> CONFIG = struct\nopen ConfigDefault\nend' > $@ .PHONY: all mlton smlnj install install_sos mlton: bin/domtool-server bin/domtool-client bin/domtool-slave \ bin/domtool-admin bin/domtool-doc bin/dbtool bin/vmail \ - bin/smtplog bin/setsa bin/mysql-fixperms bin/webbw bin/domtool-tail + bin/smtplog bin/setsa bin/mysql-fixperms bin/webbw bin/domtool-tail \ + bin/fwtool bin/domtool-config bin/domtool-portal smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm pcre/smlnj/FFI/libpcre.h.cm \ src/domtool.cm + CFLAGS += -m32 -configDefault/config.sig: src/config.sig.header \ +configDefault/config.sig: config/core/core.sig src/config.sig.header \ configDefault/*.csg configDefault/*.cfs \ src/config.sig.footer cat configDefault/*.csg \ @@ -29,7 +47,7 @@ configDefault/config.sig: src/config.sig.header \ src/config.sig.footer \ >configDefault/config.sig -configDefault/configDefault.sml: src/configDefault.sml.header \ +configDefault/configDefault.sml: config/core/core.sml src/configDefault.sml.header \ configDefault/*.cfg src/configDefault.sml.footer cat src/configDefault.sml.header \ configDefault/*.cfg \ @@ -37,18 +55,18 @@ configDefault/configDefault.sml: src/configDefault.sml.header \ >configDefault/configDefault.sml openssl/openssl_sml.o: openssl/openssl_sml.c - gcc -fPIC -c openssl/openssl_sml.c -o openssl/openssl_sml.o + gcc $(CFLAGS) -fPIC -c openssl/openssl_sml.c -o openssl/openssl_sml.o openssl/openssl_sml.so: openssl/openssl_sml.o - gcc -shared -Wl,-soname,openssl_sml.so \ + gcc $(CFLAGS) -shared -Wl,-soname,openssl_sml.so \ -o openssl/openssl_sml.so \ openssl/openssl_sml.o -lssl pcre/pcre_sml.o: pcre/pcre_sml.c - gcc -fPIC -c pcre/pcre_sml.c -o pcre/pcre_sml.o + gcc $(CFLAGS) -fPIC -c pcre/pcre_sml.c -o pcre/pcre_sml.o pcre/pcre_sml.so: pcre/pcre_sml.o - gcc -shared -Wl,-soname,pcre_sml.so \ + gcc $(CFLAGS) -shared -Wl,-soname,pcre_sml.so \ -o pcre/pcre_sml.so \ pcre/pcre_sml.o -lpcre @@ -99,6 +117,18 @@ src/mysql-fixperms.mlb: src/prefix.mlb src/sources src/suffix.mlb $(MAKE_MLB_BASE) >src/mysql-fixperms.mlb echo "main-mysql-fixperms.sml" >>src/mysql-fixperms.mlb +src/fwtool.mlb: src/prefix.mlb src/sources src/suffix.mlb + $(MAKE_MLB_BASE) >src/fwtool.mlb + echo "main-fwtool.sml" >>src/fwtool.mlb + +src/domtool-config.mlb: src/prefix.mlb src/sources src/suffix.mlb + $(MAKE_MLB_BASE) >src/domtool-config.mlb + echo "main-config.sml" >>src/domtool-config.mlb + +src/domtool-portal.mlb: src/prefix.mlb src/sources src/suffix.mlb + $(MAKE_MLB_BASE) >src/domtool-portal.mlb + echo "main-portal.sml" >>src/domtool-portal.mlb + openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \ -cm libssl.h.cm -D__builtin_va_list="void*" \ @@ -135,10 +165,18 @@ COMMON_MLTON_DEPS := openssl/mlton/FFI/libssl.h.mlb \ MLTON := mlton -link-opt -ldl -ifdef DEBUG +ifeq ($(BUILD32),1) + MLTON += -codegen c -target i386 -cc-opt -m32 +endif + +ifeq ($(DEBUG), 1) MLTON += -const 'Exn.keepHistory true' endif +ifeq ($(TC), 1) + MLTON += -stop tc +endif + bin/domtool-server: $(COMMON_MLTON_DEPS) src/domtool-server.mlb $(MLTON) -output bin/domtool-server src/domtool-server.mlb @@ -169,12 +207,21 @@ bin/smtplog: $(COMMON_MLTON_DEPS) src/smtplog.mlb bin/mysql-fixperms: $(COMMON_MLTON_DEPS) src/mysql-fixperms.mlb $(MLTON) -output bin/mysql-fixperms src/mysql-fixperms.mlb +bin/fwtool: $(COMMON_MLTON_DEPS) src/fwtool.mlb + $(MLTON) -output bin/fwtool src/fwtool.mlb + bin/webbw: $(COMMON_MLTON_DEPS) src/stats/webbw.mlb src/stats/*.sml mlton -output bin/webbw src/stats/webbw.mlb bin/domtool-tail: $(COMMON_MLTON_DEPS) src/tail/tail.mlb src/tail/*.sml mlton -output bin/domtool-tail src/tail/tail.mlb +bin/domtool-config: $(COMMON_MLTON_DEPS) src/domtool-config.mlb src/main-config.sml + $(MLTON) -output bin/domtool-config src/domtool-config.mlb + +bin/domtool-portal: $(COMMON_MLTON_DEPS) src/domtool-portal.mlb src/main-portal.sml + $(MLTON) -output bin/domtool-portal src/domtool-portal.mlb + elisp/domtool-tables.el: lib/*.dtl bin/domtool-doc bin/domtool-doc -basis -emacs >$@ @@ -186,9 +233,10 @@ install: install_sos cp scripts/domtool-publish /usr/local/sbin/ cp scripts/domtool-reset-global /usr/local/sbin/ cp scripts/domtool-reset-local /usr/local/sbin/ + cp scripts/domtool-vmailpasswd /usr/local/sbin/ cp scripts/domtool-adduser /usr/local/bin/ cp scripts/domtool-addcert /usr/local/bin/ - cp scripts/domtool-addcert-daemon /usr/local/bin/ + cp scripts/domtool-readdcerts /usr/local/bin/ cp scripts/domtool-addacl /usr/local/bin/ cp scripts/domtool-rmuser /usr/local/bin/ cp scripts/domtool-admin-sudo /usr/local/bin/ @@ -202,6 +250,7 @@ install: install_sos -cp bin/domtool-admin /usr/local/bin/ -cp bin/domtool-doc /usr/local/bin/ -cp bin/dbtool /usr/local/bin/ + -cp bin/fwtool /usr/local/bin/ -cp bin/vmail /usr/local/bin/ -cp bin/setsa /usr/local/bin/ -cp bin/smtplog /usr/local/bin/ @@ -210,6 +259,8 @@ install: install_sos -cp bin/webbw /usr/local/sbin/ -cp bin/domtool-tail /usr/local/bin/ -chmod +s /usr/local/bin/domtool-tail + cp bin/domtool-config /usr/local/bin/ + cp bin/domtool-portal /usr/local/sbin/ cp src/plugins/domtool-postgres /usr/local/sbin/ cp src/plugins/domtool-mysql /usr/local/sbin/ -mkdir -p $(EMACS_DIR) @@ -220,12 +271,19 @@ install: install_sos grab_lib: rsync -r --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/ +install_serverslave: + /etc/init.d/domtool-server stop + /etc/init.d/domtool-slave stop + make install + /etc/init.d/domtool-server start + /etc/init.d/domtool-slave start + install_server: - sudo /etc/init.d/domtool-server stop - sudo make install - sudo /etc/init.d/domtool-server start + /etc/init.d/domtool-server stop + make install + /etc/init.d/domtool-server start install_slave: - sudo /etc/init.d/domtool-slave stop - sudo make install - sudo /etc/init.d/domtool-slave start + /etc/init.d/domtool-slave stop + make install + /etc/init.d/domtool-slave start