# Copyright (c) 1988 Regents of the University of California.
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of California at Berkeley. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
# @(#)makefile 3.3 (Berkeley) 3/28/88
# Makefile for tn3270 and friends...
# 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
# 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:
# 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 "
OPTIMIZE = ${DEBUG_FLAGS}
CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
# How to install the bloody thing...
BINDIR = $(DESTDIR)/usr/ucb
# Names for the terminal libraries...
ALLPRINT = ${ALLH} ${ALLC}
ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README
# The places where the various components live...
SUBDIR = api ascii ctlr general ${SYS}
# The following are directories we don't do regular make's in, but
# we do make everywhere, print, and sourcelist in.
EXTRADIR = arpa sys_dos tools utilities
# 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$O ${SUBLIB} api/apilib.a
${CC} ${CFLAGS} -o tn3270 telnet$O \
$L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM)
#PC_ ${SUBLIB} api/apilib.a+
mset$X: mset$O ascii/map3270$O
${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a
$(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
$(CC) $(CFLAGS) -c $(MSMAIN)
install -m 755 -o bin -g bin -s tn3270 $(BINDIR)
install -m 755 -o bin -g bin -s mset $(BINDIR)
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
@for i in ${ALLSOURCE}; \
do (echo ${DIRPATH}$$i); done
@for i in ${SUBDIR} ${EXTRADIR}; \
do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
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
telnet$O: ascii/termin.ext ctlr/screen.h ctlr/oia.h ctlr/options.ext
telnet$O: ctlr/outbound.ext general/globals.h telnet.ext general/general.h