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

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
29
#USE_CURSES =	1	# Use *nix curses version
30
ifndef NO_CURSES
31
 USE_UIFC32      =       1       # Curses version of UIFC
32
endif
deuce's avatar
deuce committed
33

34
ifdef DEBUG
35
 BUILD	=	debug
36
else
37
 BUILD	=	release
38
endif
39
40
41
42
43
44
BUILDPATH	:=	$(BUILD)

ifeq ($(shell hostname),dmjunk.kingcole.local)
 THREADS_ACTUALLY_WORK=1
 BUILDPATH	:=	redhat
endif
45

46
ifdef bcc
47
 CC		=	bc++ -q
48
 CCPRE	:=	bcc
49
 CXX	=	bc++ -q
50
 LD		=	ilink -q
51
 CFLAGS +=	-mm -md -D__unix__ -w-csu -w-pch -w-ccc -w-rch -w-par -w-aus
52
else
53
 CFLAGS	+=	-MMD -Wall
54
 CCPRE	?=	gcc
55
 ifdef BUILD_DEPENDS
56
  CC	=	../build/mkdep -a
57
  CXX	=	../build/mkdep -a
58
  LD	=	echo
59
60
  COMPILE_MSG	:= Depending
 else
61
  CC	?=	gcc
62
  CXX	?=	g++
63
  LD	?=	ld
64
65
  COMPILE_MSG	:= Compiling
 endif
66
endif
67
68
69
SLASH	=	/
OFILE	=	o

rswindell's avatar
rswindell committed
70
UIFC	=	../uifc/
71
XPDEV	=	../xpdev/
72
LIBPREFIX =	lib
73

74
75
ifndef os
 os		:=	$(shell uname)
76
endif
77
78
79
ifeq ($(shell uname -m),ppc)
 os		:=	$(os)-ppc
endif
80
# this line wont work with solaris unless awk in path is actually gawk 
81
os      :=	$(shell echo $(os) | tr "[ A-Z]" "[\-a-z]")
82
83
# remove '/' from "os/2"
os      :=  $(shell echo $(os) | tr -d "/")
84

85
86
87
ifeq ($(os),openbsd)
LIBFILE =	.so.0.0
else
deuce's avatar
deuce committed
88
89
90
91
92
 ifeq ($(os),darwin)
  LIBFILE =	.dylib
 else
  LIBFILE	=	.so
 endif
93
94
endif

95
96
ifeq ($(os),freebsd)
 BSD	=	1
97
else
98
99
100
 ifeq ($(os),openbsd)
  BSD	=	1
 endif
101
endif
102

103
104
LIBODIR :=	$(CCPRE).$(os).lib.$(BUILDPATH)
EXEODIR :=	$(CCPRE).$(os).exe.$(BUILDPATH)
105

106
DELETE	=	rm -f
107

108
CFLAGS  +=  -I$(XPDEV) -I$(UIFC) -DJAVASCRIPT -D_THREAD_SAFE -D_REENTRANT
109
110
111
112
113
ifdef JSINCLUDE
 CFLAGS += -I$(JSINCLUDE)
else
 CFLAGS += -I../../include/mozilla/js
endif
114

115
116
ifdef BSD	# BSD
 # Math libraries needed and uses pthread
117
 LFLAGS	:=	-lm -lutil
118
 CFLAGS +=	-pthread 
119
else			# Linux / Other UNIX
120
121
 # Math and pthread libraries needed
 ifdef bcc
122
  LFLAGS	:=	libpthread.so
123
 else
124
  LFLAGS	:=	-lm -lpthread -lutil
125
 endif
126
endif
127

128
ifeq ($(os),linux)    # Linux
129
130
131
 ifndef THREADS_ACTUALLY_WORK
  CFLAGS	+= -D_THREAD_SUID_BROKEN
 endif
132
133
endif

134
ifeq ($(os),sunos)    # Solaris
135
 CFLAGS	:= -D__solaris__ -DNEEDS_DAEMON -D_POSIX_PTHREAD_SEMANTICS -DNEEDS_FORKPTY
136
 LFLAGS := -lm -lpthread -lsocket -lnsl -lrt
137
138
endif

139
ifeq ($(os),netbsd)
140
 CFLAGS += -D__unix__ -I/usr/pkg/include -DNEEDS_FORKPTY
141
 LFLAGS := -lm -lpthread -L/usr/pkg/lib -L/usr/pkg/pthreads/lib
142
 UTIL_LFLAGS	+=	-lpth -L/usr/pkg/lib
143
144
endif

deuce's avatar
deuce committed
145
ifeq ($(os),darwin)
146
 CFLAGS +=  -D__unix__ -fno-common -D__DARWIN__
deuce's avatar
deuce committed
147
148
149
 LFLAGS :=  -lm -lpthread
endif

150
# So far, only QNX has sem_timedwait()
151
152
ifeq ($(os),qnx)
 LFLAGS := -lm -lsocket
153
154
155
else
 CFLAGS	+=	-DUSE_XP_SEMAPHORES
 USE_XP_SEMAPHORES	:=	1
156
157
endif

158
ifdef DEBUG
159
160
161
162
163
164
 ifdef bcc
  CFLAGS	+=	-y -v -Od
 else
  CFLAGS	+=	-ggdb
 endif
 CFLAGS  +=	-D_DEBUG
165
166
else
 CFLAGS	+= -O3
167
endif
168

169
170
171
172
ifdef PREFIX
 CFLAGS += -DPREFIX=$(PREFIX)
endif

173
174
175
176
ifdef USE_DOSEMU
 CFLAGS += -DUSE_DOSEMU
endif

177
178
179
180
181
182
183
184
185
186
ifndef JSLIBDIR
 JSLIBDIR := ../../lib/mozilla/js/$(os).$(BUILD)
endif
ifndef JSLIB
 JSLIB	:=	js
endif
ifndef NSPRDIR
 NSPRDIR := ../../lib/mozilla/nspr/$(os).$(BUILD)
endif

187
188
189
190
ifdef DONT_BLAME_SYNCHRONET
 LFLAGS += -DDONT_BLAME_SYNCHRONET
endif

191
LFLAGS += -L$(JSLIBDIR) -l$(JSLIB)
192

193
# The following are needed for echocfg (uses UIFC)
194
UIFC_OBJS =	$(LIBODIR)/uifcx.o
195
ifdef USE_FLTK
196
197
 CFLAGS +=	-DUSE_FLTK -I../../include/fltk
 UIFC_LFLAGS += -L../../lib/fltk/$(os) -L/usr/X11R6/lib -lm -lfltk -lX11
198
 UIFC_OBJS+=	$(LIBODIR)/uifcfltk.o
199
endif
deuce's avatar
deuce committed
200
ifdef USE_CURSES
201
 CFLAGS +=	-DUSE_CURSES
202
203
204
 ifeq ($(os),qnx)
  UIFC_LFLAGS += -lncurses
 else
205
206
207
208
209
  ifeq ($(os),netbsd)
   UIFC_LFLAGS += -lncurses
  else
   UIFC_LFLAGS += -lcurses
  endif
210
 endif
211
 UIFC_OBJS +=	$(LIBODIR)/uifcc.o
deuce's avatar
deuce committed
212
endif
213

214
215
216
217
218
ifdef USE_UIFC32
 CFLAGS +=	-DUSE_UIFC32
 ifeq ($(os),qnx)
  UIFC_LFLAGS += -lncurses
 else
219
220
221
222
223
  ifeq ($(os),netbsd)
   UIFC_LFLAGS += -lncurses
  else
   UIFC_LFLAGS += -lcurses
  endif
224
225
226
227
228
 endif
 UIFC_OBJS +=	$(LIBODIR)/uifc32.o
 UIFC_OBJS +=	$(LIBODIR)/ciowrap.o
endif

229
230
231
232
233
#The following is needed for nspr support on Linux
ifeq ($(os),linux)
 LFLAGS	+=	-ldl
endif

rswindell's avatar
rswindell committed
234
235
236
include targets.mk		# defines all targets
include objects.mk		# defines $(OBJS)
include sbbsdefs.mk		# defines $(SBBSDEFS)
237

238
239
ifeq ($(USE_XP_SEMAPHORES),1)
 OBJS	+=	$(LIBODIR)$(SLASH)xpsem.$(OFILE)
240
241
endif

242
243
244
245
246
#SBBSLIB	=	$(LIBODIR)$(SLASH)libsbbs.so
SBBSLIB	=	-lsbbs

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

rswindell's avatar
rswindell committed
248
vpath %.c $(XPDEV) $(UIFC)
249
vpath %.cpp $(UIFC)
rswindell's avatar
rswindell committed
250

251
LFLAGS		+=	-L./$(LIBODIR) -L$(NSPRDIR)
deuce's avatar
deuce committed
252
ifneq ($(os),darwin)
253
SBBSLDFLAGS	:=	$(LFLAGS) -rpath-link ./$(LIBODIR) -rpath ./ 
254
255
256
#LFLAGS		+=	-Wl,-rpath-link,./$(LIBODIR),-rpath,./
LFLAGS		+=	-Xlinker -rpath
LFLAGS		+=	-Xlinker .
deuce's avatar
deuce committed
257
258
259
ifneq ($(os),openbsd)
LFLAGS		+=	-Xlinker -rpath-link
LFLAGS		+=	-Xlinker ./$(LIBODIR)
deuce's avatar
deuce committed
260
LFLAGS		+=	-Xlinker -rpath-link
261
LFLAGS		+=	-Xlinker $(JSLIBDIR)
deuce's avatar
deuce committed
262
LFLAGS		+=	-Xlinker -rpath-link
263
LFLAGS		+=	-Xlinker $(NSPRDIR)
264
else
265
LFLAGS		+=	-l$(JSLIB) -lnspr4
deuce's avatar
deuce committed
266
endif
deuce's avatar
deuce committed
267
endif
268
269
270
271
272
273
ifeq ($(os),freebsd)
LFLAGS		+=	-pthread
endif
ifeq ($(os),openbsd)
LFLAGS		+=	-pthread
endif
274

275
# Implicit C Compile Rule for SBBS
deuce's avatar
deuce committed
276
$(LIBODIR)/%.o : %.c $(BUILD_DEPENDS)
277
   ifndef bcc
278
	@echo $(COMPILE_MSG) $<
279
   endif
280
	$(QUIET)$(CC) $(CFLAGS) $(SBBSDEFS) -o $@ -c $<
281
282

# Implicit C++ Compile Rule for SBBS
deuce's avatar
deuce committed
283
$(LIBODIR)/%.o : %.cpp $(BUILD_DEPENDS)
284
   ifndef bcc
285
	@echo $(COMPILE_MSG) $<
286
   endif
287
	$(QUIET)$(CXX) $(CFLAGS) $(SBBSDEFS) -o $@ -c $<
288
289
290
291
292
293
294

$(LIBODIR):
	mkdir $(LIBODIR)

$(EXEODIR):
	mkdir $(EXEODIR)

295
296
CON_OBJS	= $(LIBODIR)/sbbscon.o $(LIBODIR)/conwrap.o \
		  $(LIBODIR)/sbbs_ini.o
297
CON_LDFLAGS	= -lftpsrvr -lwebsrvr -lmailsrvr -lservices
298
FTP_OBJS	= $(LIBODIR)/ftpsrvr.o
299
MAIL_OBJS	= $(LIBODIR)/mailsrvr.o $(LIBODIR)/mxlookup.o \
300
 		  $(LIBODIR)/mime.o $(LIBODIR)/base64.o $(LIBODIR)/ini_file.o
deuce's avatar
deuce committed
301
WEB_OBJS	= $(LIBODIR)/websrvr.o $(LIBODIR)/sockwrap.o $(LIBODIR)/base64.o
302
SERVICE_OBJS	= $(LIBODIR)/services.o $(LIBODIR)/ini_file.o
303

rswindell's avatar
rswindell committed
304
305
MONO_OBJS	= $(CON_OBJS) $(FTP_OBJS) $(WEB_OBJS) \
			$(MAIL_OBJS) $(SERVICE_OBJS)
306
SMBLIB_OBJS = \
307
308
309
	$(LIBODIR)/smblib.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/crc16.o
310

311
SHLIBOPTS	:=	-shared
deuce's avatar
deuce committed
312
313
314
315
316
317
ifeq ($(os),darwin)
MKSHLIB		:=	libtool -dynamic -framework System -lcc_dynamic
MKSHPPLIB		:=	libtool -dynamic -framework System -lcc_dynamic -lstdc++
SHLIBOPTS	:=	
else
MKSHLIB		:=	$(CC)
318
MKSHPPLIB		:=	$(CXX)
deuce's avatar
deuce committed
319
endif
320
321

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

$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS)
325
	@echo Linking $@
326
	$(QUIET)$(CXX) -o $@ $(LFLAGS) $^
327
328

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

331
$(SBBS): $(OBJS) $(LIBS)
332
	@echo Linking $@
deuce's avatar
deuce committed
333
	$(QUIET)$(MKSHPPLIB) $(LFLAGS) -o $@ $^ $(SHLIBOPTS)
334
335

# FTP Server Link Rule
336
FORCE$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
deuce's avatar
deuce committed
337
338

$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
339
	@echo Linking $@
deuce's avatar
deuce committed
340
	$(QUIET)$(MKSHLIB) $(LFLAGS) $^ $(SHLIBOPTS) -o $@ 
341
342

# Mail Server Link Rule
343
FORCE$(MAILSRVR): $(MAIL_OBJS) $(LIBODIR)$(SLASH)$(SBBSLIB)
deuce's avatar
deuce committed
344
345

$(MAILSRVR): $(MAIL_OBJS) $(SBBSLIB)
346
	@echo Linking $@
deuce's avatar
deuce committed
347
	$(QUIET)$(MKSHLIB) $(LFLAGS) $^ $(SHLIBOPTS) -o $@
348
349
350
351
352
353

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

$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)
	@echo Linking $@
deuce's avatar
deuce committed
354
	$(QUIET)$(MKSHLIB) $(LFLAGS) $^ $(SHLIBOPTS) -o $@
355
356
357
358
359
360

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

$(SERVICES): $(SERVICE_OBJS) $(SBBSLIB)
	@echo Linking $@
deuce's avatar
deuce committed
361
	$(QUIET)$(MKSHLIB) $(LFLAGS) $^ $(SHLIBOPTS) -o $@
362
363

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

366
367
$(SBBSCON): $(CON_OBJS) $(SBBSLIB) $(FTPSRVR) $(WEBSRVR) $(MAILSRVR) $(SERVICES)
	@echo Linking $@
368
	$(QUIET)$(CC) $(CFLAGS) $(LFLAGS) $(CON_LDFLAGS) -o $@ $(CON_OBJS) $(SBBSLIB)
369
370

# Specifc Compile Rules
deuce's avatar
deuce committed
371
$(LIBODIR)/ftpsrvr.o: ftpsrvr.c ftpsrvr.h $(BUILD_DEPENDS)
372
	@echo $(COMPILE_MSG) $<
373
	$(QUIET)$(CC) $(CFLAGS) -DFTPSRVR_EXPORTS -o $@ -c $<
374

deuce's avatar
deuce committed
375
$(LIBODIR)/mailsrvr.o: mailsrvr.c mailsrvr.h $(BUILD_DEPENDS)
376
	@echo $(COMPILE_MSG) $<
377
	$(QUIET)$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<
378

deuce's avatar
deuce committed
379
$(LIBODIR)/mxlookup.o: mxlookup.c $(BUILD_DEPENDS)
380
	@echo $(COMPILE_MSG) $<
381
	$(QUIET)$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<
382

deuce's avatar
deuce committed
383
$(LIBODIR)/mime.o: mime.c $(BUILD_DEPENDS)
384
	@echo $(COMPILE_MSG) $<
385
	$(QUIET)$(CC) $(CFLAGS) -DMAILSRVR_EXPORTS -o $@ -c $<		
386

deuce's avatar
deuce committed
387
$(LIBODIR)/websrvr.o: websrvr.c websrvr.h $(BUILD_DEPENDS)
388
	@echo $(COMPILE_MSG) $<
389
	$(QUIET)$(CC) $(CFLAGS) -DWEBSRVR_EXPORTS -o $@ -c $<
deuce's avatar
deuce committed
390

deuce's avatar
deuce committed
391
$(LIBODIR)/base64.o: base64.c base64.h $(BUILD_DEPENDS)
392
	@echo $(COMPILE_MSG) $<
393
	$(QUIET)$(CC) $(CFLAGS) -DWEBSRVR_EXPORTS -o $@ -c $<
rswindell's avatar
rswindell committed
394

deuce's avatar
deuce committed
395
$(LIBODIR)/services.o: services.c services.h $(BUILD_DEPENDS)
396
	@echo $(COMPILE_MSG) $<
397
	$(QUIET)$(CC) $(CFLAGS) -DSERVICES_EXPORTS -o $@ -c $<
398
399

# Baja Utility
400
BAJA_OBJS = \
401
402
403
404
	$(LIBODIR)/baja.o \
	$(LIBODIR)/ars.o \
	$(LIBODIR)/crc32.o \
	$(LIBODIR)/genwrap.o \
405
	$(LIBODIR)/dirwrap.o \
406
	$(LIBODIR)/filewrap.o
407
FORCE$(BAJA): $(BAJA_OBJS)
deuce's avatar
deuce committed
408

409
$(BAJA): $(BAJA_OBJS)
410
	@echo Linking $@
411
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
412
413

# Node Utility
414
NODE_OBJS = \
415
416
417
	$(LIBODIR)/node.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/filewrap.o
418
FORCE$(NODE): $(NODE_OBJS)
deuce's avatar
deuce committed
419

420
$(NODE): $(NODE_OBJS)
421
	@echo Linking $@
422
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^ 
423
424

# FIXSMB Utility
425
FIXSMB_OBJS = \
426
	$(LIBODIR)/fixsmb.o \
427
	$(SMBLIB_OBJS) \
428
	$(LIBODIR)/genwrap.o \
429
	$(LIBODIR)/dirwrap.o \
430
	$(LIBODIR)/str_util.o
431
432
433
FORCE$(FIXSMB): $(FIXSMB_OBJS)
	
$(FIXSMB): $(FIXSMB_OBJS)
434
	@echo Linking $@
435
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
436
437

# CHKSMB Utility
438
CHKSMB_OBJS = \
439
	$(LIBODIR)/chksmb.o \
440
	$(SMBLIB_OBJS) \
441
442
443
	$(LIBODIR)/conwrap.o \
	$(LIBODIR)/dirwrap.o \
	$(LIBODIR)/genwrap.o
444
FORCE$(CHKSMB): $(CHKSMB_OBJS)
deuce's avatar
deuce committed
445

446
$(CHKSMB): $(CHKSMB_OBJS)
447
	@echo Linking $@
448
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
449
450

# SMB Utility
451
SMBUTIL_OBJS = \
452
	$(LIBODIR)/smbutil.o \
453
	$(SMBLIB_OBJS) \
454
455
456
457
458
459
460
461
	$(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
462
463
464
465
FORCE$(SMBUTIL): $(SMBUTIL_OBJS)
	
$(SMBUTIL): $(SMBUTIL_OBJS)
	@echo Linking $@
466
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
deuce's avatar
deuce committed
467

468
469
# SBBSecho (FidoNet Packet Tosser)
SBBSECHO_OBJS = \
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
	$(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 \
485
	$(SMBLIB_OBJS) \
486
487
	$(LIBODIR)/smbtxt.o \
	$(LIBODIR)/lzh.o
488
489
490
491

FORCE$(SBBSECHO): $(SBBSECHO_OBJS)

$(SBBSECHO): $(SBBSECHO_OBJS)
rswindell's avatar
rswindell committed
492
	@echo Linking $@
493
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
rswindell's avatar
rswindell committed
494

rswindell's avatar
rswindell committed
495
# SBBSecho Configuration Program
rswindell's avatar
rswindell committed
496
ECHOCFG_OBJS = \
497
498
	$(LIBODIR)/echocfg.o \
	$(LIBODIR)/rechocfg.o \
deuce's avatar
deuce committed
499
	$(UIFC_OBJS) \
500
501
502
503
504
505
	$(LIBODIR)/nopen.o \
	$(LIBODIR)/crc16.o \
	$(LIBODIR)/str_util.o \
	$(LIBODIR)/filewrap.o \
	$(LIBODIR)/genwrap.o \
	$(LIBODIR)/dirwrap.o
deuce's avatar
deuce committed
506

507
508
509
FORCE$(ECHOCFG): $(ECHOCFG_OBJS)

$(ECHOCFG): $(ECHOCFG_OBJS)
rswindell's avatar
rswindell committed
510
	@echo Linking $@
511
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^ $(UIFC_LFLAGS)
rswindell's avatar
rswindell committed
512

rswindell's avatar
rswindell committed
513
# ADDFILES
514
ADDFILES_OBJS = \
515
516
517
518
519
520
521
522
523
524
525
526
	$(LIBODIR)/addfiles.o \
	$(LIBODIR)/ars.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)/filedat.o \
	$(LIBODIR)/dirwrap.o \
527
528
	$(LIBODIR)/genwrap.o \
	$(SMBLIB_OBJS)
deuce's avatar
deuce committed
529

530
531
532
FORCE$(ADDFILES): $(ADDFILES_OBJS)

$(ADDFILES): $(ADDFILES_OBJS)
rswindell's avatar
rswindell committed
533
	@echo Linking $@
534
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
rswindell's avatar
rswindell committed
535

536
# FILELIST
537
FILELIST_OBJS = \
538
539
540
541
542
543
544
545
546
547
548
	$(LIBODIR)/filelist.o \
	$(LIBODIR)/ars.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)/filedat.o \
	$(LIBODIR)/dirwrap.o \
549
550
	$(LIBODIR)/genwrap.o \
	$(SMBLIB_OBJS)
deuce's avatar
deuce committed
551

552
553
554
FORCE$(FILELIST): $(FILELIST_OBJS)

$(FILELIST): $(FILELIST_OBJS)
555
	@echo Linking $@
556
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
557

558
# MAKEUSER
559
MAKEUSER_OBJS = \
560
561
562
563
564
565
566
567
568
569
570
	$(LIBODIR)/makeuser.o \
	$(LIBODIR)/ars.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)/dirwrap.o \
571
572
	$(LIBODIR)/genwrap.o \
	$(SMBLIB_OBJS)
deuce's avatar
deuce committed
573

574
575
576
FORCE$(MAKEUSER): $(MAKEUSER_OBJS)

$(MAKEUSER): $(MAKEUSER_OBJS)
577
	@echo Linking $@
578
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
deuce's avatar
deuce committed
579

rswindell's avatar
rswindell committed
580
581
# JSEXEC
JSEXEC_OBJS = \
582
	$(LIBODIR)/jsexec.o \
583
	$(SBBSLIB)
rswindell's avatar
rswindell committed
584
585
586

FORCE$(JSEXEC): $(JSEXEC_OBJS)

587
$(JSEXEC): $(JSEXEC_OBJS)
rswindell's avatar
rswindell committed
588
	@echo Linking $@
589
	$(QUIET)$(CXX) $(UTIL_LFLAGS) -o $@ $^ $(LFLAGS)
rswindell's avatar
rswindell committed
590
	
591
# ANS2ASC
592
593
FORCE$(ANS2ASC): $(LIBODIR)/ans2asc.o

594
$(ANS2ASC): $(LIBODIR)/ans2asc.o
595
	@echo Linking $@
596
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
deuce's avatar
deuce committed
597

598
# ASC2ANS
599
600
FORCE$(ASC2ANS): $(LIBODIR)/asc2ans.o

601
$(ASC2ANS): $(LIBODIR)/asc2ans.o
602
	@echo Linking $@
603
	$(QUIET)$(CC) $(UTIL_LFLAGS) -o $@ $^
604

605
depend:
606
607
	$(QUIET)$(DELETE) $(LIBODIR)/.depend
	$(QUIET)$(DELETE) $(EXEODIR)/.depend
deuce's avatar
deuce committed
608
	$(MAKE) BUILD_DEPENDS=FORCE
deuce's avatar
deuce committed
609

deuce's avatar
deuce committed
610
FORCE:
611

612
613
-include $(LIBODIR)/.depend
-include $(EXEODIR)/.depend
614
615
-include $(LIBODIR)/*.d
-include $(EXEODIR)/*.d