GNUmakefile 13.2 KB
Newer Older
1
# GNUmakefile
2
3

#########################################################################
4
# Makefile for Synchronet BBS for Unix									#
5
# For use with GNU make and GNU C Compiler or Borland Kylix C++			#
6
7
# @format.tab-size 4, @format.use-tabs true								#
#																		#
8
9
# gcc: gmake															#
# Borland (still in testing/debuging stage): gmake bcc=1				#
10
11
12
13
14
15
16
#																		#
# Optional build targets: dlls, utils, mono, all (default)				#
#########################################################################

# $Id$

# Macros
17
18
19
20
21
22
ifndef DEBUG
 ifndef RELEASE
  DEBUG	:=	1
 endif
endif

deuce's avatar
deuce committed
23
#USE_DIALOG =   1       # Dialog vesrion of UIFC
24
#USE_FLTK =     1       # Use Windowed version
deuce's avatar
deuce committed
25
26
USE_CURSES      =       1       # Curses version of UIFC

27
ifdef DEBUG
28
 BUILD	=	debug
29
else
30
 BUILD	=	release
31
32
endif

33
ifdef bcc
34
35
36
37
 CC		=	bc++ -q
 CCPRE	:=	bcc
 CCPP	=	bc++ -q
 LD		=	ilink -q
38
 CFLAGS +=	-mm -md -D__unix__ -w-csu -w-pch -w-ccc -w-rch -w-par -w-aus
39
else
40
 CFLAGS	+=	-MMD -Wall
deuce's avatar
deuce committed
41
 CCPRE	:=	gcc
42
43
44
45
46
47
48
 ifdef BUILD_DEPENDS
  CC		=	../build/mkdep -a
  CCPP	=	../build/mkdep -a
  LD		=	echo
  COMPILE_MSG	:= Depending
 else
  CC		=	gcc
deuce's avatar
deuce committed
49
  CCPP	=	g++
50
51
52
  LD		=	ld
  COMPILE_MSG	:= Compiling
 endif
53
endif
54
55
56
SLASH	=	/
OFILE	=	o

57
LIBFILE	=	.so
rswindell's avatar
rswindell committed
58
UIFC	=	../uifc/
59
XPDEV	=	../xpdev/
60
LIBPREFIX =	lib
61

62
63
ifndef os
 os		:=	$(shell uname)
64
endif
65
66
67
ifeq ($(shell uname -m),ppc)
 os		:=	$(os)-ppc
endif
68
# this line wont work with solaris unless awk in path is actually gawk 
69
os      :=	$(shell echo $(os) | tr "[ A-Z]" "[\-a-z]")
70
71
# remove '/' from "os/2"
os      :=  $(shell echo $(os) | tr -d "/")
72

73
74
ifeq ($(os),freebsd)
 BSD	=	1
75
else
76
77
78
 ifeq ($(os),openbsd)
  BSD	=	1
 endif
79
endif
80

81
82
LIBODIR :=	$(CCPRE).$(os).lib.$(BUILD)
EXEODIR :=	$(CCPRE).$(os).exe.$(BUILD)
83

84
DELETE	=	rm -f
85

86
CFLAGS	+=	-DJAVASCRIPT -I../../include/mozilla/js -I$(XPDEV) -I$(UIFC)
87

88
89
ifdef BSD	# BSD
 # Math libraries needed and uses pthread
90
91
 LFLAGS	:=	-lm -lutil -lc_r
 CFLAGS +=	-pthread 
92
else			# Linux / Other UNIX
93
94
95
96
97
98
 # Math and pthread libraries needed
 ifdef bcc
  LFLAGS	:=	libpthread.so
 else
  LFLAGS	:=	-lm -lpthread -lutil
 endif
99
endif
100

101
102
ifeq ($(os),linux)    # Linux
 CFLAGS	+= -D_THREAD_SUID_BROKEN
103
104
endif

105
ifeq ($(os),sunos)    # Solaris
106
107
 CFLAGS	:= -D_REENTRANT -D__solaris__ -DNEEDS_DAEMON -D_POSIX_PTHREAD_SEMANTICS -DNEEDS_FORKPTY
 LFLAGS := -lm -lpthread -lsocket -lnsl -lrt
108
109
endif

110
ifeq ($(os),netbsd)
111
 CFLAGS += -D_REENTRANT -D__unix__ -I/usr/pkg/include -DNEEDS_FORKPTY
112
 LFLAGS := -lm -lpthread -L/usr/pkg/lib -L/usr/pkg/pthreads/lib
113
114
endif

115
# So far, only QNX has sem_timedwait()
116
117
ifeq ($(os),qnx)
 LFLAGS := -lm -lsocket
118
119
120
else
 CFLAGS	+=	-DUSE_XP_SEMAPHORES
 USE_XP_SEMAPHORES	:=	1
121
122
endif

123
ifdef DEBUG
124
125
126
127
128
129
 ifdef bcc
  CFLAGS	+=	-y -v -Od
 else
  CFLAGS	+=	-ggdb
 endif
 CFLAGS  +=	-D_DEBUG
130
131
else
 CFLAGS	+= -O3
132
endif
133

134
135
136
ifdef JSLIB
 LIBS	+=	$(JSLIB)
else
137
 LIBS	+=	../../lib/mozilla/js/$(os).$(BUILD)/libjs.a ../../lib/mozilla/nspr/$(os).$(BUILD)/libnspr4.a
138
139
endif

140
# The following are needed for echocfg (uses UIFC)
141
UIFC_OBJS =	$(LIBODIR)/uifcx.o
142
ifdef USE_FLTK
143
144
 CFLAGS +=	-DUSE_FLTK -I../../include/fltk
 UIFC_LFLAGS += -L../../lib/fltk/$(os) -L/usr/X11R6/lib -lm -lfltk -lX11
145
 UIFC_OBJS+=	$(LIBODIR)/uifcfltk.o
146
endif
deuce's avatar
deuce committed
147
ifdef USE_CURSES
148
 CFLAGS +=	-DUSE_CURSES
149
150
151
152
153
 ifeq ($(os),qnx)
  UIFC_LFLAGS += -lncurses
 else
  UIFC_LFLAGS += -lcurses
 endif
154
 UIFC_OBJS +=	$(LIBODIR)/uifcc.o
deuce's avatar
deuce committed
155
endif
156

157
158
159
160
161
#The following is needed for nspr support on Linux
ifeq ($(os),linux)
 LFLAGS	+=	-ldl
endif

rswindell's avatar
rswindell committed
162
163
164
include targets.mk		# defines all targets
include objects.mk		# defines $(OBJS)
include sbbsdefs.mk		# defines $(SBBSDEFS)
165

166
167
ifeq ($(USE_XP_SEMAPHORES),1)
 OBJS	+=	$(LIBODIR)$(SLASH)xpsem.$(OFILE)
168
169
endif

170
171
172
173
174
#SBBSLIB	=	$(LIBODIR)$(SLASH)libsbbs.so
SBBSLIB	=	-lsbbs

#dummy rule
$(SBBSLIB) : $(SBBS)
175

rswindell's avatar
rswindell committed
176
vpath %.c $(XPDEV) $(UIFC)
177
vpath %.cpp $(UIFC)
rswindell's avatar
rswindell committed
178

179
LFLAGS		+=	-L./$(LIBODIR)
180
SBBSLDFLAGS	:=	$(LFLAGS) -rpath-link ./$(LIBODIR) -rpath ./ 
181
182
183
#LFLAGS		+=	-Wl,-rpath-link,./$(LIBODIR),-rpath,./
LFLAGS		+=	-Xlinker -rpath
LFLAGS		+=	-Xlinker .
deuce's avatar
deuce committed
184
185
186
187
ifneq ($(os),openbsd)
LFLAGS		+=	-Xlinker -rpath-link
LFLAGS		+=	-Xlinker ./$(LIBODIR)
endif
188
189
190
191
192
193
ifeq ($(os),freebsd)
LFLAGS		+=	-pthread
endif
ifeq ($(os),openbsd)
LFLAGS		+=	-pthread
endif
194

195
# Implicit C Compile Rule for SBBS
deuce's avatar
deuce committed
196
$(LIBODIR)/%.o : %.c $(BUILD_DEPENDS)
197
   ifndef bcc
198
	@echo $(COMPILE_MSG) $<
199
   endif
200
	@$(CC) $(CFLAGS) $(SBBSDEFS) -o $@ -c $<
201
202

# Implicit C++ Compile Rule for SBBS
deuce's avatar
deuce committed
203
$(LIBODIR)/%.o : %.cpp $(BUILD_DEPENDS)
204
   ifndef bcc
205
	@echo $(COMPILE_MSG) $<
206
   endif
207
	@$(CCPP) $(CFLAGS) $(SBBSDEFS) -o $@ -c $<
208
209
210
211
212
213
214

$(LIBODIR):
	mkdir $(LIBODIR)

$(EXEODIR):
	mkdir $(EXEODIR)

215
216
CON_OBJS	= $(LIBODIR)/sbbscon.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
217
CON_LDFLAGS	= -lftpsrvr -lwebsrvr -lmailsrvr -lservices
218
FTP_OBJS	= $(LIBODIR)/ftpsrvr.o
219
MAIL_OBJS	= $(LIBODIR)/mailsrvr.o $(LIBODIR)/mxlookup.o \
deuce's avatar
deuce committed
220
 		  $(LIBODIR)/mime.o $(LIBODIR)/base64.o
deuce's avatar
deuce committed
221
WEB_OBJS	= $(LIBODIR)/websrvr.o $(LIBODIR)/sockwrap.o $(LIBODIR)/base64.o
222
SERVICE_OBJS	= $(LIBODIR)/services.o
223

rswindell's avatar
rswindell committed
224
225
MONO_OBJS	= $(CON_OBJS) $(FTP_OBJS) $(WEB_OBJS) \
			$(MAIL_OBJS) $(SERVICE_OBJS)
226
SMBLIB_OBJS = \
227
228
229
	$(LIBODIR)/smblib.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/crc16.o
230

231
232

# Monolithic Synchronet executable Build Rule
233
FORCE$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS)
deuce's avatar
deuce committed
234

235
$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS)
236
	@echo Linking $@
237
	@$(CCPP) -o $@ $(LFLAGS) $^
238
239

# Synchronet BBS library Link Rule
240
FORCE$(SBBS): $(OBJS) $(LIBS)
deuce's avatar
deuce committed
241

242
$(SBBS): $(OBJS) $(LIBS)
243
	@echo Linking $@
244
	@$(CCPP) $(LFLAGS) -o $(SBBS) $^ -shared -o $@
245
246

# FTP Server Link Rule
247
FORCE$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
deuce's avatar
deuce committed
248
249

$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
250
	@echo Linking $@
rswindell's avatar
rswindell committed
251
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@ 
252
253

# Mail Server Link Rule
254
FORCE$(MAILSRVR): $(MAIL_OBJS) $(LIBODIR)$(SLASH)$(SBBSLIB)
deuce's avatar
deuce committed
255
256

$(MAILSRVR): $(MAIL_OBJS) $(SBBSLIB)
257
	@echo Linking $@
258
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@
259
260
261
262
263
264

# Mail Server Link Rule
FORCE$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)

$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)
	@echo Linking $@
265
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@
266
267
268
269
270
271

# Services Link Rule
FORCE$(SERVICES): $(WEB_OBJS) $(SBBSLIB)

$(SERVICES): $(SERVICE_OBJS) $(SBBSLIB)
	@echo Linking $@
272
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@
273
274

# Synchronet Console Build Rule
275
FORCE$(SBBSCON): $(CON_OBJS) $(SBBSLIB) $(FTP_OBJS) $(MAIL_OBJS) $(WEB_OBJS) $(SERVICE_OBJS)
deuce's avatar
deuce committed
276

277
278
279
$(SBBSCON): $(CON_OBJS) $(SBBSLIB) $(FTPSRVR) $(WEBSRVR) $(MAILSRVR) $(SERVICES)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) $(CON_LDFLAGS) -o $@ $(CON_OBJS) $(SBBSLIB)
280
281

# Specifc Compile Rules
deuce's avatar
deuce committed
282
$(LIBODIR)/ftpsrvr.o: ftpsrvr.c ftpsrvr.h $(BUILD_DEPENDS)
283
	@echo $(COMPILE_MSG) $<
284
	@$(CC) $(CFLAGS) -DFTPSRVR_EXPORTS -o $@ -c $<
285

deuce's avatar
deuce committed
286
$(LIBODIR)/mailsrvr.o: mailsrvr.c mailsrvr.h $(BUILD_DEPENDS)
287
	@echo $(COMPILE_MSG) $<
288
	@$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<
289

deuce's avatar
deuce committed
290
$(LIBODIR)/mxlookup.o: mxlookup.c $(BUILD_DEPENDS)
291
	@echo $(COMPILE_MSG) $<
292
	@$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<
293

deuce's avatar
deuce committed
294
$(LIBODIR)/mime.o: mime.c $(BUILD_DEPENDS)
295
	@echo $(COMPILE_MSG) $<
296
	@$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<		
297

deuce's avatar
deuce committed
298
$(LIBODIR)/websrvr.o: websrvr.c websrvr.h $(BUILD_DEPENDS)
299
	@echo $(COMPILE_MSG) $<
deuce's avatar
deuce committed
300
301
	@$(CC) $(CFLAGS) -DWEBSRVR_EXPORTS -o $@ -c $<

deuce's avatar
deuce committed
302
$(LIBODIR)/base64.o: base64.c base64.h $(BUILD_DEPENDS)
303
	@echo $(COMPILE_MSG) $<
rswindell's avatar
rswindell committed
304
305
	@$(CC) $(CFLAGS) -DWEBSRVR_EXPORTS -o $@ -c $<

deuce's avatar
deuce committed
306
$(LIBODIR)/services.o: services.c services.h $(BUILD_DEPENDS)
307
	@echo $(COMPILE_MSG) $<
308
	@$(CC) $(CFLAGS) -DSERVICES_EXPORTS -o $@ -c $<
309
310

# Baja Utility
311
BAJA_OBJS = \
312
313
314
315
316
	$(LIBODIR)/baja.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/crc32.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/filewrap.o
317
FORCE$(BAJA): $(BAJA_OBJS)
deuce's avatar
deuce committed
318

319
$(BAJA): $(BAJA_OBJS)
320
	@echo Linking $@
321
	@$(CC) -o $@ $^
322
323

# Node Utility
324
NODE_OBJS = \
325
326
327
	$(LIBODIR)/node.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/filewrap.o
328
FORCE$(NODE): $(NODE_OBJS)
deuce's avatar
deuce committed
329

330
$(NODE): $(NODE_OBJS)
331
	@echo Linking $@
332
	@$(CC) -o $@ $^ 
333
334

# FIXSMB Utility
335
FIXSMB_OBJS = \
336
	$(LIBODIR)/fixsmb.o \
337
	$(SMBLIB_OBJS) \
338
339
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/str_util.o
340
341
342
FORCE$(FIXSMB): $(FIXSMB_OBJS)
	
$(FIXSMB): $(FIXSMB_OBJS)
343
	@echo Linking $@
344
	@$(CC) -o $@ $^
345
346

# CHKSMB Utility
347
CHKSMB_OBJS = \
348
	$(LIBODIR)/chksmb.o \
349
	$(SMBLIB_OBJS) \
350
351
352
	$(LIBODIR)/conwrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o
353
FORCE$(CHKSMB): $(CHKSMB_OBJS)
deuce's avatar
deuce committed
354

355
$(CHKSMB): $(CHKSMB_OBJS)
356
	@echo Linking $@
357
	@$(CC) -o $@ $^
358
359

# SMB Utility
360
SMBUTIL_OBJS = \
361
	$(LIBODIR)/smbutil.o \
362
	$(SMBLIB_OBJS) \
363
364
365
366
367
368
369
370
	$(LIBODIR)/conwrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/smbtxt.o \
	$(LIBODIR)/crc32.o \
	$(LIBODIR)/lzh.o \
	$(LIBODIR)/date_str.o \
	$(LIBODIR)/str_util.o
371
372
373
374
375
FORCE$(SMBUTIL): $(SMBUTIL_OBJS)
	
$(SMBUTIL): $(SMBUTIL_OBJS)
	@echo Linking $@
	@$(CC) -o $@ $^
deuce's avatar
deuce committed
376

377
378
# SBBSecho (FidoNet Packet Tosser)
SBBSECHO_OBJS = \
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
	$(LIBODIR)/sbbsecho.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/crc32.o \
	$(LIBODIR)/date_str.o \
	$(LIBODIR)/load_cfg.o \
	$(LIBODIR)/scfglib1.o \
	$(LIBODIR)/scfglib2.o \
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/dat_rec.o \
	$(LIBODIR)/userdat.o \
	$(LIBODIR)/rechocfg.o \
	$(LIBODIR)/conwrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o \
394
	$(SMBLIB_OBJS) \
395
396
	$(LIBODIR)/smbtxt.o \
	$(LIBODIR)/lzh.o
397
398
399
400

FORCE$(SBBSECHO): $(SBBSECHO_OBJS)

$(SBBSECHO): $(SBBSECHO_OBJS)
rswindell's avatar
rswindell committed
401
	@echo Linking $@
402
	@$(CC) -o $@ $^
rswindell's avatar
rswindell committed
403

rswindell's avatar
rswindell committed
404
# SBBSecho Configuration Program
rswindell's avatar
rswindell committed
405
ECHOCFG_OBJS = \
406
407
	$(LIBODIR)/echocfg.o \
	$(LIBODIR)/rechocfg.o \
deuce's avatar
deuce committed
408
	$(UIFC_OBJS) \
409
410
411
412
413
414
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/crc16.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/dirwrap.o
deuce's avatar
deuce committed
415

416
417
418
FORCE$(ECHOCFG): $(ECHOCFG_OBJS)

$(ECHOCFG): $(ECHOCFG_OBJS)
rswindell's avatar
rswindell committed
419
	@echo Linking $@
420
	@$(CC) -o $@ $^ $(UIFC_LFLAGS)
rswindell's avatar
rswindell committed
421

rswindell's avatar
rswindell committed
422
# ADDFILES
423
ADDFILES_OBJS = \
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
	$(LIBODIR)/addfiles.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/date_str.o \
	$(LIBODIR)/load_cfg.o \
	$(LIBODIR)/scfglib1.o \
	$(LIBODIR)/scfglib2.o \
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/crc16.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/dat_rec.o \
	$(LIBODIR)/userdat.o \
	$(LIBODIR)/filedat.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o
deuce's avatar
deuce committed
439

440
441
442
FORCE$(ADDFILES): $(ADDFILES_OBJS)

$(ADDFILES): $(ADDFILES_OBJS)
rswindell's avatar
rswindell committed
443
444
445
	@echo Linking $@
	@$(CC) -o $@ $^

446
# FILELIST
447
FILELIST_OBJS = \
448
449
450
451
452
453
454
455
456
457
458
459
460
461
	$(LIBODIR)/filelist.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/date_str.o \
	$(LIBODIR)/load_cfg.o \
	$(LIBODIR)/scfglib1.o \
	$(LIBODIR)/scfglib2.o \
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/crc16.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/dat_rec.o \
	$(LIBODIR)/filedat.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o
deuce's avatar
deuce committed
462

463
464
465
FORCE$(FILELIST): $(FILELIST_OBJS)

$(FILELIST): $(FILELIST_OBJS)
466
467
468
	@echo Linking $@
	@$(CC) -o $@ $^

469
# MAKEUSER
470
MAKEUSER_OBJS = \
471
472
473
474
475
476
477
478
479
480
481
482
483
484
	$(LIBODIR)/makeuser.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/date_str.o \
	$(LIBODIR)/load_cfg.o \
	$(LIBODIR)/scfglib1.o \
	$(LIBODIR)/scfglib2.o \
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/crc16.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/dat_rec.o \
	$(LIBODIR)/userdat.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o
deuce's avatar
deuce committed
485

486
487
488
FORCE$(MAKEUSER): $(MAKEUSER_OBJS)

$(MAKEUSER): $(MAKEUSER_OBJS)
489
490
	@echo Linking $@
	@$(CC) -o $@ $^
deuce's avatar
deuce committed
491

rswindell's avatar
rswindell committed
492
493
# JSEXEC
JSEXEC_OBJS = \
494
	$(LIBODIR)/jsexec.o \
495
	$(SBBSLIB)
rswindell's avatar
rswindell committed
496
497
498

FORCE$(JSEXEC): $(JSEXEC_OBJS)

499
$(JSEXEC): $(JSEXEC_OBJS) $(LIBS)
rswindell's avatar
rswindell committed
500
	@echo Linking $@
501
	@$(CCPP) -o $@ $(LFLAGS) $^
rswindell's avatar
rswindell committed
502
503
	
# ANS2MSG
504
505
506
$(ANS2MSG): $(LIBODIR)/ans2msg.o
	@echo Linking $@
	@$(CC) -o $@ $^
deuce's avatar
deuce committed
507

508
509
510
511
# MSG2ANS
$(MSG2ANS): $(LIBODIR)/msg2ans.o
	@echo Linking $@
	@$(CC) -o $@ $^
512

513
514
515
516
517
518
519
520
521
522
523
524
# Single servers
FTPCON_OBJS	= $(LIBODIR)/sbbsftp.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
WEBCON_OBJS	= $(LIBODIR)/sbbsweb.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
MAILCON_OBJS	= $(LIBODIR)/sbbsmail.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
SRVCCON_OBJS	= $(LIBODIR)/sbbssrvc.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
BBSCON_OBJS	= $(LIBODIR)/sbbs_bbs.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o

525
$(LIBODIR)/sbbsweb.o : sbbscon.c
526
527
528
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
529
	@$(CC) $(CFLAGS) -o $@ -c $^ -DNO_TELNET_SERVER -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_SERVICES
530

531
$(LIBODIR)/sbbsftp.o : sbbscon.c
532
533
534
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
535
	@$(CC) $(CFLAGS) -o $@ -c $^ -DNO_TELNET_SERVER -DNO_MAIL_SERVER -DNO_SERVICES -DNO_WEB_SERVER
536

537
$(LIBODIR)/sbbsmail.o : sbbscon.c
538
539
540
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
541
	@$(CC) $(CFLAGS) -o $@ -c $^ -DNO_TELNET_SERVER -DNO_FTP_SERVER -DNO_SERVICES -DNO_WEB_SERVER
542

543
$(LIBODIR)/sbbssrvc.o : sbbscon.c
544
545
546
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
547
	@$(CC) $(CFLAGS) -o $@ -c $^ -DNO_TELNET_SERVER -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_WEB_SERVER
548

549
$(LIBODIR)/sbbs_bbs.o : sbbscon.c
550
551
552
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
553
	@$(CC) $(CFLAGS) -o $@ -c $^ -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_SERVICES -DNO_WEB_SERVER
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575

$(SBBSWEB): $(WEBCON_OBJS) $(SBBSLIB) $(WEBSRVR)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) -lwebsrvr -o $@ $(WEBCON_OBJS) $(SBBSLIB)

$(SBBSFTP): $(FTPCON_OBJS) $(SBBSLIB) $(FTPSRVR)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) -lftpsrvr -o $@ $(FTPCON_OBJS) $(SBBSLIB)

$(SBBSMAIL): $(MAILCON_OBJS) $(SBBSLIB) $(MAILSRVR)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) -lmailsrvr -o $@ $(MAILCON_OBJS) $(SBBSLIB)

$(SBBSSRVC): $(SRVCCON_OBJS) $(SBBSLIB) $(SERVICES)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) -lservices -o $@ $(SRVCCON_OBJS) $(SBBSLIB)

$(SBBS_BBS): $(BBSCON_OBJS) $(SBBSLIB)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(BBSCON_OBJS) $(SBBSLIB)


576
577
578
depend:
	@$(DELETE) $(LIBODIR)/.depend
	@$(DELETE) $(EXEODIR)/.depend
deuce's avatar
deuce committed
579
	$(MAKE) BUILD_DEPENDS=FORCE
deuce's avatar
deuce committed
580

deuce's avatar
deuce committed
581
FORCE:
582

583
584
-include $(LIBODIR)/.depend
-include $(EXEODIR)/.depend
585
586
-include $(LIBODIR)/*.d
-include $(EXEODIR)/*.d