BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.bin / tn3270 / makefile
index d294bc9..2fc95a8 100644 (file)
@@ -1,17 +1,17 @@
+#      @(#)makefile    4.9 (Berkeley) 5/8/91
+
 # Makefile for tn3270 and friends...
 # Makefile for tn3270 and friends...
-# @(#)makefile 3.1  10/29/86
 #
 #
-#      This is the makefile for tn3270.  Note that we use ../telnet.c
+#      This is the makefile for tn3270.  Note that we use the 4.3+ telnet
 # (compiled with special options; see below) to provide the telnet
 # support we need.
 #
 #      The following are the defines that may be passed (via the cc
 # -D option) to the compiler.
 #
 # (compiled with special options; see below) to provide the telnet
 # support we need.
 #
 #      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
 #      TN3270          -       This is to be linked with tn3270.  Necessary
-#                              for creating tn3270.
+#                              for creating tn3270.  Only for compiling
+#                              telnet.
 #
 #      NOT43           -       Allows the program to compile and run on
 #                              a 4.2BSD system.
 #
 #      NOT43           -       Allows the program to compile and run on
 #                              a 4.2BSD system.
 #                              in the tty structure.
 #
 #
 #                              in the tty structure.
 #
 #
+#
+#      TERMCAP         -       Define this if your system is termcap based,
+#                              otherwise a terminfo based system is assumed.
+#
+#      SRCRT           -       Includes code to allow you to specify
+#                              source routes.
+#                              Format is:
+#                                      [!]@hop1@hop2...[@|:]dst
+#                              Leading ! means strict source route.
+#
+#      NOSTRNCASECMP   -       Define this if you do not have strncasecmp() in
+#                              your C libarary.
+#
+#      USE_TERMIO      -       Define this if you have System V termio
+#                              structures.  What is here is how things
+#                              are on Cray computers.
+#
+#      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
+#                              older systems.
+#
+#
 #      Here are some which are used throughout the system:
 #
 #      unix            -       Compiles in unix specific stuff.
 #      Here are some which are used throughout the system:
 #
 #      unix            -       Compiles in unix specific stuff.
@@ -81,9 +104,9 @@ RANLIB       = ranlib
 
 
 PRINT  = print
 
 
 PRINT  = print
-ACTION = sccs tell
+ACTION = @sccs tell
 
 
-DEFINES = ${LINT_ARGS}
+DEFINES= ${LINT_ARGS} -DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO
 
 INCLUDES = -I. -I..
 
 
 INCLUDES = -I. -I..
 
@@ -98,9 +121,9 @@ LINTFLAGS    = -hbxaz
 
 DESTDIR=
 
 
 DESTDIR=
 
-BINDIR         = $(DESTDIR)/usr/ucb
-ETCDIR         = $(DESTDIR)/etc
-MANDIR         = $(DESTDIR)/usr/man/man
+BINDIR         = $(DESTDIR)/usr/bin
+MAN1DIR                = $(DESTDIR)/usr/man/cat1
+MAN5DIR                = $(DESTDIR)/usr/man/cat5
 
 # Names for the terminal libraries...
 LIBCURSES      = -lcurses
 
 # Names for the terminal libraries...
 LIBCURSES      = -lcurses
@@ -110,31 +133,32 @@ LIBTERM           = -ltermlib
 #PC_LIBTERM    =
 
 # The source files...
 #PC_LIBTERM    =
 
 # The source files...
-ALLH = telnet.ext
+ALLH = telextrn.h
 
 
-TNMAIN = ../telnet.c
-TNMAIN = telnet.c
-MSMAIN = ascii/mset.c
+MSMAIN = ${.CURDIR}/ascii/mset.c
 
 
-ALLC = ${TNMAIN}
+ALLC =
 
 
-ALLO   = telnet$O mset$O
+ALLO   = mset$O
 
 
-ALLPRINT =     ${ALLH} ${ALLC}
+ALLHC= ${ALLH} ${ALLC}
+ALLPRINT =     ${ALLHC}
 
 
-ALLSOURCE =    ${ALLPRINT} makefile makefile.mak makefile_4.2 README
+ALLSOURCE =    ${ALLPRINT} makefile makefile.mak makefile_4.2 README \
+               mset.1 tn3270.1 map3270.5
 
 SYS    = sys_curses
 #PC_SYS        = sys_dos
 
 # The places where the various components live...
 
 
 SYS    = sys_curses
 #PC_SYS        = sys_dos
 
 # The places where the various components live...
 
-SUBDIR =       api ascii ctlr general ${SYS}
+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.
 
 
 # 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
+EXTRADIR =     ${.CURDIR}/tools
 
 # The libraries we use.  The order here is important.
 # syslib.a and ctlrlib.a should come first, then the rest.
 
 # The libraries we use.  The order here is important.
 # syslib.a and ctlrlib.a should come first, then the rest.
@@ -144,8 +168,8 @@ SUBLIB =    ${SYS}/syslib.a ctlr/ctlrlib.a \
 .s.o:
        /lib/cpp -E $< | as -o $@
 
 .s.o:
        /lib/cpp -E $< | as -o $@
 
-.c.obj:
-       ${CC} ${CFLAGS} -c $<
+#.c.obj:
+#      ${CC} ${CFLAGS} -c $<
 
 all:   FRC tn3270$X mset$X
 
 
 all:   FRC tn3270$X mset$X
 
@@ -153,47 +177,51 @@ FRC:
        for i in ${SUBDIR}; \
                do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done
 
        for i in ${SUBDIR}; \
                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)
+tn3270$X:      telnet/telprog.o ${SUBLIB} api/libapi.a
+       ${CC} ${CFLAGS} -o tn3270 telnet/telprog.o \
+               $L ${SUBLIB} api/libapi.a $(LIBCURSES) $(LIBTERM) \
+               -lcompat
 
 #PC_tn3270$X:
 #PC_   link <@<
 #PC_   telnet
 #PC_   tn3270
 #PC_   nul
 
 #PC_tn3270$X:
 #PC_   link <@<
 #PC_   telnet
 #PC_   tn3270
 #PC_   nul
-#PC_   ${SUBLIB} api/apilib.a+
+#PC_   ${SUBLIB} api/libapi.a+
 #PC_   \lib\ublib\ubtcp
 #PC_   _PC_<
 
 mset$X:        mset$O ascii/map3270$O
 #PC_   \lib\ublib\ubtcp
 #PC_   _PC_<
 
 mset$X:        mset$O ascii/map3270$O
-       ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a
-
-telnet$O:      $(TNMAIN)
-       $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN)
+       ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/libapi.a
 
 mset$O:        $(MSMAIN)
        $(CC) $(CFLAGS) -c $(MSMAIN)
 
 
 mset$O:        $(MSMAIN)
        $(CC) $(CFLAGS) -c $(MSMAIN)
 
-install:
-       install -s tn3270 $(BINDIR)
-       install -s mset $(BINDIR)
-       if [ ! -f ${ETCDIR}/map3270 ]; then \
-               install -c -m 444 map3270.dat ${ETCDIR}/map3270; \
-       fi
-#      install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1
-#      install -c -m 444 man/mset.1 $(MANDIR)1/mset.1
-#      install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5
+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)
 
 action:
        ${ACTION}
 
 
 action:
        ${ACTION}
 
+clist: ${ALLHC}
+       @for i in ${SUBDIR}; \
+               do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
+                                                           clist); done
+
+hclist:        ${ALLHC}
+       @for i in ${SUBDIR}; \
+               do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
+                                                           hclist); done
+
 everywhere:    action
        for i in ${SUBDIR} ${EXTRADIR}; \
                do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
                                                "ACTION=${ACTION}"); done
 
 everywhere:    action
        for i in ${SUBDIR} ${EXTRADIR}; \
                do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
                                                "ACTION=${ACTION}"); done
 
-clean:
+cleandir clean:
        for i in $(ALLO) mset tn3270 errs makefile.bak; \
                        do (${RM} $$i); done
        for i in ${SUBDIR} ${EXTRADIR}; \
        for i in $(ALLO) mset tn3270 errs makefile.bak; \
                        do (${RM} $$i); done
        for i in ${SUBDIR} ${EXTRADIR}; \
@@ -211,7 +239,7 @@ print:
                        do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
 
 tags:  ${ALLC} ${ALLH}
                        do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
 
 tags:  ${ALLC} ${ALLH}
-       ctags -t ${ALLC} ${ALLH}
+       ctags -t `make ${MFLAGS} hclist`
 
 sourcelist:    ${ALLSOURCE}
        @for i in ${ALLSOURCE}; \
 
 sourcelist:    ${ALLSOURCE}
        @for i in ${ALLSOURCE}; \
@@ -221,9 +249,12 @@ sourcelist:        ${ALLSOURCE}
                                                            sourcelist); done
 
 lint:
                                                            sourcelist); done
 
 lint:
-       lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
-                               ${TNMAIN} -lcurses
-       lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses
+       lint ${LINTFLAGS} -Itelnet ${INCLUDES} ${DEFINES} -DTN3270 \
+                               `make clist` -lcurses
+
+lintmset:
+       lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} \
+                               ascii/map3270.c -lcurses
 
 makefiles.pc:  tools/mkmake
        for i in . ${SUBDIR} ${EXTRADIR}; \
 
 makefiles.pc:  tools/mkmake
        for i in . ${SUBDIR} ${EXTRADIR}; \
@@ -261,5 +292,3 @@ thisdepend:
 
 # DO NOT DELETE THIS LINE
 
 
 # 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