date and time created 87/05/10 14:32:07 by minshall
[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...
82ALLH = general.h
83
84TNMAIN = ../telnet.c
85TNMAIN = telnet.c
86MSMAIN = keyboard/mset.c
87
88# The places where the various components live...
89SUBDIR = ascii ctlr keyboard screen system
90SUBLIB = ascii/asciilib ctlr/ctlrlib keyboard/keyboardlib \
91 screen/screenlib system/systemlib
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
105 for i in ${SUBDIR}; do (cd tmp; ar x ../$$i/$${i}lib); done
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
110# for i in ${SUBDIR}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
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
123mset: mset.o tn3270.a
124 ${CC} ${CFLAGS} -o mset mset.o keyboard/map3270.o $(LIBCURSES)
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
142clean:
143 rm -f $(ALLO) mset tn3270 errs makefile.bak tn3270.a
0d3c45d4 144 for i in ${SUBDIR} tools; do (cd $$i; make ${MFLAGS} clean); done
7ffa2088
GM
145 rm -f t1 tmp/*.o
146 -rmdir tmp
147
148print:
149 ${PRINT} ${ALLH} ${MSMAIN} ${TNMAIN}
150 for i in ${SUBDIR}; \
151 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
152 cd tools; make ${MFLAGS} "PRINT=${PRINT}" print
153
154tags: ${ALLC} ${ALLH}
155 ctags -t ${ALLC} ${ALLH}
156
157lint:
158 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
159 ${TNMAIN} -lcurses
160 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
161
162.DEFAULT:
163 sccs get $<
164
165depend: thisdepend
166 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
167
168thisdepend:
169 grep '^#include' ${ALLC} | grep -v '<' | \
170 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
171 -e 's/\.c/.o/' | \
172 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
173 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
174 else rec = rec " " $$2 } } \
175 END { print rec } ' > makedep
176 echo '$$r makedep' >>eddep
177 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
178 echo '$$r makedep' >>eddep
179 echo 'w' >>eddep
180 cp makefile makefile.bak
181 ed - makefile < eddep
182 rm eddep makedep
183
184# DO NOT DELETE THIS LINE
185
186telnet.o: ctlr/screen.h system/globals.h telnet.ext ctlr/options.ext
187telnet.o: ctlr/outbound.ext keyboard/termin.ext
188keyboard/mset.o: keyboard/state.h keyboard/m4.out ../system/globals.h
189keyboard/mset.o: keyboard/map3270.ext