# Makefile for tn3270 and friends...
# @(#)makefile 3.1 10/29/86
# This is the makefile for tn3270. Note that we use ../telnet.c
# (compiled with special options; see below) to provide the telnet
# The following are the defines that may be passed (via the cc
# -D option) to the compiler.
# The first group relate only to ../telnet.c:
# TN3270 - This is to be linked with tn3270. Necessary
# DEBUG - Allow for some extra debugging operations.
# NOT43 - Allows the program to compile and run on
# PUTCHAR - Within tn3270, on a NOT43 system,
# allows the use of the 4.3 curses
# (greater speed updating the screen).
# You need the 4.3 curses for this to work.
# FD_SETSIZE - On whichever system, if this isn't defined,
# we patch over the FD_SET, etc., macros with
# SO_OOBINLINE - This is a socket option which we would like
# to set to allow TCP urgent data to come
# to us "inline". This is NECESSARY for
# CORRECT operation, and desireable for
# LNOFLSH - Detects the presence of the LNOFLSH bit
# Here are some which are used throughout the system:
# SLOWSCREEN - If SLOWSCREEN is defined, we generate code
# that attempts to optimize the line between
# the computer (on which tn3270 runs) and the
# user's terminal (which line may be 1200 baud,
# or some such) at the cost of CPU time on
# the above referenced computer.
# unix - Compiles in unix specific stuff.
# msdos - Compiles in msdos specific stuff.
DEFINES = -DSLOWSCREEN -DDEBUG
CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
# How to install the bloody thing...
BINDIR = $(DESTDIR)/usr/ucb
MANDIR = $(DESTDIR)/usr/man/man
# Names for the terminal libraries...
# The places where the various components live...
SUBDIR = ascii ctlr sys general api
SUBLIB = ascii/ascii.lib ctlr/ctlr.lib \
sys/sys.lib general/general.lib api/api.lib
ALLC = ${TNMAIN} ${MSMAIN}
/lib/cpp -E $< | as -o $@
all: ${SUBDIR} tn3270.a tn3270 mset
for i in ${SUBDIR}; do (cd tmp; ar x ../$$i/$${i}.lib); done
ls tmp/*.o | sort -t/ +1 > t1
ar cr tn3270.a `lorder \`cat t1\` | tsort`
# for i in ${SUBDIR}; do (cd tmp; ar x ../$$i/$${i}.lib_p); done
# ls tmp/*.o | sort -t/ +1 > t1
# ar cr tn3270_p.a `lorder \`cat t1\` | tsort`
cd $@; make ${MFLAGS} "CFLAGS=${CFLAGS}"
tn3270: telnet.o tn3270.a
${CC} ${CFLAGS} -o tn3270 telnet.o tn3270.a $(LIBCURSES) $(LIBTERM)
mset: mset.o ascii/map3270.o
${CC} ${CFLAGS} -o mset mset.o ascii/map3270.o
$(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
$(CC) $(CFLAGS) -c $(MSMAIN)
install -s tn3270 $(BINDIR)
install -s mset $(BINDIR)
if [ ! -f ${ETCDIR}/map3270 ]; then \
install -c -m 444 map3270.dat ${ETCDIR}/map3270; \
# install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1
# install -c -m 444 man/mset.1 $(MANDIR)1/mset.1
# install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5
for i in ${SUBDIR} tools; do (echo "[$$i]"; cd $$i; make ${MFLAGS} action "ACTION=${ACTION}"); done
rm -f $(ALLO) mset tn3270 errs makefile.bak tn3270.a
for i in ${SUBDIR} tools; do (cd $$i; make ${MFLAGS} clean); done
${PRINT} ${ALLH} ${MSMAIN} ${TNMAIN}
do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
cd tools; make ${MFLAGS} "PRINT=${PRINT}" print
lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
grep '^#include' ${ALLC} | grep -v '<' | \
sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } \
END { print rec } ' > makedep
echo '$$r makedep' >>eddep
echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
echo '$$r makedep' >>eddep
# DO NOT DELETE THIS LINE
telnet.o: ctlr/screen.h general/globals.h telnet.ext ctlr/options.ext
telnet.o: ctlr/outbound.ext ascii/termin.ext general/general.h
ascii/mset.o: state.h m4.out ../general/globals.h map3270.ext