if old sector can't be read, still clear the "good" bit
[unix-history] / usr / src / usr.bin / tn3270 / makefile
CommitLineData
7ffa2088
GM
1# Makefile for tn3270 and friends...
2# @(#)makefile 3.1 10/29/86
3#
4# This is the makefile for tn3270. Note that we use ../telnet.c
5# (compiled with special options; see below) to provide the telnet
6# support we need.
7#
8# The following are the defines that may be passed (via the cc
9# -D option) to the compiler.
10#
11# The first group relate only to ../telnet.c:
12#
13# TN3270 - This is to be linked with tn3270. Necessary
14# for creating tn3270.
15#
7ffa2088
GM
16# NOT43 - Allows the program to compile and run on
17# a 4.2BSD system.
18#
19# PUTCHAR - Within tn3270, on a NOT43 system,
20# allows the use of the 4.3 curses
21# (greater speed updating the screen).
22# You need the 4.3 curses for this to work.
23#
24# FD_SETSIZE - On whichever system, if this isn't defined,
25# we patch over the FD_SET, etc., macros with
26# some homebrewed ones.
27#
28# SO_OOBINLINE - This is a socket option which we would like
29# to set to allow TCP urgent data to come
30# to us "inline". This is NECESSARY for
31# CORRECT operation, and desireable for
32# simpler operation.
33#
34# LNOFLSH - Detects the presence of the LNOFLSH bit
35# in the tty structure.
36#
37#
38# Here are some which are used throughout the system:
39#
40# SLOWSCREEN - If SLOWSCREEN is defined, we generate code
41# that attempts to optimize the line between
42# the computer (on which tn3270 runs) and the
43# user's terminal (which line may be 1200 baud,
44# or some such) at the cost of CPU time on
45# the above referenced computer.
46#
47# unix - Compiles in unix specific stuff.
48#
49# msdos - Compiles in msdos specific stuff.
50#
51
52CC = cc
53PRINT = print
eb82b98e 54ACTION = sccs tell
7ffa2088
GM
55
56DEFINES = -DSLOWSCREEN
a7350aa3 57DEFINES = -DSLOWSCREEN
7ffa2088 58
04b5f59e 59INCLUDES = -I. -I..
7ffa2088
GM
60
61OPTIMIZE = -O
62OPTIMIZE = -g
63
64CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
65
66# Lint flags
67LINTFLAGS = -hbxaz
68# How to install the bloody thing...
69
eb82b98e 70DIRPATH=.
7ffa2088
GM
71DESTDIR=
72
73BINDIR = $(DESTDIR)/usr/ucb
74ETCDIR = $(DESTDIR)/etc
75MANDIR = $(DESTDIR)/usr/man/man
76
77# Names for the terminal libraries...
78LIBCURSES = -lcurses
79LIBTERM = -ltermlib
80
81# The source files...
eb82b98e 82ALLH = telnet.ext
7ffa2088
GM
83
84TNMAIN = ../telnet.c
85TNMAIN = telnet.c
3d05654e 86MSMAIN = ascii/mset.c
7ffa2088 87
eb82b98e
GM
88ALLC = ${TNMAIN}
89
90ALLO = telnet.o mset.o
91
92ALLPRINT = ${ALLH} ${ALLC}
93
94ALLSOURCE = ${ALLPRINT} makefile makefile.mak README
95
7ffa2088 96# The places where the various components live...
3d05654e 97SUBDIR = ascii ctlr sys general api
d86829c0 98
eb82b98e
GM
99# The following are directories we don't do regular make's in, but
100# we do make everywhere, print, and sourcelist in.
101EXTRADIR = apilib sys_dos tools
102
d86829c0
GM
103# The libraries we use. The order here is important.
104# ctlr.lib and sys.lib should come first, then api.lib
105# then the rest.
106SUBLIB = ctlr/ctlr.lib sys/sys.lib \
107 api/api.lib \
108 ascii/ascii.lib general/general.lib
7ffa2088
GM
109
110
7ffa2088
GM
111.s.o:
112 /lib/cpp -E $< | as -o $@
113
d86829c0 114all: ${SUBDIR} tn3270 mset
7ffa2088
GM
115
116${SUBDIR}: FRC
117 cd $@; make ${MFLAGS} "CFLAGS=${CFLAGS}"
118
119FRC:
120
d86829c0
GM
121tn3270: telnet.o ${SUBLIB}
122 ${CC} ${CFLAGS} -o tn3270 telnet.o \
123 ${SUBLIB} apilib/apilib.a $(LIBCURSES) $(LIBTERM)
7ffa2088 124
59cbe7f2
GM
125mset: mset.o ascii/map3270.o ascii/astosc.o
126 ${CC} ${CFLAGS} -o mset mset.o ascii/map3270.o ascii/astosc.o
7ffa2088
GM
127
128telnet.o: $(TNMAIN)
129 $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
130
131mset.o: $(MSMAIN)
132 $(CC) $(CFLAGS) -c $(MSMAIN)
133
134install:
135 install -s tn3270 $(BINDIR)
136 install -s mset $(BINDIR)
137 if [ ! -f ${ETCDIR}/map3270 ]; then \
138 install -c -m 444 map3270.dat ${ETCDIR}/map3270; \
139 fi
140# install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1
141# install -c -m 444 man/mset.1 $(MANDIR)1/mset.1
142# install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5
143
a233c85a
GM
144action:
145 ${ACTION}
146
eb82b98e
GM
147everywhere: action
148 for i in ${SUBDIR} ${EXTRADIR}; \
149 do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
150 "ACTION=${ACTION}"); done
a233c85a 151
7ffa2088 152clean:
d86829c0 153 rm -f $(ALLO) mset tn3270 errs makefile.bak
eb82b98e 154 for i in ${SUBDIR} ${EXTRADIR}; do (cd $$i; make ${MFLAGS} clean); done
7ffa2088
GM
155 rm -f t1 tmp/*.o
156 -rmdir tmp
157
158print:
eb82b98e
GM
159 ${PRINT} ${ALLPRINT}
160 for i in ${SUBDIR} ${EXTRADIR}; \
7ffa2088 161 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
7ffa2088
GM
162
163tags: ${ALLC} ${ALLH}
164 ctags -t ${ALLC} ${ALLH}
165
be140351
GM
166sourcelist: ${ALLSOURCE}
167 @for i in ${ALLSOURCE}; \
eb82b98e 168 do (echo ${DIRPATH}/$$i); done
be140351 169 @for i in ${SUBDIR} ${EXTRADIR}; \
eb82b98e
GM
170 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}/$$i" \
171 sourcelist); done
172
7ffa2088
GM
173lint:
174 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
175 ${TNMAIN} -lcurses
176 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
177
178.DEFAULT:
179 sccs get $<
180
181depend: thisdepend
182 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
183
184thisdepend:
185 grep '^#include' ${ALLC} | grep -v '<' | \
186 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
187 -e 's/\.c/.o/' | \
188 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
189 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
190 else rec = rec " " $$2 } } \
191 END { print rec } ' > makedep
192 echo '$$r makedep' >>eddep
193 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
194 echo '$$r makedep' >>eddep
195 echo 'w' >>eddep
196 cp makefile makefile.bak
197 ed - makefile < eddep
198 rm eddep makedep
199
200# DO NOT DELETE THIS LINE
201
3d05654e
GM
202telnet.o: ctlr/screen.h general/globals.h telnet.ext ctlr/options.ext
203telnet.o: ctlr/outbound.ext ascii/termin.ext general/general.h
59cbe7f2 204ascii/mset.o: state.h ../general/globals.h map3270.ext