GNUmakefile 13 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
112
 CFLAGS := -D_REENTRANT -D__unix__ -I/usr/pkg/include -DNEEDS_FORKPTY
 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
LFLAGS		+=	-Wl,-rpath-link,./$(LIBODIR),-rpath,./
182
183
184
185
186
187
ifeq ($(os),freebsd)
LFLAGS		+=	-pthread
endif
ifeq ($(os),openbsd)
LFLAGS		+=	-pthread
endif
188

189
# Implicit C Compile Rule for SBBS
deuce's avatar
deuce committed
190
$(LIBODIR)/%.o : %.c $(BUILD_DEPENDS)
191
   ifndef bcc
192
	@echo $(COMPILE_MSG) $<
193
   endif
194
	@$(CC) $(CFLAGS) $(SBBSDEFS) -o $@ -c $<
195
196

# Implicit C++ Compile Rule for SBBS
deuce's avatar
deuce committed
197
$(LIBODIR)/%.o : %.cpp $(BUILD_DEPENDS)
198
   ifndef bcc
199
	@echo $(COMPILE_MSG) $<
200
   endif
201
	@$(CCPP) $(CFLAGS) $(SBBSDEFS) -o $@ -c $<
202
203
204
205
206
207
208

$(LIBODIR):
	mkdir $(LIBODIR)

$(EXEODIR):
	mkdir $(EXEODIR)

209
210
CON_OBJS	= $(LIBODIR)/sbbscon.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
211
CON_LDFLAGS	= -lftpsrvr -lwebsrvr -lmailsrvr -lservices
212
FTP_OBJS	= $(LIBODIR)/ftpsrvr.o
213
MAIL_OBJS	= $(LIBODIR)/mailsrvr.o $(LIBODIR)/mxlookup.o \
deuce's avatar
deuce committed
214
 		  $(LIBODIR)/mime.o $(LIBODIR)/base64.o
deuce's avatar
deuce committed
215
WEB_OBJS	= $(LIBODIR)/websrvr.o $(LIBODIR)/sockwrap.o $(LIBODIR)/base64.o
216
SERVICE_OBJS	= $(LIBODIR)/services.o
217

rswindell's avatar
rswindell committed
218
219
MONO_OBJS	= $(CON_OBJS) $(FTP_OBJS) $(WEB_OBJS) \
			$(MAIL_OBJS) $(SERVICE_OBJS)
220
SMBLIB_OBJS = \
221
222
223
	$(LIBODIR)/smblib.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/crc16.o
224

225
226

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

229
$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS)
230
	@echo Linking $@
231
	@$(CCPP) -o $@ $(LFLAGS) $^
232
233

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

236
$(SBBS): $(OBJS) $(LIBS)
237
	@echo Linking $@
238
	@$(CCPP) $(LFLAGS) -o $(SBBS) $^ -shared -o $@
239
240

# FTP Server Link Rule
241
FORCE$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
deuce's avatar
deuce committed
242
243

$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
244
	@echo Linking $@
rswindell's avatar
rswindell committed
245
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@ 
246
247

# Mail Server Link Rule
248
FORCE$(MAILSRVR): $(MAIL_OBJS) $(LIBODIR)$(SLASH)$(SBBSLIB)
deuce's avatar
deuce committed
249
250

$(MAILSRVR): $(MAIL_OBJS) $(SBBSLIB)
251
	@echo Linking $@
252
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@
253
254
255
256
257
258

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

$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)
	@echo Linking $@
259
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@
260
261
262
263
264
265

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

$(SERVICES): $(SERVICE_OBJS) $(SBBSLIB)
	@echo Linking $@
266
	@$(LD) $(SBBSLDFLAGS) -S $^ $(LIBS) -shared -o $@
267
268

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

271
272
273
$(SBBSCON): $(CON_OBJS) $(SBBSLIB) $(FTPSRVR) $(WEBSRVR) $(MAILSRVR) $(SERVICES)
	@echo Linking $@
	@$(CC) $(CFLAGS) $(LFLAGS) $(CON_LDFLAGS) -o $@ $(CON_OBJS) $(SBBSLIB)
274
275

# Specifc Compile Rules
deuce's avatar
deuce committed
276
$(LIBODIR)/ftpsrvr.o: ftpsrvr.c ftpsrvr.h $(BUILD_DEPENDS)
277
	@echo $(COMPILE_MSG) $<
278
	@$(CC) $(CFLAGS) -DFTPSRVR_EXPORTS -o $@ -c $<
279

deuce's avatar
deuce committed
280
$(LIBODIR)/mailsrvr.o: mailsrvr.c mailsrvr.h $(BUILD_DEPENDS)
281
	@echo $(COMPILE_MSG) $<
282
	@$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<
283

deuce's avatar
deuce committed
284
$(LIBODIR)/mxlookup.o: mxlookup.c $(BUILD_DEPENDS)
285
	@echo $(COMPILE_MSG) $<
286
	@$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<
287

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

deuce's avatar
deuce committed
292
$(LIBODIR)/websrvr.o: websrvr.c websrvr.h $(BUILD_DEPENDS)
293
	@echo $(COMPILE_MSG) $<
deuce's avatar
deuce committed
294
295
	@$(CC) $(CFLAGS) -DWEBSRVR_EXPORTS -o $@ -c $<

deuce's avatar
deuce committed
296
$(LIBODIR)/base64.o: base64.c base64.h $(BUILD_DEPENDS)
297
	@echo $(COMPILE_MSG) $<
rswindell's avatar
rswindell committed
298
299
	@$(CC) $(CFLAGS) -DWEBSRVR_EXPORTS -o $@ -c $<

deuce's avatar
deuce committed
300
$(LIBODIR)/services.o: services.c services.h $(BUILD_DEPENDS)
301
	@echo $(COMPILE_MSG) $<
302
	@$(CC) $(CFLAGS) -DSERVICES_EXPORTS -o $@ -c $<
303
304

# Baja Utility
305
BAJA_OBJS = \
306
307
308
309
310
	$(LIBODIR)/baja.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/crc32.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/filewrap.o
311
FORCE$(BAJA): $(BAJA_OBJS)
deuce's avatar
deuce committed
312

313
$(BAJA): $(BAJA_OBJS)
314
	@echo Linking $@
315
	@$(CC) -o $@ $^
316
317

# Node Utility
318
NODE_OBJS = \
319
320
321
	$(LIBODIR)/node.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/filewrap.o
322
FORCE$(NODE): $(NODE_OBJS)
deuce's avatar
deuce committed
323

324
$(NODE): $(NODE_OBJS)
325
	@echo Linking $@
326
	@$(CC) -o $@ $^ 
327
328

# FIXSMB Utility
329
FIXSMB_OBJS = \
330
	$(LIBODIR)/fixsmb.o \
331
	$(SMBLIB_OBJS) \
332
333
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/str_util.o
334
335
336
FORCE$(FIXSMB): $(FIXSMB_OBJS)
	
$(FIXSMB): $(FIXSMB_OBJS)
337
	@echo Linking $@
338
	@$(CC) -o $@ $^
339
340

# CHKSMB Utility
341
CHKSMB_OBJS = \
342
	$(LIBODIR)/chksmb.o \
343
	$(SMBLIB_OBJS) \
344
345
346
	$(LIBODIR)/conwrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o
347
FORCE$(CHKSMB): $(CHKSMB_OBJS)
deuce's avatar
deuce committed
348

349
$(CHKSMB): $(CHKSMB_OBJS)
350
	@echo Linking $@
351
	@$(CC) -o $@ $^
352
353

# SMB Utility
354
SMBUTIL_OBJS = \
355
	$(LIBODIR)/smbutil.o \
356
	$(SMBLIB_OBJS) \
357
358
359
360
361
362
363
364
	$(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
365
366
367
368
369
FORCE$(SMBUTIL): $(SMBUTIL_OBJS)
	
$(SMBUTIL): $(SMBUTIL_OBJS)
	@echo Linking $@
	@$(CC) -o $@ $^
deuce's avatar
deuce committed
370

371
372
# SBBSecho (FidoNet Packet Tosser)
SBBSECHO_OBJS = \
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
	$(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 \
388
	$(SMBLIB_OBJS) \
389
390
	$(LIBODIR)/smbtxt.o \
	$(LIBODIR)/lzh.o
391
392
393
394

FORCE$(SBBSECHO): $(SBBSECHO_OBJS)

$(SBBSECHO): $(SBBSECHO_OBJS)
rswindell's avatar
rswindell committed
395
	@echo Linking $@
396
	@$(CC) -o $@ $^
rswindell's avatar
rswindell committed
397

rswindell's avatar
rswindell committed
398
# SBBSecho Configuration Program
rswindell's avatar
rswindell committed
399
ECHOCFG_OBJS = \
400
401
	$(LIBODIR)/echocfg.o \
	$(LIBODIR)/rechocfg.o \
deuce's avatar
deuce committed
402
	$(UIFC_OBJS) \
403
404
405
406
407
408
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/crc16.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/dirwrap.o
deuce's avatar
deuce committed
409

410
411
412
FORCE$(ECHOCFG): $(ECHOCFG_OBJS)

$(ECHOCFG): $(ECHOCFG_OBJS)
rswindell's avatar
rswindell committed
413
	@echo Linking $@
414
	@$(CC) -o $@ $^ $(UIFC_LFLAGS)
rswindell's avatar
rswindell committed
415

rswindell's avatar
rswindell committed
416
# ADDFILES
417
ADDFILES_OBJS = \
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
	$(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
433

434
435
436
FORCE$(ADDFILES): $(ADDFILES_OBJS)

$(ADDFILES): $(ADDFILES_OBJS)
rswindell's avatar
rswindell committed
437
438
439
	@echo Linking $@
	@$(CC) -o $@ $^

440
# FILELIST
441
FILELIST_OBJS = \
442
443
444
445
446
447
448
449
450
451
452
453
454
455
	$(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
456

457
458
459
FORCE$(FILELIST): $(FILELIST_OBJS)

$(FILELIST): $(FILELIST_OBJS)
460
461
462
	@echo Linking $@
	@$(CC) -o $@ $^

463
# MAKEUSER
464
MAKEUSER_OBJS = \
465
466
467
468
469
470
471
472
473
474
475
476
477
478
	$(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
479

480
481
482
FORCE$(MAKEUSER): $(MAKEUSER_OBJS)

$(MAKEUSER): $(MAKEUSER_OBJS)
483
484
	@echo Linking $@
	@$(CC) -o $@ $^
deuce's avatar
deuce committed
485

rswindell's avatar
rswindell committed
486
487
# JSEXEC
JSEXEC_OBJS = \
488
	$(LIBODIR)/jsexec.o \
489
	$(SBBSLIB)
rswindell's avatar
rswindell committed
490
491
492

FORCE$(JSEXEC): $(JSEXEC_OBJS)

493
$(JSEXEC): $(JSEXEC_OBJS) $(LIBS)
rswindell's avatar
rswindell committed
494
	@echo Linking $@
495
	@$(CCPP) -o $@ $(LFLAGS) $^
rswindell's avatar
rswindell committed
496
497
	
# ANS2MSG
deuce's avatar
deuce committed
498
499
FORCE$(ANS2MSG): $(ANS2MSG).o

rswindell's avatar
rswindell committed
500
# MSG2NAS
deuce's avatar
deuce committed
501
FORCE$(MSG2ANS): $(MSG2ANS).o
502

503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# 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

$(LIBODIR)/sbbsweb.o : 
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
	@$(CC) $(CFLAGS) -o $@ -c sbbscon.c -DNO_TELNET_SERVER -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_SERVICES

$(LIBODIR)/sbbsftp.o : 
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
	@$(CC) $(CFLAGS) -o $@ -c sbbscon.c -DNO_TELNET_SERVER -DNO_MAIL_SERVER -DNO_SERVICES -DNO_WEB_SERVER

$(LIBODIR)/sbbsmail.o : 
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
	@$(CC) $(CFLAGS) -o $@ -c sbbscon.c -DNO_TELNET_SERVER -DNO_FTP_SERVER -DNO_SERVICES -DNO_WEB_SERVER

$(LIBODIR)/sbbssrvc.o : 
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
	@$(CC) $(CFLAGS) -o $@ -c sbbscon.c -DNO_TELNET_SERVER -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_WEB_SERVER

$(LIBODIR)/sbbs_bbs.o : 
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
	@$(CC) $(CFLAGS) -o $@ -c sbbscon.c -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_SERVICES -DNO_WEB_SERVER

$(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)


566
567
568
depend:
	@$(DELETE) $(LIBODIR)/.depend
	@$(DELETE) $(EXEODIR)/.depend
deuce's avatar
deuce committed
569
	$(MAKE) BUILD_DEPENDS=FORCE
deuce's avatar
deuce committed
570

deuce's avatar
deuce committed
571
FORCE:
572

573
574
-include $(LIBODIR)/.depend
-include $(EXEODIR)/.depend
575
576
-include $(LIBODIR)/*.d
-include $(EXEODIR)/*.d