add Berkeley specific header
[unix-history] / usr / src / usr.bin / tn3270 / ctlr / makefile
index 1f2c93a..2f131d5 100644 (file)
@@ -1,12 +1,61 @@
+#
+# Copyright (c) 1988 Regents of the University of California.
+# All rights reserved.
+#
+# 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.2 (Berkeley) %G%
+#
+# msdos versus unix defines
+O      = .o
+#PC_O  = .obj
+
+X      =
+#PC_X  = .exe
+
+L      =
+#PC_L  = -link
+
 CC     = cc
 CC     = cc
+#PC_CC = cl
+
+MV     = mv
+#PC_MV = rename
+
+RM     = rm -f
+#PC_RM= erase
+
+LINT_ARGS =
+#PC_LINT_ARGS = -DLINT_ARGS
+
+DEBUG_FLAGS = -g
+#PC_DEBUG_FLAGS = -Zi -Od
+
+AR     = ar
+AR1    = cr
+AR2    =
+AR3    =
+#PC_AR = lib
+#PC_AR1        =
+#PC_AR2        = +
+#PC_AR3        = ";"
+
+RANLIB = ranlib
+#PC_RANLIB = echo "Done with "
+
 PRINT  = print
 
 PRINT  = print
 
-DEFINES =
+DEFINES = ${LINT_ARGS}
 
 INCLUDES = -I.
 
 OPTIMIZE = -O
 
 INCLUDES = -I.
 
 OPTIMIZE = -O
-OPTIMIZE = -g
+OPTIMIZE = ${DEBUG_FLAGS}
 
 CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
 
 
 CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
 
@@ -19,12 +68,13 @@ KBD = 3270pc.kbd
 KBD    = unix.kbd
 
 # The source files...
 KBD    = unix.kbd
 
 # The source files...
-ALLH = dctype.h ebc_disp.h function.h hostctlr.h inbound.ext oia.h \
+ALLH = api.h function.h hostctlr.h inbound.ext oia.h \
        options.ext options.h outbound.ext screen.h scrnctlr.h
 
        options.ext options.h outbound.ext screen.h scrnctlr.h
 
-ALLC = dctype.c ebc_disp.c inbound.c oia.c options.c outbound.c
+ALLC = api.c function.c inbound.c oia.c options.c outbound.c
 
 
-ALLO = dctype.o ebc_disp.o inbound.o oia.o options.o outbound.o
+# Note: NO function.o!
+ALLO = api$O inbound$O oia$O options$O outbound$O
 
 ALLPRINT =     3180.kbd 3270pc.kbd unix.kbd ${ALLH} ${ALLC}
 
 
 ALLPRINT =     3180.kbd 3270pc.kbd unix.kbd ${ALLH} ${ALLC}
 
@@ -33,17 +83,26 @@ ALLSOURCE = ${ALLPRINT} makefile makefile.mak
 .s.o:
        /lib/cpp -E $< | as -o $@
 
 .s.o:
        /lib/cpp -E $< | as -o $@
 
-ctlr.lib:      ${ALLO}
-       ar cr ctlr.lib ${ALLO}
-       ranlib ctlr.lib
+.c.obj:
+       ${CC} ${CFLAGS} -c $<
+
+ctlrlib.a:     ${ALLO}
+       ${RM} $@
+       for i in ${ALLO}; do (${AR} ${AR1} $@ ${AR2} $$i${AR3}); done
+       ${RANLIB} $@
 
 clean:
 
 clean:
-       rm -f $(ALLO) mset tn3270 prt3270 m4.out errs makefile.bak ctlr.lib
-       rm -f kbd.out TMPfunc.out TMPfunc.c
+       for i in $(ALLO) mset tn3270 prt3270 m4.out errs \
+               makefile.bak ctlrlib.a kbd.out TMPfunc.out; \
+                       do (${RM} $$i); done
+
+sccsclean:
+       -sccs clean
+       -sccs get makefile
 
 sourcelist:    ${ALLSOURCE}
        @for i in ${ALLSOURCE}; \
 
 sourcelist:    ${ALLSOURCE}
        @for i in ${ALLSOURCE}; \
-               do (echo ${DIRPATH}/$$i); done
+               do (echo ${DIRPATH}$$i); done
 
 print:
        ${PRINT} ${ALLPRINT}
 
 print:
        ${PRINT} ${ALLPRINT}
@@ -61,17 +120,16 @@ lint:
        sccs get $<
 
 kbd.out:       $(KBD) hostctlr.h
        sccs get $<
 
 kbd.out:       $(KBD) hostctlr.h
-       (cd ../tools; make mkhits $(MFLAGS) )
-       -/bin/rm $@ TMPfunc.out TMPfunc.c
-       /bin/echo \#include \"function.h\" > TMPfunc.c
-       $(CC) $(CFLAGS) -E TMPfunc.c > TMPfunc.out
+       (cd ../tools; make mkhits$X )
+       ${RM} $@ TMPfunc.out
+       $(CC) $(CFLAGS) -E function.c > TMPfunc.out
        ../tools/mkhits - ../ctlr/TMPfunc.out < $(KBD) > $@
        ../tools/mkhits - ../ctlr/TMPfunc.out < $(KBD) > $@
-       -/bin/rm TMPfunc.out TMPfunc.c
+       ${RM} TMPfunc.out
 
 depend:
        grep '^#include' ${ALLC} | grep -v '<' | \
        sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
 
 depend:
        grep '^#include' ${ALLC} | grep -v '<' | \
        sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
-           -e 's/\.c/.o/' | \
+           -e 's/\.c/$$O/' | \
        awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
                else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
                       else rec = rec " " $$2 } } \
        awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
                else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
                       else rec = rec " " $$2 } } \
@@ -80,18 +138,21 @@ depend:
        echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
        echo '$$r makedep' >>eddep
        echo 'w' >>eddep
        echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
        echo '$$r makedep' >>eddep
        echo 'w' >>eddep
+       -rm -f makefile.bak
        cp makefile makefile.bak
        ed - makefile < eddep
        rm eddep makedep
 
 # DO NOT DELETE THIS LINE
 
        cp makefile makefile.bak
        ed - makefile < eddep
        rm eddep makedep
 
 # DO NOT DELETE THIS LINE
 
-dctype.o: dctype.h
-inbound.o: ../general/general.h function.h hostctlr.h oia.h scrnctlr.h screen.h
-inbound.o: options.h dctype.h ebc_disp.h ../general/globals.h inbound.ext
-inbound.o: outbound.ext ../telnet.ext kbd.out
-oia.o: ../general/general.h oia.h ../general/globals.h
-options.o: options.h ../general/globals.h options.ext
-outbound.o: ../general/general.h hostctlr.h oia.h screen.h ebc_disp.h
-outbound.o: ../general/globals.h options.ext ../telnet.ext inbound.ext
-outbound.o: outbound.ext ../general/bsubs.ext
+api$O: api.h ../general/general.h ../api/disp_asc.h screen.h oia.h
+api$O: ../general/globals.h
+function$O: function.h
+inbound$O: ../general/general.h function.h hostctlr.h oia.h scrnctlr.h screen.h
+inbound$O: options.h ../api/dctype.h ../api/ebc_disp.h ../general/globals.h
+inbound$O: inbound.ext outbound.ext ../telnet.ext kbd.out
+oia$O: ../general/general.h oia.h ../general/globals.h
+options$O: options.h ../general/globals.h options.ext
+outbound$O: ../general/general.h hostctlr.h oia.h screen.h ../api/ebc_disp.h
+outbound$O: ../general/globals.h options.ext ../telnet.ext inbound.ext
+outbound$O: outbound.ext ../general/bsubs.ext