# Copyright (c) 1988 Regents of the University of California.
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, 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'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# @(#)makefile 4.1 (Berkeley) 12/4/88
# 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
# 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
MAN1DIR = $(DESTDIR)/usr/man/cat1
MAN5DIR = $(DESTDIR)/usr/man/cat5
# Names for the terminal libraries...
ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README \
mset.1 tn3270.1 map3270.5
# The places where the various components live...
SUBDIR = api ascii ctlr general ${SYS} telnet
# 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/telprog.o ${SUBLIB} api/apilib.a
${CC} ${CFLAGS} -o tn3270 telnet/telprog.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) -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