# @(#)makefile 4.9 (Berkeley) 5/8/91
# Makefile for tn3270 and friends...
# This is the makefile for tn3270. Note that we use the 4.3+ telnet
# (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.
# TN3270 - This is to be linked with tn3270. Necessary
# for creating tn3270. Only for compiling
# 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
# TERMCAP - Define this if your system is termcap based,
# otherwise a terminfo based system is assumed.
# SRCRT - Includes code to allow you to specify
# [!]@hop1@hop2...[@|:]dst
# Leading ! means strict source route.
# NOSTRNCASECMP - Define this if you do not have strncasecmp() in
# USE_TERMIO - Define this if you have System V termio
# structures. What is here is how things
# KLUDGELINEMODE - Define this to get the kludged up version
# of linemode that was in 4.3BSD. This is a
# good thing to have around for talking to
# Here are some which are used throughout the system:
# unix - Compiles in unix specific stuff.
# msdos - Compiles in msdos specific stuff.
# msdos versus unix defines
#PC_LINT_ARGS = -DLINT_ARGS
#PC_DEBUG_FLAGS = -Zi -Od
#PC_RANLIB = echo "Done with "
DEFINES= ${LINT_ARGS} -DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO
INCLUDES = -I. -I.. -I../../lib -I../../../lib
OPTIMIZE = ${DEBUG_FLAGS}
CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
# How to install the bloody thing...
BINDIR = $(DESTDIR)/usr/bin
MAN1DIR = $(DESTDIR)/usr/share/man/cat1
MAN5DIR = $(DESTDIR)/usr/share/man/cat5
# Names for the terminal libraries...
MSMAIN = ${.CURDIR}/ascii/mset.c
ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README \
mset.1 tn3270.1 map3270.5
# The places where the various components live...
SUBDIR = ${.CURDIR}/api ${.CURDIR}/ascii ${.CURDIR}/ctlr \
${.CURDIR}/general ${.CURDIR}/${SYS} ${.CURDIR}/telnet
# The following are directories we don't do regular make's in, but
# we do make everywhere, print, and sourcelist in.
EXTRADIR = ${.CURDIR}/tools
# The libraries we use. The order here is important.
# syslib.a and ctlrlib.a should come first, then the rest.
SUBLIB = ${SYS}/syslib.a ctlr/ctlrlib.a \
ascii/asciilib.a general/generallib.a
/lib/cpp -E $< | as -o $@
do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done
tn3270$X: telnet/telprog.o ${SUBLIB} api/libapi.a
${CC} ${CFLAGS} -o tn3270 telnet/telprog.o \
$L ${SUBLIB} api/libapi.a $(LIBCURSES) $(LIBTERM) \
#PC_ ${SUBLIB} api/libapi.a+
mset$X: mset$O ascii/map3270$O
${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/libapi.a
$(CC) $(CFLAGS) -c $(MSMAIN)
install: tn3270$X mset$X tn3270.0 mset.0 map3270.0
install -m 755 -o bin -g bin -s tn3270 $(BINDIR)
install -m 755 -o bin -g bin -s mset $(BINDIR)
install -c -o bin -g bin -m 444 tn3270.0 mset.0 $(MAN1DIR)
install -c -o bin -g bin -m 444 map3270.0 $(MAN5DIR)
do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
for i in ${SUBDIR} ${EXTRADIR}; \
do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
"ACTION=${ACTION}"); done
for i in $(ALLO) mset tn3270 errs makefile.bak; \
for i in ${SUBDIR} ${EXTRADIR}; \
do (cd $$i; make ${MFLAGS} clean); done
for i in ${SUBDIR} ${EXTRADIR}; \
do (cd $$i; make ${MFLAGS} sccsclean); done
for i in ${SUBDIR} ${EXTRADIR}; \
do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
ctags -t `make ${MFLAGS} hclist`
@for i in ${ALLSOURCE}; \
do (echo ${DIRPATH}$$i); done
@for i in ${SUBDIR} ${EXTRADIR}; \
do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
lint ${LINTFLAGS} -Itelnet ${INCLUDES} ${DEFINES} -DTN3270 \
lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} \
makefiles.pc: tools/mkmake
for i in . ${SUBDIR} ${EXTRADIR}; \
do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \
sed -e "sx/x\\\\xg" -e "s/[ ]*_PC_//" > $$i/makefile.mak); \
for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
grep '^#include' ${ALLC} eddep.c | 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