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# NOT43 - Allows the program to compile and run on 17# a 4.2BSD system. 18# 19# PUTCHAR - Within tn3270, on a NOT43 system, 20# allows the use of the 4.3 curses 21# (greater speed updating the screen). 22# You need the 4.3 curses for this to work. 23# 24# FD_SETSIZE - On whichever system, if this isn't defined, 25# we patch over the FD_SET, etc., macros with 26# some homebrewed ones. 27# 28# SO_OOBINLINE - This is a socket option which we would like 29# to set to allow TCP urgent data to come 30# to us "inline". This is NECESSARY for 31# CORRECT operation, and desireable for 32# simpler operation. 33# 34# LNOFLSH - Detects the presence of the LNOFLSH bit 35# in the tty structure. 36# 37# 38# Here are some which are used throughout the system: 39# 40# unix - Compiles in unix specific stuff. 41# 42# msdos - Compiles in msdos specific stuff. 43# 44 45# msdos versus unix defines 46O = .o 47#PC_O = .obj 48 49X = 50#PC_X = .exe 51 52L = 53#PC_L = -link 54 55CC = cc 56#PC_CC = cl 57 58MV = mv 59#PC_MV = rename 60 61RM = rm -f 62#PC_RM= erase 63 64LINT_ARGS = 65#PC_LINT_ARGS = -DLINT_ARGS 66 67DEBUG_FLAGS = -g 68#PC_DEBUG_FLAGS = -Zi -Od 69 70AR = ar 71AR1 = cr 72AR2 = 73AR3 = 74#PC_AR = lib 75#PC_AR1 = 76#PC_AR2 = + 77#PC_AR3 = ";" 78 79RANLIB = ranlib 80#PC_RANLIB = echo "Done with " 81 82 83PRINT = print 84ACTION = sccs tell 85 86DEFINES = ${LINT_ARGS} 87 88INCLUDES = -I. -I.. 89 90OPTIMIZE = -O 91OPTIMIZE = ${DEBUG_FLAGS} 92 93CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) 94 95# Lint flags 96LINTFLAGS = -hbxaz 97# How to install the bloody thing... 98 99DESTDIR= 100 101BINDIR = $(DESTDIR)/usr/ucb 102ETCDIR = $(DESTDIR)/etc 103MANDIR = $(DESTDIR)/usr/man/man 104 105# Names for the terminal libraries... 106LIBCURSES = -lcurses 107LIBTERM = -ltermlib 108 109#PC_LIBCURSES = 110#PC_LIBTERM = 111 112# The source files... 113ALLH = telnet.ext 114 115TNMAIN = ../telnet.c 116TNMAIN = telnet.c 117MSMAIN = ascii/mset.c 118 119ALLC = ${TNMAIN} 120 121ALLO = telnet$O mset$O 122 123ALLPRINT = ${ALLH} ${ALLC} 124 125ALLSOURCE = ${ALLPRINT} makefile makefile.mak README 126 127SYS = sys_curses 128#PC_SYS = sys_dos 129 130# The places where the various components live... 131 132SUBDIR = api ascii ctlr general ${SYS} 133 134# The following are directories we don't do regular make's in, but 135# we do make everywhere, print, and sourcelist in. 136 137EXTRADIR = arpa sys_dos tools utilities 138 139# The libraries we use. The order here is important. 140# syslib.a and ctlrlib.a should come first, then the rest. 141SUBLIB = ${SYS}/syslib.a ctlr/ctlrlib.a \ 142 ascii/asciilib.a general/generallib.a 143 144.s.o: 145 /lib/cpp -E $< | as -o $@ 146 147.c.obj: 148 ${CC} ${CFLAGS} -c $< 149 150all: FRC tn3270$X mset$X 151 152FRC: 153 for i in ${SUBDIR}; \ 154 do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done 155 156tn3270$X: telnet$O ${SUBLIB} api/apilib.a 157 ${CC} ${CFLAGS} -o tn3270 telnet$O \ 158 $L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM) 159 160#PC_tn3270$X: 161#PC_ link <@< 162#PC_ telnet 163#PC_ tn3270 164#PC_ nul 165#PC_ ${SUBLIB} api/apilib.a+ 166#PC_ \lib\ublib\ubtcp 167#PC_ _PC_< 168 169mset$X: mset$O ascii/map3270$O 170 ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a 171 172telnet$O: $(TNMAIN) 173 $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN) 174 175mset$O: $(MSMAIN) 176 $(CC) $(CFLAGS) -c $(MSMAIN) 177 178install: 179 install -s tn3270 $(BINDIR) 180 install -s mset $(BINDIR) 181 if [ ! -f ${ETCDIR}/map3270 ]; then \ 182 install -c -m 444 map3270.dat ${ETCDIR}/map3270; \ 183 fi 184# install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1 185# install -c -m 444 man/mset.1 $(MANDIR)1/mset.1 186# install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5 187 188action: 189 ${ACTION} 190 191everywhere: action 192 for i in ${SUBDIR} ${EXTRADIR}; \ 193 do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \ 194 "ACTION=${ACTION}"); done 195 196clean: 197 for i in $(ALLO) mset tn3270 errs makefile.bak; \ 198 do (${RM} $$i); done 199 for i in ${SUBDIR} ${EXTRADIR}; \ 200 do (cd $$i; make ${MFLAGS} clean); done 201 202sccsclean: 203 -sccs clean 204 -sccs get makefile 205 for i in ${SUBDIR} ${EXTRADIR}; \ 206 do (cd $$i; make ${MFLAGS} sccsclean); done 207 208print: 209 ${PRINT} ${ALLPRINT} 210 for i in ${SUBDIR} ${EXTRADIR}; \ 211 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done 212 213tags: ${ALLC} ${ALLH} 214 ctags -t ${ALLC} ${ALLH} 215 216sourcelist: ${ALLSOURCE} 217 @for i in ${ALLSOURCE}; \ 218 do (echo ${DIRPATH}$$i); done 219 @for i in ${SUBDIR} ${EXTRADIR}; \ 220 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ 221 sourcelist); done 222 223lint: 224 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \ 225 ${TNMAIN} -lcurses 226 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses 227 228makefiles.pc: tools/mkmake 229 for i in . ${SUBDIR} ${EXTRADIR}; \ 230 do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \ 231 ./tools/mkmake | \ 232 sed -e "sx/x\\\\xg" -e "s/[ ]*_PC_//" > $$i/makefile.mak); \ 233 done 234 235tools/mkmake: 236 (cd tools; make mkmake) 237 238.DEFAULT: 239 sccs get $< 240 241depend: thisdepend 242 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done 243 244thisdepend: 245 echo > eddep.c 246 grep '^#include' ${ALLC} eddep.c | grep -v '<' | \ 247 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ 248 -e 's/\.c/$$O/' | \ 249 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ 250 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ 251 else rec = rec " " $$2 } } \ 252 END { print rec } ' > makedep 253 echo '$$r makedep' >>eddep 254 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep 255 echo '$$r makedep' >>eddep 256 echo 'w' >>eddep 257 -rm -f makefile.bak 258 cp makefile makefile.bak 259 ed - makefile < eddep 260 rm eddep makedep eddep.c 261 262# DO NOT DELETE THIS LINE 263 264telnet$O: ascii/termin.ext ctlr/screen.h ctlr/oia.h ctlr/options.ext 265telnet$O: ctlr/outbound.ext general/globals.h telnet.ext general/general.h 266