xref: /csrg-svn/usr.bin/tn3270/makefile (revision 49416)
1*49416Sbostic#	@(#)makefile	4.9 (Berkeley) 05/08/91
234295Sminshall
330078Sminshall# Makefile for tn3270 and friends...
430078Sminshall#
534295Sminshall#	This is the makefile for tn3270.  Note that we use the 4.3+ telnet
630078Sminshall# (compiled with special options; see below) to provide the telnet
730078Sminshall# support we need.
830078Sminshall#
930078Sminshall#	The following are the defines that may be passed (via the cc
1030078Sminshall# -D option) to the compiler.
1130078Sminshall#
1230078Sminshall#	TN3270		- 	This is to be linked with tn3270.  Necessary
1334295Sminshall#				for creating tn3270.  Only for compiling
1434295Sminshall#				telnet.
1530078Sminshall#
1630078Sminshall#	NOT43		-	Allows the program to compile and run on
1730078Sminshall#				a 4.2BSD system.
1830078Sminshall#
1930078Sminshall#	PUTCHAR		-	Within tn3270, on a NOT43 system,
2030078Sminshall#				allows the use of the 4.3 curses
2130078Sminshall#				(greater speed updating the screen).
2230078Sminshall#				You need the 4.3 curses for this to work.
2330078Sminshall#
2430078Sminshall#	FD_SETSIZE	-	On whichever system, if this isn't defined,
2530078Sminshall#				we patch over the FD_SET, etc., macros with
2630078Sminshall#				some homebrewed ones.
2730078Sminshall#
2830078Sminshall#	SO_OOBINLINE	-	This is a socket option which we would like
2930078Sminshall#				to set to allow TCP urgent data to come
3030078Sminshall#				to us "inline".  This is NECESSARY for
3130078Sminshall#				CORRECT operation, and desireable for
3230078Sminshall#				simpler operation.
3330078Sminshall#
3430078Sminshall#	LNOFLSH		-	Detects the presence of the LNOFLSH bit
3530078Sminshall#				in the tty structure.
3630078Sminshall#
3730078Sminshall#
3838919Sminshall#
3938919Sminshall#	TERMCAP		-	Define this if your system is termcap based,
4038919Sminshall#				otherwise a terminfo based system is assumed.
4138919Sminshall#
4238919Sminshall#	SRCRT		-	Includes code to allow you to specify
4338919Sminshall#				source routes.
4438919Sminshall#				Format is:
4538919Sminshall#					[!]@hop1@hop2...[@|:]dst
4638919Sminshall#				Leading ! means strict source route.
4738919Sminshall#
4838919Sminshall#	NOSTRNCASECMP	-	Define this if you do not have strncasecmp() in
4938919Sminshall#				your C libarary.
5038919Sminshall#
5138919Sminshall#	USE_TERMIO	-	Define this if you have System V termio
5238919Sminshall#				structures.  What is here is how things
5338919Sminshall#				are on Cray computers.
5438919Sminshall#
5538919Sminshall#	KLUDGELINEMODE	-	Define this to get the kludged up version
5638919Sminshall#				of linemode that was in 4.3BSD.  This is a
5738919Sminshall#				good thing to have around for talking to
5838919Sminshall#				older systems.
5938919Sminshall#
6038919Sminshall#
6130078Sminshall#	Here are some which are used throughout the system:
6230078Sminshall#
6330078Sminshall#	unix		-	Compiles in unix specific stuff.
6430078Sminshall#
6530078Sminshall#	msdos		-	Compiles in msdos specific stuff.
6630078Sminshall#
6730078Sminshall
6831724Sminshall# msdos versus unix defines
6931724SminshallO	= .o
7031768Sminshall#PC_O	= .obj
7131724Sminshall
7231724SminshallX	=
7331768Sminshall#PC_X	= .exe
7431724Sminshall
7531768SminshallL	=
7631768Sminshall#PC_L	= -link
7731768Sminshall
7830078SminshallCC	= cc
7931768Sminshall#PC_CC	= cl
8031739Sminshall
8131739SminshallMV	= mv
8231768Sminshall#PC_MV	= rename
8331739Sminshall
8431739SminshallRM	= rm -f
8531768Sminshall#PC_RM= erase
8631739Sminshall
8731739SminshallLINT_ARGS =
8831768Sminshall#PC_LINT_ARGS = -DLINT_ARGS
8931739Sminshall
9031739SminshallDEBUG_FLAGS = -g
9131768Sminshall#PC_DEBUG_FLAGS = -Zi -Od
9231739Sminshall
9331739SminshallAR	= ar
9431768SminshallAR1	= cr
9531768SminshallAR2	=
9631768SminshallAR3	=
9731768Sminshall#PC_AR	= lib
9831768Sminshall#PC_AR1	=
9931768Sminshall#PC_AR2	= +
10031768Sminshall#PC_AR3	= ";"
10131739Sminshall
10231739SminshallRANLIB	= ranlib
10331768Sminshall#PC_RANLIB = echo "Done with "
10431739Sminshall
10531739Sminshall
10630078SminshallPRINT	= print
10734295SminshallACTION = @sccs tell
10830078Sminshall
10940246SbormanDEFINES= ${LINT_ARGS} -DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO
11030078Sminshall
11130723SminshallINCLUDES = -I. -I..
11230078Sminshall
11330078SminshallOPTIMIZE = -O
11431739SminshallOPTIMIZE = ${DEBUG_FLAGS}
11530078Sminshall
11630078SminshallCFLAGS	= $(OPTIMIZE) $(INCLUDES) $(DEFINES)
11730078Sminshall
11830078Sminshall# Lint flags
11930078SminshallLINTFLAGS	= -hbxaz
12030078Sminshall# How to install the bloody thing...
12130078Sminshall
12230078SminshallDESTDIR=
12330078Sminshall
12438626SbosticBINDIR		= $(DESTDIR)/usr/bin
12536181SminshallMAN1DIR		= $(DESTDIR)/usr/man/cat1
12636181SminshallMAN5DIR		= $(DESTDIR)/usr/man/cat5
12730078Sminshall
12830078Sminshall# Names for the terminal libraries...
12930078SminshallLIBCURSES	= -lcurses
13030078SminshallLIBTERM		= -ltermlib
13130078Sminshall
13231768Sminshall#PC_LIBCURSES	=
13331768Sminshall#PC_LIBTERM	=
13431768Sminshall
13530078Sminshall# The source files...
13636181SminshallALLH =	telextrn.h
13730078Sminshall
13842931SbormanMSMAIN = ${.CURDIR}/ascii/mset.c
13930078Sminshall
14034295SminshallALLC =
14131480Sminshall
14234295SminshallALLO	= mset$O
14331480Sminshall
14434295SminshallALLHC=	${ALLH} ${ALLC}
14534295SminshallALLPRINT =	${ALLHC}
14631480Sminshall
14736181SminshallALLSOURCE =	${ALLPRINT} makefile makefile.mak makefile_4.2 README \
14836181Sminshall		mset.1 tn3270.1 map3270.5
14931480Sminshall
15031768SminshallSYS	= sys_curses
15131768Sminshall#PC_SYS	= sys_dos
15231739Sminshall
15330078Sminshall# The places where the various components live...
15430078Sminshall
15542931SbormanSUBDIR =	${.CURDIR}/api ${.CURDIR}/ascii ${.CURDIR}/ctlr \
15642931Sborman		${.CURDIR}/general ${.CURDIR}/${SYS} ${.CURDIR}/telnet
15731547Sminshall
15831480Sminshall# The following are directories we don't do regular make's in, but
15931480Sminshall# we do make everywhere, print, and sourcelist in.
16031480Sminshall
16142931SbormanEXTRADIR =	${.CURDIR}/tools
16231547Sminshall
16331477Sminshall# The libraries we use.  The order here is important.
16431899Sminshall# syslib.a and ctlrlib.a should come first, then the rest.
16531899SminshallSUBLIB =	${SYS}/syslib.a ctlr/ctlrlib.a \
16631624Sminshall		ascii/asciilib.a general/generallib.a
16730078Sminshall
16830078Sminshall.s.o:
16930078Sminshall	/lib/cpp -E $< | as -o $@
17030078Sminshall
17142931Sborman#.c.obj:
17242931Sborman#	${CC} ${CFLAGS} -c $<
17331739Sminshall
17431724Sminshallall:	FRC tn3270$X mset$X
17530078Sminshall
17630078SminshallFRC:
17731591Sminshall	for i in ${SUBDIR}; \
17831591Sminshall		do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done
17930078Sminshall
18048710Sminshalltn3270$X:	telnet/telprog.o ${SUBLIB} api/libapi.a
18134306Sminshall	${CC} ${CFLAGS} -o tn3270 telnet/telprog.o \
18248710Sminshall		$L ${SUBLIB} api/libapi.a $(LIBCURSES) $(LIBTERM) \
18338277Sminshall		-lcompat
18430078Sminshall
18531768Sminshall#PC_tn3270$X:
18631769Sminshall#PC_	link <@<
18731769Sminshall#PC_	telnet
18831805Sminshall#PC_	tn3270
18931769Sminshall#PC_	nul
19048710Sminshall#PC_	${SUBLIB} api/libapi.a+
19131769Sminshall#PC_	\lib\ublib\ubtcp
19231769Sminshall#PC_	_PC_<
19331768Sminshall
19431724Sminshallmset$X:	mset$O ascii/map3270$O
19548710Sminshall	${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/libapi.a
19630078Sminshall
19731724Sminshallmset$O:	$(MSMAIN)
19830078Sminshall	$(CC) $(CFLAGS) -c $(MSMAIN)
19930078Sminshall
20036181Sminshallinstall:	tn3270$X mset$X tn3270.0 mset.0 map3270.0
20132057Sminshall	install -m 755 -o bin -g bin -s tn3270 $(BINDIR)
20232057Sminshall	install -m 755 -o bin -g bin -s mset $(BINDIR)
20336181Sminshall	install -c -o bin -g bin -m 444 tn3270.0 mset.0 $(MAN1DIR)
20436181Sminshall	install -c -o bin -g bin -m 444 map3270.0 $(MAN5DIR)
20530078Sminshall
20631069Sminshallaction:
20731069Sminshall	${ACTION}
20831069Sminshall
20934295Sminshallclist:	${ALLHC}
21034295Sminshall	@for i in ${SUBDIR}; \
21134295Sminshall		do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
21234295Sminshall							    clist); done
21334295Sminshall
21434295Sminshallhclist:	${ALLHC}
21534295Sminshall	@for i in ${SUBDIR}; \
21634295Sminshall		do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
21734295Sminshall							    hclist); done
21834295Sminshall
21931480Sminshalleverywhere:	action
22031480Sminshall	for i in ${SUBDIR} ${EXTRADIR}; \
22131480Sminshall		do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
22231480Sminshall						"ACTION=${ACTION}"); done
22331069Sminshall
22437066Sbosticcleandir clean:
22531739Sminshall	for i in $(ALLO) mset tn3270 errs makefile.bak; \
22631739Sminshall			do (${RM} $$i); done
22731739Sminshall	for i in ${SUBDIR} ${EXTRADIR}; \
22831739Sminshall			do (cd $$i; make ${MFLAGS} clean); done
22931739Sminshall
23031739Sminshallsccsclean:
23131624Sminshall	-sccs clean
23231624Sminshall	-sccs get makefile
23331739Sminshall	for i in ${SUBDIR} ${EXTRADIR}; \
23431739Sminshall			do (cd $$i; make ${MFLAGS} sccsclean); done
23530078Sminshall
23630078Sminshallprint:
23731480Sminshall	${PRINT} ${ALLPRINT}
23831480Sminshall	for i in ${SUBDIR} ${EXTRADIR}; \
23930078Sminshall			do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
24030078Sminshall
24130078Sminshalltags:	${ALLC} ${ALLH}
24234295Sminshall	ctags -t `make ${MFLAGS} hclist`
24330078Sminshall
24431483Sminshallsourcelist:	${ALLSOURCE}
24531483Sminshall	@for i in ${ALLSOURCE}; \
24631624Sminshall		do (echo ${DIRPATH}$$i); done
24731483Sminshall	@for i in ${SUBDIR} ${EXTRADIR}; \
24831624Sminshall		do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
24931480Sminshall							    sourcelist); done
25031480Sminshall
25130078Sminshalllint:
25236181Sminshall	lint ${LINTFLAGS} -Itelnet ${INCLUDES} ${DEFINES} -DTN3270 \
25334295Sminshall				`make clist` -lcurses
25430078Sminshall
25534295Sminshalllintmset:
25634295Sminshall	lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} \
25734295Sminshall				ascii/map3270.c -lcurses
25834295Sminshall
25931769Sminshallmakefiles.pc:	tools/mkmake
26031724Sminshall	for i in . ${SUBDIR} ${EXTRADIR}; \
26131768Sminshall	do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \
26231769Sminshall		./tools/mkmake | \
26331768Sminshall		sed -e "sx/x\\\\xg" -e "s/[ 	]*_PC_//" > $$i/makefile.mak); \
26431724Sminshall	    done
26531724Sminshall
26631769Sminshalltools/mkmake:
26731769Sminshall	(cd tools; make mkmake)
26831769Sminshall
26930078Sminshall.DEFAULT:
27030078Sminshall	sccs get $<
27130078Sminshall
27230078Sminshalldepend:	thisdepend
27330078Sminshall	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
27430078Sminshall
27530078Sminshallthisdepend:
27631724Sminshall	echo > eddep.c
27731724Sminshall	grep '^#include' ${ALLC} eddep.c | grep -v '<' | \
27830078Sminshall	sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
27931724Sminshall	    -e 's/\.c/$$O/' | \
28030078Sminshall	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
28130078Sminshall		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
28230078Sminshall		       else rec = rec " " $$2 } } \
28330078Sminshall	      END { print rec } ' > makedep
28430078Sminshall	echo '$$r makedep' >>eddep
28530078Sminshall	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
28630078Sminshall	echo '$$r makedep' >>eddep
28730078Sminshall	echo 'w' >>eddep
28831739Sminshall	-rm -f makefile.bak
28930078Sminshall	cp makefile makefile.bak
29030078Sminshall	ed - makefile < eddep
29131724Sminshall	rm eddep makedep eddep.c
29230078Sminshall
29330078Sminshall# DO NOT DELETE THIS LINE
29430078Sminshall
295