BSD 4_3_Tahoe release
[unix-history] / usr / src / ucb / tn3270 / makefile
CommitLineData
f6e43951
KB
1#
2# Copyright (c) 1988 Regents of the University of California.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms are permitted
ca67e7b4
C
6# provided that this notice is preserved and that due credit is given
7# to the University of California at Berkeley. The name of the University
8# may not be used to endorse or promote products derived from this
9# software without specific prior written permission. This software
10# is provided ``as is'' without express or implied warranty.
f6e43951 11#
ca67e7b4 12# @(#)makefile 3.3 (Berkeley) 3/28/88
f6e43951 13#
7ffa2088 14# Makefile for tn3270 and friends...
7ffa2088 15#
ca67e7b4 16# This is the makefile for tn3270. Note that we use ../telnet.c
7ffa2088
GM
17# (compiled with special options; see below) to provide the telnet
18# support we need.
19#
20# The following are the defines that may be passed (via the cc
21# -D option) to the compiler.
22#
ca67e7b4
C
23# The first group relate only to ../telnet.c:
24#
7ffa2088 25# TN3270 - This is to be linked with tn3270. Necessary
ca67e7b4 26# for creating tn3270.
7ffa2088 27#
7ffa2088
GM
28# NOT43 - Allows the program to compile and run on
29# a 4.2BSD system.
30#
31# PUTCHAR - Within tn3270, on a NOT43 system,
32# allows the use of the 4.3 curses
33# (greater speed updating the screen).
34# You need the 4.3 curses for this to work.
35#
36# FD_SETSIZE - On whichever system, if this isn't defined,
37# we patch over the FD_SET, etc., macros with
38# some homebrewed ones.
39#
40# SO_OOBINLINE - This is a socket option which we would like
41# to set to allow TCP urgent data to come
42# to us "inline". This is NECESSARY for
43# CORRECT operation, and desireable for
44# simpler operation.
45#
46# LNOFLSH - Detects the presence of the LNOFLSH bit
47# in the tty structure.
48#
49#
50# Here are some which are used throughout the system:
51#
7ffa2088
GM
52# unix - Compiles in unix specific stuff.
53#
54# msdos - Compiles in msdos specific stuff.
55#
56
fc70b5f7
GM
57# msdos versus unix defines
58O = .o
df7a539a 59#PC_O = .obj
fc70b5f7
GM
60
61X =
df7a539a
GM
62#PC_X = .exe
63
64L =
65#PC_L = -link
fc70b5f7 66
7ffa2088 67CC = cc
df7a539a 68#PC_CC = cl
dd6c8c3e
GM
69
70MV = mv
df7a539a 71#PC_MV = rename
dd6c8c3e
GM
72
73RM = rm -f
df7a539a 74#PC_RM= erase
dd6c8c3e
GM
75
76LINT_ARGS =
df7a539a 77#PC_LINT_ARGS = -DLINT_ARGS
dd6c8c3e
GM
78
79DEBUG_FLAGS = -g
df7a539a 80#PC_DEBUG_FLAGS = -Zi -Od
dd6c8c3e
GM
81
82AR = ar
df7a539a
GM
83AR1 = cr
84AR2 =
85AR3 =
86#PC_AR = lib
87#PC_AR1 =
88#PC_AR2 = +
89#PC_AR3 = ";"
dd6c8c3e
GM
90
91RANLIB = ranlib
df7a539a 92#PC_RANLIB = echo "Done with "
dd6c8c3e
GM
93
94
7ffa2088 95PRINT = print
ca67e7b4 96ACTION = sccs tell
7ffa2088 97
dd6c8c3e 98DEFINES = ${LINT_ARGS}
7ffa2088 99
04b5f59e 100INCLUDES = -I. -I..
7ffa2088
GM
101
102OPTIMIZE = -O
dd6c8c3e 103OPTIMIZE = ${DEBUG_FLAGS}
7ffa2088
GM
104
105CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
106
107# Lint flags
108LINTFLAGS = -hbxaz
109# How to install the bloody thing...
110
111DESTDIR=
112
113BINDIR = $(DESTDIR)/usr/ucb
7ffa2088
GM
114
115# Names for the terminal libraries...
116LIBCURSES = -lcurses
117LIBTERM = -ltermlib
118
df7a539a
GM
119#PC_LIBCURSES =
120#PC_LIBTERM =
121
7ffa2088 122# The source files...
ca67e7b4 123ALLH = telnet.ext
7ffa2088 124
ca67e7b4
C
125TNMAIN = ../telnet.c
126TNMAIN = telnet.c
3d05654e 127MSMAIN = ascii/mset.c
7ffa2088 128
ca67e7b4 129ALLC = ${TNMAIN}
eb82b98e 130
ca67e7b4 131ALLO = telnet$O mset$O
eb82b98e 132
ca67e7b4 133ALLPRINT = ${ALLH} ${ALLC}
eb82b98e 134
ca67e7b4 135ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README
eb82b98e 136
df7a539a
GM
137SYS = sys_curses
138#PC_SYS = sys_dos
dd6c8c3e 139
7ffa2088 140# The places where the various components live...
a63f9327 141
ca67e7b4 142SUBDIR = api ascii ctlr general ${SYS}
d86829c0 143
eb82b98e
GM
144# The following are directories we don't do regular make's in, but
145# we do make everywhere, print, and sourcelist in.
a63f9327 146
78f0cc47 147EXTRADIR = arpa sys_dos tools utilities
eb82b98e 148
d86829c0 149# The libraries we use. The order here is important.
c0c987e5
GM
150# syslib.a and ctlrlib.a should come first, then the rest.
151SUBLIB = ${SYS}/syslib.a ctlr/ctlrlib.a \
78f0cc47 152 ascii/asciilib.a general/generallib.a
7ffa2088 153
7ffa2088
GM
154.s.o:
155 /lib/cpp -E $< | as -o $@
156
dd6c8c3e
GM
157.c.obj:
158 ${CC} ${CFLAGS} -c $<
159
fc70b5f7 160all: FRC tn3270$X mset$X
7ffa2088
GM
161
162FRC:
755c4d48
GM
163 for i in ${SUBDIR}; \
164 do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done
7ffa2088 165
ca67e7b4
C
166tn3270$X: telnet$O ${SUBLIB} api/apilib.a
167 ${CC} ${CFLAGS} -o tn3270 telnet$O \
c0c987e5 168 $L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM)
df7a539a
GM
169
170#PC_tn3270$X:
1eec4ac7
GM
171#PC_ link <@<
172#PC_ telnet
b0ef3ef0 173#PC_ tn3270
1eec4ac7 174#PC_ nul
c0c987e5 175#PC_ ${SUBLIB} api/apilib.a+
1eec4ac7
GM
176#PC_ \lib\ublib\ubtcp
177#PC_ _PC_<
7ffa2088 178
fc70b5f7 179mset$X: mset$O ascii/map3270$O
c0c987e5 180 ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a
7ffa2088 181
ca67e7b4
C
182telnet$O: $(TNMAIN)
183 $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
184
fc70b5f7 185mset$O: $(MSMAIN)
7ffa2088
GM
186 $(CC) $(CFLAGS) -c $(MSMAIN)
187
ca67e7b4 188install: tn3270$X mset$X
a9bda23c
GM
189 install -m 755 -o bin -g bin -s tn3270 $(BINDIR)
190 install -m 755 -o bin -g bin -s mset $(BINDIR)
7ffa2088 191
a233c85a
GM
192action:
193 ${ACTION}
194
eb82b98e
GM
195everywhere: action
196 for i in ${SUBDIR} ${EXTRADIR}; \
197 do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
198 "ACTION=${ACTION}"); done
a233c85a 199
ca67e7b4 200clean:
dd6c8c3e
GM
201 for i in $(ALLO) mset tn3270 errs makefile.bak; \
202 do (${RM} $$i); done
203 for i in ${SUBDIR} ${EXTRADIR}; \
204 do (cd $$i; make ${MFLAGS} clean); done
205
206sccsclean:
78f0cc47
GM
207 -sccs clean
208 -sccs get makefile
dd6c8c3e
GM
209 for i in ${SUBDIR} ${EXTRADIR}; \
210 do (cd $$i; make ${MFLAGS} sccsclean); done
7ffa2088
GM
211
212print:
eb82b98e
GM
213 ${PRINT} ${ALLPRINT}
214 for i in ${SUBDIR} ${EXTRADIR}; \
7ffa2088 215 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
7ffa2088
GM
216
217tags: ${ALLC} ${ALLH}
ca67e7b4 218 ctags -t ${ALLC} ${ALLH}
7ffa2088 219
be140351
GM
220sourcelist: ${ALLSOURCE}
221 @for i in ${ALLSOURCE}; \
78f0cc47 222 do (echo ${DIRPATH}$$i); done
be140351 223 @for i in ${SUBDIR} ${EXTRADIR}; \
78f0cc47 224 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
eb82b98e
GM
225 sourcelist); done
226
7ffa2088 227lint:
ca67e7b4
C
228 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
229 ${TNMAIN} -lcurses
230 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
7ffa2088 231
1eec4ac7 232makefiles.pc: tools/mkmake
fc70b5f7 233 for i in . ${SUBDIR} ${EXTRADIR}; \
df7a539a 234 do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \
1eec4ac7 235 ./tools/mkmake | \
df7a539a 236 sed -e "sx/x\\\\xg" -e "s/[ ]*_PC_//" > $$i/makefile.mak); \
fc70b5f7
GM
237 done
238
1eec4ac7
GM
239tools/mkmake:
240 (cd tools; make mkmake)
241
7ffa2088
GM
242.DEFAULT:
243 sccs get $<
244
245depend: thisdepend
246 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
247
248thisdepend:
fc70b5f7
GM
249 echo > eddep.c
250 grep '^#include' ${ALLC} eddep.c | grep -v '<' | \
7ffa2088 251 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
fc70b5f7 252 -e 's/\.c/$$O/' | \
7ffa2088
GM
253 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
254 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
255 else rec = rec " " $$2 } } \
256 END { print rec } ' > makedep
257 echo '$$r makedep' >>eddep
258 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
259 echo '$$r makedep' >>eddep
260 echo 'w' >>eddep
dd6c8c3e 261 -rm -f makefile.bak
7ffa2088
GM
262 cp makefile makefile.bak
263 ed - makefile < eddep
fc70b5f7 264 rm eddep makedep eddep.c
7ffa2088
GM
265
266# DO NOT DELETE THIS LINE
267
ca67e7b4
C
268telnet$O: ascii/termin.ext ctlr/screen.h ctlr/oia.h ctlr/options.ext
269telnet$O: ctlr/outbound.ext general/globals.h telnet.ext general/general.h