Integrated the DKIM signer into serv_smtpclient, but disabled it
[citadel.git] / citadel / Makefile
1 # Makefile for Citadel Server
2 # Copyright (c) 1987-2023 by Art Cancro and the citadel.org team
3 #
4 # No, we are NOT using the obsolete GNU Autotools.  This configure script works
5 # well on the Linux operating system (which uses the Linux kernel) and on BSD.
6 #
7 # This program is open source software.  Use, duplication, and/or
8 # disclosure are subject to the GNU General Public License version 3.
9
10 # config.mk is generated by ./configure
11 include config.mk
12
13 all := ctdldump ctdlload citserver setup sendcommand citmail loadtest dbnothing ${CHKPW}
14 all: $(all)
15
16 SERVER_SOURCES := $(wildcard server/*.c server/modules/*/*.c)
17 SERVER_OBJECTS := $(patsubst %.c,%.o,$(SERVER_SOURCES))
18 BACKEND_SOURCES := $(wildcard server/backends/*/*.c)
19 BACKEND_OBJECTS := $(patsubst %.c,%.o,$(BACKEND_SOURCES))
20
21 $(SERVER_SOURCES): server/*.h server/modules/*/*.h server/backends/*/*.h
22         @touch $@
23
24 $(BACKEND_SOURCES): server/*.h server/modules/*/*.h server/backends/*/*.h
25         @touch $@
26
27 %.o: %.c
28         @echo $<
29         @${CC} ${CFLAGS} -c $< -o $@
30
31 citserver: $(SERVER_OBJECTS) $(BACKEND_OBJECTS)
32         ${CC} ${CFLAGS} \
33                 $(SERVER_OBJECTS) $(BACKEND_OBJECTS) \
34                 ${LDFLAGS} \
35                 -lcitadel -lpthread -lz -lical -lldap -lcrypt -lexpat -lcurl ${LRESOLV} ${BACKEND_LDFLAGS} \
36                 -o citserver
37
38 setup: utils/setup.c server/citadel_dirs.c utils/*.h server/*.h
39         ${CC} ${CFLAGS} ${LDFLAGS} utils/setup.c -lcitadel ${LINTL} -o setup
40
41 ctdlmigrate: utils/ctdlmigrate.c server/citadel_dirs.c utils/*.h server/*.h
42         ${CC} ${CFLAGS} ${LDFLAGS} utils/ctdlmigrate.c -lcitadel -lreadline -o ctdlmigrate
43
44 sendcommand: utils/sendcommand.c server/citadel_dirs.c utils/*.h server/*.h
45         ${CC} ${CFLAGS} ${LDFLAGS} utils/sendcommand.c -lcitadel -o sendcommand
46
47 citmail: utils/citmail.c server/citadel_dirs.c utils/*.h server/*.h
48         ${CC} ${CFLAGS} ${LDFLAGS} utils/citmail.c -lcitadel -o citmail
49
50 chkpw: utils/chkpw.c utils/*.h server/*.h
51         ${CC} ${CFLAGS} ${LDFLAGS} utils/chkpw.c -o chkpw
52
53 chkpwd: utils/chkpwd.c utils/auth.c utils/*.h server/*.h
54         ${CC} ${CFLAGS} ${LDFLAGS} utils/chkpwd.c utils/auth.c -lcrypt -o chkpwd
55
56 dbnothing: utils/dbnothing.c utils/*.h server/*.h ${BACKEND_OBJECTS}
57         ${CC} ${CFLAGS} ${LDFLAGS} utils/dbnothing.c ${BACKEND_OBJECTS} -lcitadel -lz ${BACKEND_LDFLAGS} -lpthread -o dbnothing
58
59 ctdldump: utils/ctdldump.c utils/*.h server/*.h ${BACKEND_OBJECTS}
60         ${CC} ${CFLAGS} ${LDFLAGS} utils/ctdldump.c ${BACKEND_OBJECTS} -lcitadel -lz ${BACKEND_LDFLAGS} -lpthread -o ctdldump
61
62 ctdlload: utils/ctdlload.c server/makeuserkey.c utils/*.h server/*.h ${BACKEND_OBJECTS}
63         ${CC} ${CFLAGS} ${LDFLAGS} utils/ctdlload.c server/makeuserkey.c ${BACKEND_OBJECTS} -lcitadel -lz ${BACKEND_LDFLAGS} -lpthread -o ctdlload
64
65 loadtest: utils/loadtest.c server/citadel_dirs.c utils/*.h server/*.h
66         ${CC} ${CFLAGS} ${LDFLAGS} utils/loadtest.c -lcitadel -lpthread -o loadtest
67
68 config.mk: configure
69         ./configure
70
71 clean:
72         rm -vf $(all)
73         find . -name *.o | xargs rm -vf
74
75 distclean: clean
76         rm -vf config.mk
77
78 install: $(all) utils/*.sh
79         @echo Installing to ${CTDLDIR}
80         @for x in $(all) utils/*.sh ; do \
81                 install -v -C -D -t ${CTDLDIR} $$x ;\
82         done