define bits for ESDI, error recovery
[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#
7ffa2088
GM
40# unix - Compiles in unix specific stuff.
41#
42# msdos - Compiles in msdos specific stuff.
43#
44
fc70b5f7
GM
45# msdos versus unix defines
46O = .o
47PC_O = .obj
48
49X =
50PC_X = .exe
51
7ffa2088
GM
52CC = cc
53PRINT = print
eb82b98e 54ACTION = sccs tell
7ffa2088 55
755c4d48 56DEFINES =
7ffa2088 57
04b5f59e 58INCLUDES = -I. -I..
7ffa2088
GM
59
60OPTIMIZE = -O
61OPTIMIZE = -g
62
63CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
64
65# Lint flags
66LINTFLAGS = -hbxaz
67# How to install the bloody thing...
68
69DESTDIR=
70
71BINDIR = $(DESTDIR)/usr/ucb
72ETCDIR = $(DESTDIR)/etc
73MANDIR = $(DESTDIR)/usr/man/man
74
75# Names for the terminal libraries...
76LIBCURSES = -lcurses
77LIBTERM = -ltermlib
78
79# The source files...
eb82b98e 80ALLH = telnet.ext
7ffa2088
GM
81
82TNMAIN = ../telnet.c
83TNMAIN = telnet.c
3d05654e 84MSMAIN = ascii/mset.c
7ffa2088 85
eb82b98e
GM
86ALLC = ${TNMAIN}
87
fc70b5f7 88ALLO = telnet$O mset$O
eb82b98e
GM
89
90ALLPRINT = ${ALLH} ${ALLC}
91
92ALLSOURCE = ${ALLPRINT} makefile makefile.mak README
93
7ffa2088 94# The places where the various components live...
a63f9327 95
755c4d48 96SUBDIR = api apilib ascii ctlr general sys
d86829c0 97
eb82b98e
GM
98# The following are directories we don't do regular make's in, but
99# we do make everywhere, print, and sourcelist in.
a63f9327 100
78f0cc47 101EXTRADIR = arpa sys_dos tools utilities
eb82b98e 102
d86829c0 103# The libraries we use. The order here is important.
78f0cc47 104# ctlrlib.a and syslib.a should come first, then apilib.a
d86829c0 105# then the rest.
78f0cc47
GM
106SUBLIB = ctlr/ctlrlib.a sys/syslib.a \
107 api/apilib.a \
108 ascii/asciilib.a general/generallib.a
7ffa2088 109
7ffa2088
GM
110.s.o:
111 /lib/cpp -E $< | as -o $@
112
fc70b5f7 113all: FRC tn3270$X mset$X
7ffa2088
GM
114
115FRC:
755c4d48
GM
116 for i in ${SUBDIR}; \
117 do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done
7ffa2088 118
fc70b5f7
GM
119tn3270$X: telnet$O ${SUBLIB}
120 ${CC} ${CFLAGS} -o tn3270 telnet$O \
d86829c0 121 ${SUBLIB} apilib/apilib.a $(LIBCURSES) $(LIBTERM)
7ffa2088 122
fc70b5f7
GM
123mset$X: mset$O ascii/map3270$O
124 ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O apilib/apilib.a
7ffa2088 125
fc70b5f7 126telnet$O: $(TNMAIN)
7ffa2088
GM
127 $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
128
fc70b5f7 129mset$O: $(MSMAIN)
7ffa2088
GM
130 $(CC) $(CFLAGS) -c $(MSMAIN)
131
132install:
133 install -s tn3270 $(BINDIR)
134 install -s mset $(BINDIR)
135 if [ ! -f ${ETCDIR}/map3270 ]; then \
136 install -c -m 444 map3270.dat ${ETCDIR}/map3270; \
137 fi
138# install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1
139# install -c -m 444 man/mset.1 $(MANDIR)1/mset.1
140# install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5
141
a233c85a
GM
142action:
143 ${ACTION}
144
eb82b98e
GM
145everywhere: action
146 for i in ${SUBDIR} ${EXTRADIR}; \
147 do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
148 "ACTION=${ACTION}"); done
a233c85a 149
7ffa2088 150clean:
d86829c0 151 rm -f $(ALLO) mset tn3270 errs makefile.bak
78f0cc47
GM
152 -sccs clean
153 -sccs get makefile
eb82b98e 154 for i in ${SUBDIR} ${EXTRADIR}; do (cd $$i; make ${MFLAGS} clean); done
7ffa2088
GM
155
156print:
eb82b98e
GM
157 ${PRINT} ${ALLPRINT}
158 for i in ${SUBDIR} ${EXTRADIR}; \
7ffa2088 159 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
7ffa2088
GM
160
161tags: ${ALLC} ${ALLH}
162 ctags -t ${ALLC} ${ALLH}
163
be140351
GM
164sourcelist: ${ALLSOURCE}
165 @for i in ${ALLSOURCE}; \
78f0cc47 166 do (echo ${DIRPATH}$$i); done
be140351 167 @for i in ${SUBDIR} ${EXTRADIR}; \
78f0cc47 168 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
eb82b98e
GM
169 sourcelist); done
170
7ffa2088
GM
171lint:
172 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
173 ${TNMAIN} -lcurses
174 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
175
fc70b5f7
GM
176makefile.mak: makefile
177 for i in . ${SUBDIR} ${EXTRADIR}; \
178 do (sed -e "s/lib\.a/.lib/g" -e "s/^PC_//" < $$i/makefile | \
179 mkmake | sed -e "sx/x\\\\x" > $$i/makefile.mak); \
180 done
181
7ffa2088
GM
182.DEFAULT:
183 sccs get $<
184
185depend: thisdepend
186 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
187
188thisdepend:
fc70b5f7
GM
189 echo > eddep.c
190 grep '^#include' ${ALLC} eddep.c | grep -v '<' | \
7ffa2088 191 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
fc70b5f7 192 -e 's/\.c/$$O/' | \
7ffa2088
GM
193 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
194 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
195 else rec = rec " " $$2 } } \
196 END { print rec } ' > makedep
197 echo '$$r makedep' >>eddep
198 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
199 echo '$$r makedep' >>eddep
200 echo 'w' >>eddep
201 cp makefile makefile.bak
202 ed - makefile < eddep
fc70b5f7 203 rm eddep makedep eddep.c
7ffa2088
GM
204
205# DO NOT DELETE THIS LINE
206
fc70b5f7
GM
207telnet$O: ascii/termin.ext ctlr/screen.h ctlr/oia.h ctlr/options.ext
208telnet$O: ctlr/outbound.ext general/globals.h telnet.ext general/general.h