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