This version connects to the other side.
[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#
16# DEBUG - Allow for some extra debugging operations.
17#
18# NOT43 - Allows the program to compile and run on
19# a 4.2BSD system.
20#
21# PUTCHAR - Within tn3270, on a NOT43 system,
22# allows the use of the 4.3 curses
23# (greater speed updating the screen).
24# You need the 4.3 curses for this to work.
25#
26# FD_SETSIZE - On whichever system, if this isn't defined,
27# we patch over the FD_SET, etc., macros with
28# some homebrewed ones.
29#
30# SO_OOBINLINE - This is a socket option which we would like
31# to set to allow TCP urgent data to come
32# to us "inline". This is NECESSARY for
33# CORRECT operation, and desireable for
34# simpler operation.
35#
36# LNOFLSH - Detects the presence of the LNOFLSH bit
37# in the tty structure.
38#
39#
40# Here are some which are used throughout the system:
41#
42# SLOWSCREEN - If SLOWSCREEN is defined, we generate code
43# that attempts to optimize the line between
44# the computer (on which tn3270 runs) and the
45# user's terminal (which line may be 1200 baud,
46# or some such) at the cost of CPU time on
47# the above referenced computer.
48#
49# unix - Compiles in unix specific stuff.
50#
51# msdos - Compiles in msdos specific stuff.
52#
53
54CC = cc
55PRINT = print
56
57DEFINES = -DSLOWSCREEN
58DEFINES = -DSLOWSCREEN -DDEBUG
59
04b5f59e 60INCLUDES = -I. -I..
7ffa2088
GM
61
62OPTIMIZE = -O
63OPTIMIZE = -g
64
65CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
66
67# Lint flags
68LINTFLAGS = -hbxaz
69# How to install the bloody thing...
70
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...
3d05654e 82ALLH =
7ffa2088
GM
83
84TNMAIN = ../telnet.c
85TNMAIN = telnet.c
3d05654e 86MSMAIN = ascii/mset.c
7ffa2088
GM
87
88# The places where the various components live...
3d05654e
GM
89SUBDIR = ascii ctlr sys general api
90SUBLIB = ascii/ascii.lib ctlr/ctlr.lib \
91 sys/sys.lib general/general.lib api/api.lib
7ffa2088
GM
92
93
94ALLC = ${TNMAIN} ${MSMAIN}
95
96ALLO = telnet.o mset.o
97
98.s.o:
99 /lib/cpp -E $< | as -o $@
100
101all: ${SUBDIR} tn3270.a tn3270 mset
102
103tn3270.a: ${SUBLIB}
104 -mkdir tmp
3d05654e 105 for i in ${SUBDIR}; do (cd tmp; ar x ../$$i/$${i}.lib); done
7ffa2088
GM
106 ls tmp/*.o | sort -t/ +1 > t1
107 ar cr tn3270.a `lorder \`cat t1\` | tsort`
108 rm -f t1 tmp/*
109 ranlib tn3270.a
3d05654e 110# for i in ${SUBDIR}; do (cd tmp; ar x ../$$i/$${i}.lib_p); done
7ffa2088
GM
111# ls tmp/*.o | sort -t/ +1 > t1
112# ar cr tn3270_p.a `lorder \`cat t1\` | tsort`
113# rm -rf t1 tmp
114
115${SUBDIR}: FRC
116 cd $@; make ${MFLAGS} "CFLAGS=${CFLAGS}"
117
118FRC:
119
120tn3270: telnet.o tn3270.a
121 ${CC} ${CFLAGS} -o tn3270 telnet.o tn3270.a $(LIBCURSES) $(LIBTERM)
122
59cbe7f2
GM
123mset: mset.o ascii/map3270.o ascii/astosc.o
124 ${CC} ${CFLAGS} -o mset mset.o ascii/map3270.o ascii/astosc.o
7ffa2088
GM
125
126telnet.o: $(TNMAIN)
127 $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
128
129mset.o: $(MSMAIN)
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
145everywhere:
146 for i in ${SUBDIR} tools; do (echo "[$$i]"; cd $$i; make ${MFLAGS} action "ACTION=${ACTION}"); done
147
7ffa2088
GM
148clean:
149 rm -f $(ALLO) mset tn3270 errs makefile.bak tn3270.a
0d3c45d4 150 for i in ${SUBDIR} tools; do (cd $$i; make ${MFLAGS} clean); done
7ffa2088
GM
151 rm -f t1 tmp/*.o
152 -rmdir tmp
153
154print:
155 ${PRINT} ${ALLH} ${MSMAIN} ${TNMAIN}
156 for i in ${SUBDIR}; \
157 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
158 cd tools; make ${MFLAGS} "PRINT=${PRINT}" print
159
160tags: ${ALLC} ${ALLH}
161 ctags -t ${ALLC} ${ALLH}
162
163lint:
164 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
165 ${TNMAIN} -lcurses
166 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
167
168.DEFAULT:
169 sccs get $<
170
171depend: thisdepend
172 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
173
174thisdepend:
175 grep '^#include' ${ALLC} | grep -v '<' | \
176 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
177 -e 's/\.c/.o/' | \
178 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
179 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
180 else rec = rec " " $$2 } } \
181 END { print rec } ' > makedep
182 echo '$$r makedep' >>eddep
183 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
184 echo '$$r makedep' >>eddep
185 echo 'w' >>eddep
186 cp makefile makefile.bak
187 ed - makefile < eddep
188 rm eddep makedep
189
190# DO NOT DELETE THIS LINE
191
3d05654e
GM
192telnet.o: ctlr/screen.h general/globals.h telnet.ext ctlr/options.ext
193telnet.o: ctlr/outbound.ext ascii/termin.ext general/general.h
59cbe7f2 194ascii/mset.o: state.h ../general/globals.h map3270.ext