GNUmakefile 13.5 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

23
24
25
26
ifndef VERBOSE
 QUIET	=	@
endif

deuce's avatar
deuce committed
27
#USE_DIALOG =   1       # Dialog vesrion of UIFC
28
#USE_FLTK =     1       # Use Windowed version
deuce's avatar
deuce committed
29
30
USE_CURSES      =       1       # Curses version of UIFC

31
ifdef DEBUG
32
 BUILD	=	debug
33
else
34
 BUILD	=	release
35
36
endif

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

61
LIBFILE	=	.so
rswindell's avatar
rswindell committed
62
UIFC	=	../uifc/
63
XPDEV	=	../xpdev/
64
LIBPREFIX =	lib
65

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

77
78
ifeq ($(os),freebsd)
 BSD	=	1
79
else
80
81
82
 ifeq ($(os),openbsd)
  BSD	=	1
 endif
83
endif
84

85
86
LIBODIR :=	$(CCPRE).$(os).lib.$(BUILD)
EXEODIR :=	$(CCPRE).$(os).exe.$(BUILD)
87

88
DELETE	=	rm -f
89

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

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

105
106
ifeq ($(os),linux)    # Linux
 CFLAGS	+= -D_THREAD_SUID_BROKEN
107
108
endif

109
ifeq ($(os),sunos)    # Solaris
110
111
 CFLAGS	:= -D_REENTRANT -D__solaris__ -DNEEDS_DAEMON -D_POSIX_PTHREAD_SEMANTICS -DNEEDS_FORKPTY
 LFLAGS := -lm -lpthread -lsocket -lnsl -lrt
112
113
endif

114
ifeq ($(os),netbsd)
115
 CFLAGS += -D_REENTRANT -D__unix__ -I/usr/pkg/include -DNEEDS_FORKPTY
116
 LFLAGS := -lm -lpthread -L/usr/pkg/lib -L/usr/pkg/pthreads/lib
117
118
endif

119
# So far, only QNX has sem_timedwait()
120
121
ifeq ($(os),qnx)
 LFLAGS := -lm -lsocket
122
123
124
else
 CFLAGS	+=	-DUSE_XP_SEMAPHORES
 USE_XP_SEMAPHORES	:=	1
125
126
endif

127
ifdef DEBUG
128
129
130
131
132
133
 ifdef bcc
  CFLAGS	+=	-y -v -Od
 else
  CFLAGS	+=	-ggdb
 endif
 CFLAGS  +=	-D_DEBUG
134
135
else
 CFLAGS	+= -O3
136
endif
137

deuce's avatar
deuce committed
138
JSLIB	:=	-L../../lib/mozilla/js/$(os).$(BUILD) -ljs
139

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
ifneq ($(os),openbsd)
LFLAGS		+=	-Xlinker -rpath-link
LFLAGS		+=	-Xlinker ./$(LIBODIR)
deuce's avatar
deuce committed
187
188
189
190
LFLAGS		+=	-Xlinker -rpath-link
LFLAGS		+=	-Xlinker ../../lib/mozilla/js/$(os).$(BUILD)
LFLAGS		+=	-Xlinker -rpath-link
LFLAGS		+=	-Xlinker ../../lib/mozilla/nspr/$(os).$(BUILD)
deuce's avatar
deuce committed
191
endif
192
193
194
195
196
197
ifeq ($(os),freebsd)
LFLAGS		+=	-pthread
endif
ifeq ($(os),openbsd)
LFLAGS		+=	-pthread
endif
198

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

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

$(LIBODIR):
	mkdir $(LIBODIR)

$(EXEODIR):
	mkdir $(EXEODIR)

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

rswindell's avatar
rswindell committed
228
229
MONO_OBJS	= $(CON_OBJS) $(FTP_OBJS) $(WEB_OBJS) \
			$(MAIL_OBJS) $(SERVICE_OBJS)
230
SMBLIB_OBJS = \
231
232
233
	$(LIBODIR)/smblib.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/crc16.o
234

235
236

# Monolithic Synchronet executable Build Rule
237
FORCE$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS)
238
	@echo Linking $@
239
	$(QUIET)$(CCPP) -o $@ $(LFLAGS) $^
240
241

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

244
$(SBBS): $(OBJS) $(LIBS)
245
	@echo Linking $@
deuce's avatar
deuce committed
246
	$(QUIET)$(CCPP) $(LFLAGS) -o $(SBBS) $(JSLIB) $^ -shared -o $@
247
248

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

$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
252
	@echo Linking $@
deuce's avatar
deuce committed
253
	$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@ 
254
255

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

$(MAILSRVR): $(MAIL_OBJS) $(SBBSLIB)
259
	@echo Linking $@
deuce's avatar
deuce committed
260
	$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@
261
262
263
264
265
266

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

$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)
	@echo Linking $@
deuce's avatar
deuce committed
267
	$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@
268
269
270
271
272
273

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

$(SERVICES): $(SERVICE_OBJS) $(SBBSLIB)
	@echo Linking $@
deuce's avatar
deuce committed
274
	$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@
275
276

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

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

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

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

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

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

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

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

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

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

321
$(BAJA): $(BAJA_OBJS)
322
	@echo Linking $@
323
	$(QUIET)$(CC) -o $@ $^
324
325

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

332
$(NODE): $(NODE_OBJS)
333
	@echo Linking $@
334
	$(QUIET)$(CC) -o $@ $^ 
335
336

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

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

357
$(CHKSMB): $(CHKSMB_OBJS)
358
	@echo Linking $@
359
	$(QUIET)$(CC) -o $@ $^
360
361

# SMB Utility
362
SMBUTIL_OBJS = \
363
	$(LIBODIR)/smbutil.o \
364
	$(SMBLIB_OBJS) \
365
366
367
368
369
370
371
372
	$(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
373
374
375
376
FORCE$(SMBUTIL): $(SMBUTIL_OBJS)
	
$(SMBUTIL): $(SMBUTIL_OBJS)
	@echo Linking $@
377
	$(QUIET)$(CC) -o $@ $^
deuce's avatar
deuce committed
378

379
380
# SBBSecho (FidoNet Packet Tosser)
SBBSECHO_OBJS = \
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
	$(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 \
396
	$(SMBLIB_OBJS) \
397
398
	$(LIBODIR)/smbtxt.o \
	$(LIBODIR)/lzh.o
399
400
401
402

FORCE$(SBBSECHO): $(SBBSECHO_OBJS)

$(SBBSECHO): $(SBBSECHO_OBJS)
rswindell's avatar
rswindell committed
403
	@echo Linking $@
404
	$(QUIET)$(CC) -o $@ $^
rswindell's avatar
rswindell committed
405

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

418
419
420
FORCE$(ECHOCFG): $(ECHOCFG_OBJS)

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

rswindell's avatar
rswindell committed
424
# ADDFILES
425
ADDFILES_OBJS = \
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
	$(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
441

442
443
444
FORCE$(ADDFILES): $(ADDFILES_OBJS)

$(ADDFILES): $(ADDFILES_OBJS)
rswindell's avatar
rswindell committed
445
	@echo Linking $@
446
	$(QUIET)$(CC) -o $@ $^
rswindell's avatar
rswindell committed
447

448
# FILELIST
449
FILELIST_OBJS = \
450
451
452
453
454
455
456
457
458
459
460
461
462
463
	$(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
464

465
466
467
FORCE$(FILELIST): $(FILELIST_OBJS)

$(FILELIST): $(FILELIST_OBJS)
468
	@echo Linking $@
469
	$(QUIET)$(CC) -o $@ $^
470

471
# MAKEUSER
472
MAKEUSER_OBJS = \
473
474
475
476
477
478
479
480
481
482
483
484
485
486
	$(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
487

488
489
490
FORCE$(MAKEUSER): $(MAKEUSER_OBJS)

$(MAKEUSER): $(MAKEUSER_OBJS)
491
	@echo Linking $@
492
	$(QUIET)$(CC) -o $@ $^
deuce's avatar
deuce committed
493

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

FORCE$(JSEXEC): $(JSEXEC_OBJS)

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

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

515
516
517
518
519
520
521
522
523
524
525
526
# 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

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

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

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

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

551
$(LIBODIR)/sbbs_bbs.o : sbbscon.c
552
553
554
   ifndef bcc
	@echo $(COMPILE_MSG) $<
   endif
555
	$(QUIET)$(CC) $(CFLAGS) -o $@ -c $< -DNO_FTP_SERVER -DNO_MAIL_SERVER -DNO_SERVICES -DNO_WEB_SERVER
556
557
558

$(SBBSWEB): $(WEBCON_OBJS) $(SBBSLIB) $(WEBSRVR)
	@echo Linking $@
559
	$(QUIET)$(CC) $(CFLAGS) $(LFLAGS) -lwebsrvr -o $@ $(WEBCON_OBJS) $(SBBSLIB)
560
561
562

$(SBBSFTP): $(FTPCON_OBJS) $(SBBSLIB) $(FTPSRVR)
	@echo Linking $@
563
	$(QUIET)$(CC) $(CFLAGS) $(LFLAGS) -lftpsrvr -o $@ $(FTPCON_OBJS) $(SBBSLIB)
564
565
566

$(SBBSMAIL): $(MAILCON_OBJS) $(SBBSLIB) $(MAILSRVR)
	@echo Linking $@
567
	$(QUIET)$(CC) $(CFLAGS) $(LFLAGS) -lmailsrvr -o $@ $(MAILCON_OBJS) $(SBBSLIB)
568
569
570

$(SBBSSRVC): $(SRVCCON_OBJS) $(SBBSLIB) $(SERVICES)
	@echo Linking $@
571
	$(QUIET)$(CC) $(CFLAGS) $(LFLAGS) -lservices -o $@ $(SRVCCON_OBJS) $(SBBSLIB)
572
573
574

$(SBBS_BBS): $(BBSCON_OBJS) $(SBBSLIB)
	@echo Linking $@
575
	$(QUIET)$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(BBSCON_OBJS) $(SBBSLIB)
576
577


578
depend:
579
580
	$(QUIET)$(DELETE) $(LIBODIR)/.depend
	$(QUIET)$(DELETE) $(EXEODIR)/.depend
deuce's avatar
deuce committed
581
	$(MAKE) BUILD_DEPENDS=FORCE
deuce's avatar
deuce committed
582

deuce's avatar
deuce committed
583
FORCE:
584

585
586
-include $(LIBODIR)/.depend
-include $(EXEODIR)/.depend
587
588
-include $(LIBODIR)/*.d
-include $(EXEODIR)/*.d