forked from virtadpt/eBBS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
221 lines (156 loc) · 5.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#############################################################################
#
# Makefile for Eagles BBS version 3.1
#
#############################################################################
# This is the configurable part. Put anything OS-dependent here.
# You do not need to worry with LEX, YACC, or YFLAGS unless you want to
# modify the menu parser.
# your C compiler of choice
CC=gcc
# your C linker of choice
LD=gcc
# archiver of choice
AR=ar
# ranlib, if applicable.
# SunOS, OSF/1, NeXT, A/UX, MachTen, FreeBSD use RANLIB=ranlib.
RANLIB=echo Not using ranlib:
# special include paths?
INCLUDES=
# special libs?
# Solaris needs -lsocket -lnsl -L/usr/ccs/lib
# MachTen needs -lcompat
# Unixware needs -lsocket -lnsl (and maybe -L/usr/ucblib -lucb)
# FreeBSD needs -lcrypt -lcompat -lipc
LIBS=-lcrypt
# flags for the compiler
# NeXT wants -pipe -s -O4 -arch m68040; FreeBSD wants -O2 -m486 -pipe
# might want to try -DMENU_STANDOUT too if you're a dialup bbs
# might want -DEXTRA_CHAT_STUFF or -DNO_IGNORE_CHATOPS, see docs
CCFLAGS=-O -DCOLOR
# flags for the linker -- NeXT wants -s -O4; FreeBSD wants -s
LDFLAGS=-O
# flags for the archiver -- remove s if using ranlib, add c for NeXT, FreeBSD
ARFLAGS=rs
# zipper for srcdist and bindist targets, if desired
ZIP=gzip
# scanner generator: lex or flex
LEX=flex
# parser: yacc or bison
YACC=bison
# flags for parser
YFLAGS=-d -o y.tab.c
# default install directory for the install script
INSTALLDIR=
# The rest shouldn't need messing with.
##############################################################################
CFLAGS=$(CCFLAGS) $(INCLUDES)
BINS=lbbs chatd addacct delacct bbslog bbfinger bbsmaild
DOCS=README ChangeLog EBBS-Guide ReleaseNotes
all: $(BINS)
##############################################################################
# BBS Library make
##############################################################################
LIBOBJS=record.o util.o name.o log.o utable.o login.o passwd.o home.o init.o \
acct.o misc.o headers.o readbits.o board.o files.o exec.o uldl.o chat.o \
talk.o netmail.o edit.o conv.o
libbbs.a: $(LIBOBJS)
-rm -f libbbs.a
$(AR) $(ARFLAGS) libbbs.a $(LIBOBJS)
$(RANLIB) libbbs.a
# Here are the makes for the external utility programs.
addacct.o: addacct.c server.h common.h
$(CC) -c $(CFLAGS) addacct.c
addacct: addacct.o libbbs.a
$(CC) $(LDFLAGS) -o addacct addacct.o libbbs.a $(LIBS)
delacct.o: delacct.c server.h common.h
$(CC) -c $(CFLAGS) delacct.c
delacct: delacct.o libbbs.a
$(CC) $(LDFLAGS) -o delacct delacct.o libbbs.a $(LIBS)
bbslog.o: bbslog.c server.h common.h
$(CC) -c $(CFLAGS) bbslog.c
bbslog: bbslog.o libbbs.a
$(CC) $(LDFLAGS) -o bbslog bbslog.o libbbs.a $(LIBS)
bbfinger.o: bbfinger.c server.h common.h
$(CC) -c $(CFLAGS) bbfinger.c
bbfinger: bbfinger.o modes.o libbbs.a
$(CC) $(LDFLAGS) -o bbfinger bbfinger.o modes.o libbbs.a $(LIBS)
bbsmaild.o: bbsmaild.c server.h common.h
$(CC) -c $(CFLAGS) bbsmaild.c
bbsmaild: bbsmaild.o libbbs.a
$(CC) $(LDFLAGS) -o bbsmaild bbsmaild.o libbbs.a $(LIBS)
############################################################################
# BBS daemon make (not quite finished)
############################################################################
#bbsd:
# cd server; make CC="$(CC)" CFLAGS="$(CFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" bbsd
############################################################################
# Chat daemon make
############################################################################
chatserv.o: chatserv.c
$(CC) -c $(CFLAGS) chatserv.c
chatconf.o: chatconf.c
$(CC) -c $(CFLAGS) chatconf.c
chatd: chatserv.o chatconf.o libbbs.a
$(LD) $(LDFLAGS) -o chatd chatserv.o chatconf.o libbbs.a $(LIBS)
############################################################################
# BBS client make (not quite finished)
############################################################################
#bbs:
# cd client; make CC="$(CC)" CFLAGS="$(CFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" RANLIB="$(RANLIB)" LIBS="$(LIBS)" bbs
############################################################################
# Local client make
############################################################################
LLIBS=libbbs.a pbbs/libpbbs.a
LOBJS=client.o menus.o complete.o system.o c_users.o readmenu.o c_mail.o \
modes.o c_boards.o c_post.o readnew.o c_files.o c_chat.o c_talk.o c_lists.o \
nmenus.o env.o y.tab.o lex.yy.o
PLIBOBJS=pbbs/term.o pbbs/screen.o pbbs/io.o pbbs/stuff.o \
pbbs/more.o pbbs/vedit.o
pbbs/term.o: pbbs/term.c
cd pbbs; $(CC) -c -I.. $(CFLAGS) term.c
pbbs/screen.o: pbbs/screen.c
cd pbbs; $(CC) -c -I.. $(CFLAGS) screen.c
pbbs/io.o: pbbs/io.c
cd pbbs; $(CC) -c -I.. $(CFLAGS) io.c
pbbs/stuff.o: pbbs/stuff.c
cd pbbs; $(CC) -c -I.. $(CFLAGS) stuff.c
pbbs/more.o: pbbs/more.c
cd pbbs; $(CC) -c -I.. $(CFLAGS) more.c
pbbs/vedit.o: pbbs/vedit.c
cd pbbs; $(CC) -c -I.. $(CFLAGS) vedit.c
pbbs/libpbbs.a: $(PLIBOBJS)
-rm -f pbbs/libpbbs.a
$(AR) $(ARFLAGS) pbbs/libpbbs.a $(PLIBOBJS)
$(RANLIB) pbbs/libpbbs.a
lex.yy.c: menu.l
$(LEX) menu.l
lex.yy.o: lex.yy.c y.tab.o
y.tab.c: gram.y
$(YACC) $(YFLAGS) gram.y
lbbs: $(LOBJS) $(LLIBS)
$(LD) $(LDFLAGS) -o lbbs $(LOBJS) $(LLIBS) $(LIBS) -lcurses
srcdist:
rm -f ebbssrc.tar ebbssrc.tar.gz
tar -cvf ebbssrc.tar [A-Z]* *.[chly] pbbs/*.c pbbs/*.h config/*
$(ZIP) ebbssrc.tar
bindist: all
rm -f ebbsbin.tar ebbsbin.tar.gz
if [ ! -d deliv ]; then \
mkdir deliv deliv/bin deliv/boards deliv/etc deliv/tmp; \
mkdir deliv/home deliv/home/SYSOP deliv/home/SYSOP/mail; \
fi
cp $(DOCS) deliv
cp $(BINS) deliv/bin
chmod 6755 deliv/bin/lbbs deliv/bin/bbsmaild
cp config/* deliv/etc
(cd deliv/bin; strip $(BINS))
(cd deliv; tar -cvf ../ebbsbin.tar .)
$(ZIP) ebbsbin.tar
install: all
./Install.sh $(INSTALLDIR)
clean:
rm -f *.o pbbs/*.o *~ pbbs/*~ config/*~ *# y.output
clobber: clean
rm -f $(BINS) libbbs.a pbbs/libpbbs.a
distclean: clobber