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@uncnsrd.mt-kisco.ny.us and let me know what you
9 # did, so any necessary changes can be put into the next release.
11 ########################################################################
19 CLIENT_TARGETS=citadel whobbs
20 SERVER_TARGETS=citserver setup
21 SERV_MODULES=modules/serv_chat.so modules/serv_test.so \
22 modules/serv_upgrade.so modules/serv_expire.so
23 UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
24 readlog rcit stats citmail netpoll mailinglist userlist sendcommand
31 CPPFLAGS=@CPPFLAGS@ -I.
36 SERVER_LDFLAGS=@SERVER_LDFLAGS@
40 PTHREAD_DEFS=-D_REENTRANT
42 INSTALL_DATA=@INSTALL_DATA@
46 # End configuration section
50 SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \
51 config.c control.c cux2ascii.c database.c dynloader.c file_ops.c \
52 housekeeping.c internetmail.c ipc_c_tcp.c locate_host.c \
53 logging.c mailinglist.c messages.c msgbase.c msgform.c netmailer.c \
54 netpoll.c netproc.c netsetup.c policy.c proxy.c rcit.c readlog.c \
55 room_ops.c rooms.c routines.c routines2.c serv_chat.c \
56 serv_info.c serv_test.c serv_upgrade.c setup.c snprintf.c stats.c \
57 support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \
58 whobbs.c sendcommand.c
60 DEP_FILES=$(SOURCES:.c=.d)
62 client: $(CLIENT_TARGETS)
64 server: $(SERVER_TARGETS)
66 utils: $(UTIL_TARGETS)
68 serv_modules: $(SERV_MODULES)
73 citadel: ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
74 commands.o client_chat.o serv_info.o tools.o $(SNPRINTF)
75 $(CC) 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) $(LDFLAGS) \
79 netpoll: netpoll.o config.o ipc_c_tcp.o tools.o $(SNPRINTF)
80 $(CC) netpoll.o config.o ipc_c_tcp.o tools.o \
81 $(SNPRINTF) $(LDFLAGS) -o netpoll
84 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $<
89 citserver: citserver.ro user_ops.ro support.ro room_ops.ro file_ops.ro \
90 msgbase.ro config.ro sysdep.ro locate_host.ro \
91 housekeeping.ro database.ro control.ro logging.ro \
92 policy.ro dynloader.ro tools.ro $(SNPRINTF:.o=.ro)
94 citserver.ro user_ops.ro room_ops.ro file_ops.ro support.ro \
95 msgbase.ro config.ro sysdep.ro locate_host.ro \
96 housekeeping.ro database.ro control.ro logging.ro \
97 policy.ro dynloader.ro tools.ro $(SNPRINTF:.o=.ro)\
98 $(LDFLAGS) $(SERVER_LDFLAGS) $(LIBS) -o citserver
101 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PTHREAD_DEFS) -c $< -o $@
103 modules/serv_chat.so: serv_chat.mo
104 $(CC) -shared -o modules/serv_chat.so serv_chat.mo
107 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PTHREAD_DEFS) $(PICFLAGS) -DPIC -c $< -o $@
109 modules/serv_test.so: serv_test.mo
110 $(CC) -shared -o modules/serv_test.so serv_test.mo
112 modules/serv_upgrade.so: serv_upgrade.mo
113 $(CC) -shared -o modules/serv_upgrade.so serv_upgrade.mo
115 modules/serv_expire.so: serv_expire.mo
116 $(CC) -shared -o modules/serv_expire.so serv_expire.mo
118 aidepost: aidepost.o config.o $(SNPRINTF)
119 $(CC) aidepost.o config.o $(SNPRINTF) $(LDFLAGS) -o aidepost
122 # 'netmailer' needs to run setuid because it generates headers for Internet
123 # mail. If it is not run setuid, all outgoing mail may always show as coming
124 # from your BBSUID rather than the actual sending user.
126 netmailer: netmailer.o internetmail.o config.o
127 $(CC) netmailer.o config.o internetmail.o $(LDFLAGS) -o netmailer
129 netproc: netproc.o config.o ipc_c_tcp.o tools.o $(SNPRINTF)
130 $(CC) netproc.o config.o ipc_c_tcp.o tools.o \
131 $(SNPRINTF) $(LDFLAGS) -o netproc
133 citmail: citmail.o config.o internetmail.o $(SNPRINTF)
135 @echo "* ###### IMPORTANT ######"
136 @echo "* To allow Citadel users to receive Internet mail, you must"
137 @echo "* set this program to be your local mail delivery agent."
139 $(CC) citmail.o config.o internetmail.o $(SNPRINTF) $(LDFLAGS) -o citmail
141 mailinglist: mailinglist.o config.o internetmail.o
142 $(CC) mailinglist.o config.o internetmail.o $(LDFLAGS) -o mailinglist
145 $(CC) setup.o $(CURSES) $(LDFLAGS) -o setup
147 netsetup: netsetup.o config.o
148 $(CC) netsetup.o config.o $(LDFLAGS) -o netsetup
150 proxy: proxy.o ipc_c_tcp.o
151 $(CC) proxy.o ipc_c_tcp.o $(LDFLAGS) -o proxy
153 whobbs: whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF)
154 $(CC) whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF) $(LDFLAGS) -o whobbs
156 sendcommand: sendcommand.o ipc_c_tcp.o tools.o $(SNPRINTF)
157 $(CC) sendcommand.o ipc_c_tcp.o tools.o $(SNPRINTF) $(LDFLAGS) \
159 chmod 700 sendcommand
161 userlist: userlist.o ipc_c_tcp.o tools.o $(SNPRINTF)
162 $(CC) userlist.o ipc_c_tcp.o tools.o \
163 $(SNPRINTF) $(LDFLAGS) -o userlist
166 $(CC) msgform.o $(LDFLAGS) -o msgform
168 readlog: readlog.o config.o
169 $(CC) readlog.o config.o $(LDFLAGS) -o readlog
171 rcit: rcit.o config.o
172 $(CC) rcit.o config.o $(LDFLAGS) -o rcit
174 @echo "* NOTE: TO RECEIVE CITADEL TRAFFIC VIA THE RCIT PROGRAM (ESPECIALLY"
175 @echo "* IF YOU ARE GATEWAYING TO USENET) YOU MUST LINK RNEWS TO RCIT:"
176 @echo "* ln -s rcit /usr/bin/rnews"
179 stats: stats.o config.o
180 $(CC) stats.o config.o $(LDFLAGS) -o stats
182 .PHONY: install-data install-doc install-exec clean cleaner distclean
184 install: install-exec install-data install-doc
187 for i in help messages network/spoolin network/spoolout \
188 network/systems; do \
189 ./mkinstalldirs $(prefix)/$$i; \
191 for i in citadel.rc public_clients \
192 `find help messages network -type f | grep -v CVS`; do \
193 $(INSTALL_DATA) $$i $(prefix)/$$i; \
197 ./mkinstalldirs $(prefix)/techdoc
198 for i in *.txt `find techdoc -type f | grep -v CVS`; do \
199 $(INSTALL_DATA) $$i $(prefix)/$$i; \
203 for i in bio bitbucket files images info modules userpics; do \
204 ./mkinstalldirs $(prefix)/$$i; \
206 for i in $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
207 $(PROXY_TARGETS) $(SERV_MODULES) utilsmenu weekly \
209 test -f $$i && $(INSTALL) $$i $(prefix)/$$i; \
216 rm -f $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
217 $(SERV_MODULES) $(PROXY_TARGETS) so_locations
220 rm -f Makefile sysdep.h config.cache config.log config.status *.d
223 $(CC) -M $(CPPFLAGS) $< | sed -e 's!$*.o!$*.o $*.ro $*.mo $@!' > $@
224 test -s $@ || rm -f $@
226 Makefile: $(srcdir)/Makefile.in config.status
227 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
229 config.status: $(srcdir)/configure
230 $(SHELL) ./config.status --recheck
232 $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4
233 cd $(srcdir) && $(AUTOCONF)
235 -include $(DEP_FILES)