d1cf0450e6955e99ced4420cc03835be6ccab562
[citadel.git] / citadel / Makefile
1 # Makefile for Citadel Server
2 # Copyright (c) 1987-2022 by Art Cancro and the citadel.org team
3
4 # This is the new and improved version that does not use the GNU Autotools,
5 # because it is The Current Year and we aren't trying to build for weird
6 # obscure systems anymore.
7 #
8 # This program is open source software.  Use, duplication, and/or
9 # disclosure are subject to the GNU General Purpose License version 3.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16
17 # config.mk is generated by ./configure
18 include config.mk
19
20 all := citserver setup ctdlmigrate sendcommand citmail chkpw chkpwd
21 all: $(all)
22
23 citserver: server/*.c server/modules/*/*.c config.mk server/*.h
24         cc ${CFLAGS} \
25                 server/*.c server/modules/*/*.c \
26                 ${LDFLAGS} -lresolv -lcitadel -lpthread -lz -lical -lldap -lcrypt -lexpat -lcurl -ldb \
27                 -o citserver
28
29 setup: utils/setup.c server/citadel_dirs.c utils/*.h server/*.h
30         cc ${CFLAGS} utils/setup.c -lcitadel -o setup
31
32 ctdlmigrate: utils/ctdlmigrate.c server/citadel_dirs.c utils/*.h server/*.h
33         cc ${CFLAGS} utils/ctdlmigrate.c -lcitadel -lreadline -o ctdlmigrate
34
35 sendcommand: utils/sendcommand.c server/citadel_dirs.c utils/*.h server/*.h
36         cc ${CFLAGS} utils/sendcommand.c -lcitadel -o sendcommand
37
38 citmail: utils/citmail.c server/citadel_dirs.c utils/*.h server/*.h
39         cc ${CFLAGS} utils/citmail.c -lcitadel -o citmail
40
41 chkpw: utils/chkpw.c utils/*.h server/*.h
42         cc ${CFLAGS} utils/chkpw.c -o chkpw
43
44 chkpwd: utils/chkpwd.c utils/auth.c utils/*.h server/*.h
45         cc ${CFLAGS} utils/chkpwd.c utils/auth.c -lcrypt -o chkpwd
46
47 config.mk: configure
48         ./configure
49
50 clean:
51         rm -vf $(all)
52         find . -name *.o | xargs rm -vf
53
54 distclean: clean
55         rm -vf config.mk
56
57 install: $(all)
58         #
59         # Installing to ${CTDLDIR}
60         #
61         @for x in $(all) ; do \
62                 install -v -D -t ${CTDLDIR} $$x ;\
63         done