Release version 983 generated by do-release.sh
[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 := citserver setup sendcommand citmail chkpw chkpwd
14 all: $(all)
15
16 SRCDIRS := $(wildcard server server/modules/*)
17 SOURCES := $(wildcard server/*.c server/modules/*/*.c)
18 OBJECTS := $(patsubst %.c,%.o,$(SOURCES))
19
20 citserver: $(OBJECTS)
21         cc ${CFLAGS} \
22                 $(OBJECTS) \
23                 ${LDFLAGS} \
24                 -lresolv -lcitadel -lpthread -lz -lical -lldap -lcrypt -lexpat -lcurl -ldb \
25                 -o citserver
26
27 $(SOURCES): server/*.h server/modules/*/*.h
28         @touch $@
29
30 %.o: %.c
31         @echo $<
32         @cc ${CFLAGS} -c $< -o $@
33
34 setup: utils/setup.c server/citadel_dirs.c utils/*.h server/*.h
35         cc ${CFLAGS} ${LDFLAGS} utils/setup.c -lcitadel -o setup
36
37 ctdlmigrate: utils/ctdlmigrate.c server/citadel_dirs.c utils/*.h server/*.h
38         cc ${CFLAGS} ${LDFLAGS} utils/ctdlmigrate.c -lcitadel -lreadline -o ctdlmigrate
39
40 sendcommand: utils/sendcommand.c server/citadel_dirs.c utils/*.h server/*.h
41         cc ${CFLAGS} ${LDFLAGS} utils/sendcommand.c -lcitadel -o sendcommand
42
43 citmail: utils/citmail.c server/citadel_dirs.c utils/*.h server/*.h
44         cc ${CFLAGS} ${LDFLAGS} utils/citmail.c -lcitadel -o citmail
45
46 chkpw: utils/chkpw.c utils/*.h server/*.h
47         cc ${CFLAGS} ${LDFLAGS} utils/chkpw.c -o chkpw
48
49 chkpwd: utils/chkpwd.c utils/auth.c utils/*.h server/*.h
50         cc ${CFLAGS} ${LDFLAGS} utils/chkpwd.c utils/auth.c -lcrypt -o chkpwd
51
52 ctdldump: utils/ctdldump.c utils/*.h server/*.h
53         cc ${CFLAGS} ${LDFLAGS} utils/ctdldump.c -lcitadel -lz -ldb -lpthread -o ctdldump
54
55 ctdlload: utils/ctdlload.c server/makeuserkey.c utils/*.h server/*.h
56         cc ${CFLAGS} ${LDFLAGS} utils/ctdlload.c server/makeuserkey.c -lcitadel -lz -ldb -lpthread -o ctdlload
57
58 config.mk: configure
59         ./configure
60
61 clean:
62         rm -vf $(all)
63         find . -name *.o | xargs rm -vf
64
65 distclean: clean
66         rm -vf config.mk
67
68 install: $(all) utils/*.sh
69         @echo Installing to ${CTDLDIR}
70         @for x in $(all) utils/*.sh ; do \
71                 install -v -C -D -t ${CTDLDIR} $$x ;\
72         done