1 # Makefile for Citadel/UX
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@uncensored.citadel.org and let me know what you
9 # did, so any necessary changes can be put into the next release.
13 ########################################################################
20 .SUFFIXES: .lo .ro .d .c
27 CLIENT_TARGETS=citadel$(EXEEXT) whobbs$(EXEEXT)
28 SERVER_TARGETS=libcitserver.la citserver setup $(CHKPWD)
29 SERV_MODULES=modules/libchat.la modules/libvcard.la \
30 modules/libupgrade.la \
34 modules/libnetwork.la \
36 modules/libinetcfg.la \
38 modules/libmoderate.la \
40 modules/libexpire.la \
41 modules/libvandelay.la \
43 UTIL_TARGETS=aidepost netmailer netproc netsetup msgform readlog rcit \
44 stats citmail netpoll mailinglist userlist sendcommand \
52 CPPFLAGS=@CPPFLAGS@ -I.
61 chkpwd_LIBS=@chkpwd_LIBS@
63 CL_LIBOBJS=@CL_LIBOBJS@
64 PTHREAD_DEFS=@PTHREAD_DEFS@
65 PTHREAD_LIBS=@PTHREAD_LIBS@
66 CLIENT_PTLIBS=@CLIENT_PTLIBS@
68 INSTALL_DATA=@INSTALL_DATA@
75 LTSHARE=cd modules && ../$(LIBTOOL) $(CC) -rpath $(prefix)/modules -no-undefined -avoid-version -module
77 # End configuration section
83 SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \
84 config.c control.c $(DATABASE) dynloader.c file_ops.c \
85 housekeeping.c internetmail.c ipc_c_tcp.c locate_host.c \
86 logging.c mailinglist.c messages.c msgbase.c msgform.c netmailer.c \
87 netpoll.c netproc.c netsetup.c policy.c rcit.c readlog.c \
88 room_ops.c rooms.c routines.c routines2.c serv_chat.c \
89 serv_info.c serv_test.c setup.c snprintf.c stats.c serv_vcard.c \
90 support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \
91 whobbs.c sendcommand.c mime_parser.c base64.c qpdecode.c getutline.c \
92 auth.c chkpwd.c html.c vcard.c serv_upgrade.c serv_vandelay.c \
93 serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
94 $(DOMAIN) clientsocket.c serv_inetcfg.c serv_rwho.c serv_bio.c \
95 serv_moderate.c client_passwords.c imap_misc.c \
96 serv_imap.c imap_tools.c imap_fetch.c imap_search.c imap_store.c \
97 serv_network.c serv_pas2.c serv_ical.c md5.c server_main.c
99 DEP_FILES=$(SOURCES:.c=.d)
101 client: $(CLIENT_TARGETS)
103 server: $(SERVER_TARGETS)
105 utils: $(UTIL_TARGETS)
107 serv_modules: $(SERV_MODULES)
108 @cd modules && mods=`echo .libs/*.s[ol]` && test "$$mods" != '.libs/*.s[ol]' && ln -sf $$mods . || true
109 @cd modules && mods=`echo .libs/*.dll` && test "$$mods" != '.libs/*.dll' && ln -sf $$mods . || true
114 citadel$(EXEEXT): ipc_c_tcp$(CX) citadel$(CX) rooms$(CX) routines$(CX) \
115 routines2$(CX) messages$(CX) \
116 client_passwords$(CX) md5$(CX) \
117 commands$(CX) client_chat$(CX) serv_info$(CX) tools$(CX) $(LIBOBJS)
118 $(CC) ipc_c_tcp$(CX) citadel$(CX) rooms$(CX) routines$(CX) \
119 routines2$(CX) messages$(CX) \
120 commands$(CX) client_chat$(CX) serv_info$(CX) tools$(CX) \
121 client_passwords$(CX) md5$(CX) \
122 $(LIBOBJS) $(LDFLAGS) -o citadel $(NETLIBS) $(CLIENT_PTLIBS)
124 netpoll: netpoll.o config.o ipc_c_tcp.o tools.o $(LIBOBJS)
125 $(CC) netpoll.o config.o ipc_c_tcp.o tools.o \
126 $(LIBOBJS) $(LDFLAGS) -o netpoll $(NETLIBS)
129 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $<
138 SERV_OBJS = server_main.ro
140 parsedate.ro: parsedate.c
142 LIBSERV_OBJS = user_ops.lo citserver.lo sysdep.lo dynloader.lo tools.lo $(DATABASE:.c=.lo) \
143 control.lo policy.lo config.lo support.lo room_ops.lo file_ops.lo msgbase.lo \
144 locate_host.lo housekeeping.lo logging.lo mime_parser.lo html.lo internet_addressing.lo \
145 parsedate.lo genstamp.lo clientsocket.lo $(AUTH) $(LIBOBJS:.o=.lo)
147 libcitserver.la: $(LIBSERV_OBJS)
148 $(LIBTOOL) $(CC) $(LDFLAGS) -rpath $(prefix) -no-undefined -avoid-version \
149 -o libcitserver.la $(LIBSERV_OBJS) $(GDBM) $(LIBS) $(PTHREAD_LIBS) $(NETLIBS) $(RESOLV)
151 citserver: $(SERV_OBJS) $(LIBTOOL) libcitserver.la
152 $(LIBTOOL) --mode=link $(CC) $(SERV_OBJS) $(LDFLAGS) libcitserver.la -o \
153 citserver $(PTHREAD_LIBS)
156 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PTHREAD_DEFS) -c $< -o $@
159 @test -d modules || mkdir -p modules
160 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PTHREAD_DEFS) -c $< -o $@
162 modules/libchat.la: serv_chat.lo libcitserver.la $(LIBTOOL)
163 $(LTSHARE) -o libchat.la ../serv_chat.lo ../libcitserver.la
165 modules/libtest.la: serv_test.lo libcitserver.la $(LIBTOOL)
166 $(LTSHARE) -o libtest.la ../serv_test.lo ../libcitserver.la
168 modules/libpop3.la: serv_pop3.lo md5.lo $(LIBTOOL) libcitserver.la
169 $(LTSHARE) -o libpop3.la ../serv_pop3.lo ../md5.lo ../libcitserver.la
171 modules/libinetcfg.la: serv_inetcfg.lo $(LIBTOOL) libcitserver.la
172 $(LTSHARE) -o libinetcfg.la ../serv_inetcfg.lo ../libcitserver.la
174 modules/librwho.la: serv_rwho.lo $(LIBTOOL) libcitserver.la
175 $(LTSHARE) -o librwho.la ../serv_rwho.lo ../libcitserver.la
177 modules/libmoderate.la: serv_moderate.lo $(LIBTOOL) libcitserver.la
178 $(LTSHARE) -o libmoderate.la ../serv_moderate.lo ../libcitserver.la
180 modules/libbio.la: serv_bio.lo $(LIBTOOL) libcitserver.la
181 $(LTSHARE) -o libbio.la ../serv_bio.lo ../libcitserver.la
183 modules/libexpire.la: serv_expire.lo $(LIBTOOL) libcitserver.la
184 $(LTSHARE) -o libexpire.la ../serv_expire.lo ../libcitserver.la
186 modules/libvandelay.la: serv_vandelay.lo $(LIBTOOL) libcitserver.la
187 $(LTSHARE) -o libvandelay.la ../serv_vandelay.lo ../libcitserver.la
189 modules/libnetwork.la: serv_network.lo $(LIBTOOL) libcitserver.la
190 $(LTSHARE) -o libnetwork.la ../serv_network.lo ../libcitserver.la
192 modules/libupgrade.la: serv_upgrade.lo $(LIBTOOL) libcitserver.la
193 $(LTSHARE) -o libupgrade.la ../serv_upgrade.lo ../libcitserver.la
195 modules/libvcard.la: serv_vcard.lo vcard.lo $(LIBTOOL) libcitserver.la
196 $(LTSHARE) -o libvcard.la ../serv_vcard.lo ../vcard.lo ../libcitserver.la
198 modules/libsmtp.la: serv_smtp.lo domain.lo $(LIBTOOL) libcitserver.la
199 $(LTSHARE) -o libsmtp.la ../serv_smtp.lo ../domain.lo ../libcitserver.la
202 modules/libimap.la: serv_imap.lo imap_tools.lo imap_fetch.lo \
203 imap_search.lo imap_store.lo imap_misc.lo $(LIBTOOL) libcitserver.la
204 $(LTSHARE) -o libimap.la ../imap_tools.lo ../serv_imap.lo \
205 ../imap_fetch.lo ../imap_search.lo ../imap_store.lo ../imap_misc.lo ../libcitserver.la
207 aidepost: aidepost.o libcitserver.la $(LIBOBJS)
208 $(LIBTOOL) $(CC) aidepost.o libcitserver.la $(LIBOBJS) $(LDFLAGS) -o aidepost
210 modules/libpas2.la: serv_pas2.lo md5.lo $(LIBTOOL) libcitserver.la
211 $(LTSHARE) -o libpas2.la ../serv_pas2.lo ../md5.lo ../libcitserver.la
213 modules/libical.la: serv_ical.lo $(LIBTOOL) libcitserver.la
214 $(LTSHARE) -o libical.la ../serv_ical.lo ../libcitserver.la
219 # 'netmailer' needs to run setuid because it generates headers for Internet
220 # mail. If it is not run setuid, all outgoing mail may always show as coming
221 # from your BBSUID rather than the actual sending user.
223 netmailer: netmailer.o internetmail.o config.o genstamp.o
224 $(CC) netmailer.o config.o internetmail.o genstamp.o \
225 $(LDFLAGS) -o netmailer
227 netproc: netproc.o config.o ipc_c_tcp.o tools.o $(LIBOBJS)
228 $(CC) netproc.o config.o ipc_c_tcp.o tools.o \
229 $(LIBOBJS) $(LDFLAGS) -o netproc $(NETLIBS)
231 citmail: citmail.o config.o
232 $(CC) citmail.o config.o $(LDFLAGS) -o citmail $(NETLIBS)
234 mailinglist: mailinglist.o config.o internetmail.o
235 $(CC) mailinglist.o config.o internetmail.o $(LDFLAGS) -o mailinglist
237 setup: setup.o tools.o
238 $(CC) setup.o tools.o $(CURSES) $(NETLIBS) $(LDFLAGS) -o setup
240 chkpwd: chkpwd.o auth.o config.o
241 $(CC) chkpwd.o auth.o config.o $(LDFLAGS) -o chkpwd $(chkpwd_LIBS)
243 netsetup: netsetup.o config.o
244 $(CC) netsetup.o config.o $(LDFLAGS) -o netsetup
246 whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o $(LIBOBJS)
247 $(CC) whobbs.o ipc_c_tcp.o tools.o $(LIBOBJS) $(LDFLAGS) -o whobbs $(NETLIBS)
249 sendcommand: sendcommand.o ipc_c_tcp.o libcitserver.la $(LIBOBJS)
250 $(LIBTOOL) $(CC) sendcommand.o ipc_c_tcp.o libcitserver.la \
251 $(LIBOBJS) $(LDFLAGS) -o sendcommand $(NETLIBS)
254 $(CC) qpdecode.o $(LDFLAGS) -o qpdecode
257 $(CC) base64.o $(LDFLAGS) -o base64
259 userlist: userlist.o ipc_c_tcp.o tools.o $(LIBOBJS)
260 $(CC) userlist.o ipc_c_tcp.o tools.o \
261 $(LIBOBJS) $(LDFLAGS) -o userlist $(NETLIBS)
264 $(CC) msgform.o $(LDFLAGS) -o msgform
266 readlog: readlog.o config.o
267 $(CC) readlog.o config.o $(LDFLAGS) -o readlog
269 rcit: rcit.o config.o
270 $(CC) rcit.o config.o $(LDFLAGS) -o rcit
272 stats: stats.o ipc_c_tcp.o libcitserver.la $(LIBOBJS)
273 $(LIBTOOL) $(CC) stats.o ipc_c_tcp.o libcitserver.la $(LIBOBJS) $(LDFLAGS) -o stats $(NETLIBS)
275 .PHONY: install-data install-doc install-exec clean cleaner distclean
277 install: install-exec install-data install-doc
280 @for i in help messages network/spoolin network/spoolout \
281 network/systems; do \
282 $(srcdir)/mkinstalldirs $(root)$(prefix)/$$i; \
284 @for i in citadel.rc public_clients \
285 `find $(srcdir)/help $(srcdir)/messages $(srcdir)/network -type f | grep -v CVS`; do \
286 echo $(INSTALL_DATA) $$i $(root)$(prefix)/$$i; \
287 $(INSTALL_DATA) $$i $(root)$(prefix)/$$i; \
289 -@if test -d $(root)/etc/pam.d; then \
290 echo $(INSTALL_DATA) $(srcdir)/citadel.pam $(root)/etc/pam.d/citadel; \
291 $(INSTALL_DATA) $(srcdir)/citadel.pam $(root)/etc/pam.d/citadel; \
295 @$(srcdir)/mkinstalldirs $(root)$(prefix)/techdoc
296 @for i in `find $(srcdir)/techdoc -type f | grep -v CVS`; do \
297 echo $(INSTALL_DATA) $$i $(root)$(prefix)/$$i; \
298 $(INSTALL_DATA) $$i $(root)$(prefix)/$$i; \
301 install-exec: all weekly
302 @for i in bio bitbucket files images info modules userpics; do \
303 $(srcdir)/mkinstalldirs $(root)$(prefix)/$$i; \
305 @for i in $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS); do \
306 if test -f $$i; then \
307 echo $(LIBTOOL) --mode=install $(INSTALL) $$i $(root)$(prefix)/$$i; \
308 $(LIBTOOL) --mode=install $(INSTALL) $$i $(root)$(prefix)/$$i; \
311 @for i in $(SERV_MODULES) ; do \
312 if test -f $$i; then \
313 (cd modules && ../$(LIBTOOL) --mode=install $(INSTALL) `basename $$i` $(root)$(prefix)/$$i) ; \
316 @for i in utilsmenu weekly dnetsetup; do \
317 if test -f $(srcdir)/$$i; then \
318 echo $(INSTALL) $(srcdir)/$$i $(root)$(prefix)/$$i; \
319 $(INSTALL) $(srcdir)/$$i $(root)$(prefix)/$$i; \
322 @if test x`find $(root)$(prefix)/chkpwd -user root` = x$(root)$(prefix)/chkpwd; then \
323 echo chmod u+s $(root)$(prefix)/chkpwd; \
324 chmod u+s $(root)$(prefix)/chkpwd; \
328 rm -f *.o *.ro *.lo parsedate.c
331 rm -rf $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
332 modules/*.la modules/.libs so_locations
335 find . -name '*~' -o -name '.#*' | xargs rm -f
336 rm -f Makefile sysdep.h config.cache config.log config.status *.d weekly
339 @echo Checking dependencies for $<
340 @$(CC) -M $(CPPFLAGS) $(PTHREAD_DEFS) $< | sed -e 's!$*.o!$*.o $*.ro $*.lo $@!' > $@
341 @test -s $@ || rm -f $@
343 Makefile: $(srcdir)/Makefile.in config.status
344 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
346 config.status: $(srcdir)/configure
347 $(SHELL) ./config.status --recheck
349 $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4
350 cd $(srcdir) && $(AUTOCONF)
352 weekly: $(srcdir)/weekly.in config.status
353 CONFIG_FILES=weekly CONFIG_HEADERS= $(SHELL) ./config.status
355 LIBTOOL_DEPS = @LIBTOOL_DEPS@
356 $(LIBTOOL): $(LIBTOOL_DEPS)
357 $(SHELL) ./config.status --recheck
359 -include $(DEP_FILES)