Added the P/C ratio back to stats
[citadel.git] / citadel / Makefile.in
1 # Makefile for Citadel/UX
2 #
3 # NOTE: normally you should not have to modify the Makefile.  All
4 # system-dependent configuration is in the "configure" script, which
5 # uses "Makefile.in" to generate a "Makefile".  In the rare instance
6 # that you have to modify something here, please take note:
7 # 1. Edit Makefile.in, -not- Makefile.
8 # 2. Send e-mail to ajc@uncnsrd.mt-kisco.ny.us and let me know what you
9 #    did, so any necessary changes can be put into the next release.
10 #
11 # $Id$
12 #
13 ########################################################################
14
15 TARGETS=@TARGETS@
16
17 all: $(TARGETS)
18
19 .SUFFIXES: .ro .mo .d
20
21 CLIENT_TARGETS=citadel whobbs
22 SERVER_TARGETS=citserver setup
23 SERV_MODULES=modules/serv_chat.so modules/serv_test.so \
24         modules/serv_upgrade.so modules/serv_expire.so
25 UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
26         readlog rcit stats citmail netpoll mailinglist userlist sendcommand
27 PROXY_TARGETS=proxy
28
29 prefix=@prefix@
30 srcdir=@srcdir@
31
32 DEFS=@DEFS@
33 CPPFLAGS=@CPPFLAGS@ -I.
34 CFLAGS=@CFLAGS@
35 CC=@CC@
36 LIBS=@LIBS@
37 LDFLAGS=@LDFLAGS@
38 SERVER_LDFLAGS=@SERVER_LDFLAGS@
39 PICFLAGS=@PICFLAGS@
40 CURSES=@CURSES@
41 SNPRINTF=@SNPRINTF@
42 PTHREAD_DEFS=-D_REENTRANT
43 INSTALL=@INSTALL@
44 INSTALL_DATA=@INSTALL_DATA@
45 SHELL=/bin/sh
46 AUTOCONF=@AUTOCONF@
47
48 # End configuration section
49
50 VPATH=$(srcdir)
51
52 SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \
53         config.c control.c cux2ascii.c database.c dynloader.c file_ops.c \
54         housekeeping.c internetmail.c ipc_c_tcp.c locate_host.c \
55         logging.c mailinglist.c messages.c msgbase.c msgform.c netmailer.c \
56         netpoll.c netproc.c netsetup.c policy.c proxy.c rcit.c readlog.c \
57         room_ops.c rooms.c routines.c routines2.c serv_chat.c \
58         serv_info.c serv_test.c serv_upgrade.c setup.c snprintf.c stats.c \
59         support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \
60         whobbs.c sendcommand.c
61
62 DEP_FILES=$(SOURCES:.c=.d)
63
64 client: $(CLIENT_TARGETS)
65
66 server: $(SERVER_TARGETS)
67
68 utils: $(UTIL_TARGETS)
69
70 serv_modules: $(SERV_MODULES)
71
72 #
73 #
74
75 citadel: ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
76         commands.o client_chat.o serv_info.o tools.o $(SNPRINTF)
77         $(CC) ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
78         commands.o client_chat.o serv_info.o tools.o $(SNPRINTF) $(LDFLAGS) \
79         -o citadel
80
81 netpoll: netpoll.o config.o ipc_c_tcp.o tools.o $(SNPRINTF)
82         $(CC) netpoll.o config.o ipc_c_tcp.o tools.o \
83         $(SNPRINTF) $(LDFLAGS) -o netpoll
84
85 .c.o:
86         $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $<
87
88 #
89 #
90
91 citserver: citserver.ro user_ops.ro support.ro room_ops.ro file_ops.ro \
92         msgbase.ro config.ro sysdep.ro locate_host.ro \
93         housekeeping.ro database.ro control.ro logging.ro \
94         policy.ro dynloader.ro tools.ro $(SNPRINTF:.o=.ro)
95         $(CC) \
96                 citserver.ro user_ops.ro room_ops.ro file_ops.ro support.ro \
97                 msgbase.ro config.ro sysdep.ro locate_host.ro \
98                 housekeeping.ro database.ro control.ro logging.ro \
99                 policy.ro dynloader.ro tools.ro $(SNPRINTF:.o=.ro)\
100                 $(LDFLAGS) $(SERVER_LDFLAGS) $(LIBS) -o citserver
101
102 .c.ro:
103         $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PTHREAD_DEFS) -c $< -o $@
104
105 modules/serv_chat.so: serv_chat.mo
106         $(CC) -shared -o modules/serv_chat.so serv_chat.mo
107
108 .c.mo:
109         $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PTHREAD_DEFS) $(PICFLAGS) -DPIC -c $< -o $@
110
111 modules/serv_test.so: serv_test.mo
112         $(CC) -shared -o modules/serv_test.so serv_test.mo
113
114 modules/serv_upgrade.so: serv_upgrade.mo
115         $(CC) -shared -o modules/serv_upgrade.so serv_upgrade.mo
116
117 modules/serv_expire.so: serv_expire.mo
118         $(CC) -shared -o modules/serv_expire.so serv_expire.mo
119
120 aidepost: aidepost.o config.o $(SNPRINTF)
121         $(CC) aidepost.o config.o $(SNPRINTF) $(LDFLAGS) -o aidepost
122
123 #
124 # 'netmailer' needs to run setuid because it generates headers for Internet
125 # mail.  If it is not run setuid, all outgoing mail may always show as coming
126 # from your BBSUID rather than the actual sending user.
127 #
128 netmailer: netmailer.o internetmail.o config.o
129         $(CC) netmailer.o config.o internetmail.o $(LDFLAGS) -o netmailer
130
131 netproc: netproc.o config.o ipc_c_tcp.o tools.o $(SNPRINTF)
132         $(CC) netproc.o config.o ipc_c_tcp.o tools.o \
133         $(SNPRINTF) $(LDFLAGS) -o netproc
134
135 citmail: citmail.o config.o internetmail.o $(SNPRINTF)
136         @echo "*"
137         @echo "*                 ###### IMPORTANT ######"
138         @echo "* To allow Citadel users to receive Internet mail, you must"
139         @echo "* set this program to be your local mail delivery agent."
140         @echo "*"
141         $(CC) citmail.o config.o internetmail.o $(SNPRINTF) $(LDFLAGS) -o citmail
142
143 mailinglist: mailinglist.o config.o internetmail.o
144         $(CC) mailinglist.o config.o internetmail.o $(LDFLAGS) -o mailinglist
145
146 setup: setup.o tools.o
147         $(CC) setup.o tools.o $(CURSES) $(LDFLAGS) -o setup
148
149 netsetup: netsetup.o config.o
150         $(CC) netsetup.o config.o $(LDFLAGS) -o netsetup
151
152 proxy: proxy.o ipc_c_tcp.o
153         $(CC) proxy.o ipc_c_tcp.o $(LDFLAGS) -o proxy
154
155 whobbs: whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF)
156         $(CC) whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF) $(LDFLAGS) -o whobbs
157
158 sendcommand: sendcommand.o ipc_c_tcp.o tools.o config.o $(SNPRINTF)
159         $(CC) sendcommand.o ipc_c_tcp.o tools.o config.o \
160          $(SNPRINTF) $(LDFLAGS) -o sendcommand
161
162 userlist: userlist.o ipc_c_tcp.o tools.o $(SNPRINTF)
163         $(CC) userlist.o ipc_c_tcp.o tools.o \
164         $(SNPRINTF) $(LDFLAGS) -o userlist
165
166 msgform: msgform.o
167         $(CC) msgform.o $(LDFLAGS) -o msgform
168
169 readlog: readlog.o config.o
170         $(CC) readlog.o config.o $(LDFLAGS) -o readlog
171
172 rcit: rcit.o config.o
173         $(CC) rcit.o config.o $(LDFLAGS) -o rcit
174         @echo "*"
175         @echo "* NOTE: TO RECEIVE CITADEL TRAFFIC VIA THE RCIT PROGRAM (ESPECIALLY"
176         @echo "* IF YOU ARE GATEWAYING TO USENET) YOU MUST LINK RNEWS TO RCIT:"
177         @echo "* ln -s rcit /usr/bin/rnews"
178         @echo "*"
179
180 stats: stats.o ipc_c_tcp.o tools.o config.o $(SNPRINTF)
181         $(CC) stats.o ipc_c_tcp.o tools.o config.o $(SNPRINTF) $(LDFLAGS) -o stats
182
183 .PHONY: install-data install-doc install-exec clean cleaner distclean
184
185 install: install-exec install-data install-doc
186
187 install-data:
188         for i in help messages network/spoolin network/spoolout \
189                  network/systems; do \
190                 ./mkinstalldirs $(prefix)/$$i; \
191         done
192         for i in citadel.rc public_clients \
193                  `find help messages network -type f | grep -v CVS`; do \
194                 $(INSTALL_DATA) $$i $(prefix)/$$i; \
195         done
196
197 install-doc:
198         ./mkinstalldirs $(prefix)/techdoc
199         for i in *.txt `find techdoc -type f | grep -v CVS`; do \
200                 $(INSTALL_DATA) $$i $(prefix)/$$i; \
201         done
202
203 install-exec: all weekly
204         for i in bio bitbucket files images info modules userpics; do \
205                 ./mkinstalldirs $(prefix)/$$i; \
206         done
207         for i in $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
208                  $(PROXY_TARGETS) $(SERV_MODULES) utilsmenu weekly \
209                  dnetsetup; do \
210                 test -f $$i && $(INSTALL) $$i $(prefix)/$$i; \
211         done
212
213 clean:
214         rm -f *.o *.ro *.mo
215
216 cleaner: clean
217         rm -f $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
218                 $(SERV_MODULES) $(PROXY_TARGETS) so_locations
219
220 distclean: cleaner
221         rm -f Makefile sysdep.h config.cache config.log config.status *.d
222
223 .c.d:
224         $(CC) -M $(CPPFLAGS) $< | sed -e 's!$*.o!$*.o $*.ro $*.mo $@!' > $@
225         test -s $@ || rm -f $@
226
227 Makefile: $(srcdir)/Makefile.in config.status
228         CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
229
230 config.status: $(srcdir)/configure
231         $(SHELL) ./config.status --recheck
232
233 $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4
234         cd $(srcdir) && $(AUTOCONF)
235
236 weekly: $(srcdir)/weekly.in config.status
237         CONFIG_FILES=weekly CONFIG_HEADERS= $(SHELL) ./config.status
238
239 -include $(DEP_FILES)