Release 4.1
[unix-history] / usr / src / usr.bin / tn3270 / ascii / makefile
index 1aa4a20..2b097b1 100644 (file)
@@ -1,12 +1,66 @@
+#
+# Copyright (c) 1988 Regents of the University of California.
+# All rights reserved.
+#
+# 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) %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)
 
@@ -17,29 +71,53 @@ KBD = 3270pc.kbd
 KBD    = unix.kbd
 
 
 KBD    = unix.kbd
 
 
+# The source files...
+ALLH = map3270.h state.h
 
 
+ALLC = map3270.c mset.c termin.c
 
 
-# The source files...
-ALLH = state.h ascebc.h
+# We don't include mset$O here...
+ALLO   = map3270$O termin$O
 
 
-ALLC = map3270.c termin.c asctab.c ebctab.c
 
 
-ALLO   = map3270.o termin.o asctab.o ebctab.o
+ALLHC= ${ALLH} ${ALLC}
+ALLPRINT =     default.map ${ALLHC}
 
 
-M4FILE = termcodes.m4
+ALLSOURCE =    ${ALLPRINT} makefile makefile.mak
 
 .s.o:
        /lib/cpp -E $< | as -o $@
 
 
 .s.o:
        /lib/cpp -E $< | as -o $@
 
-ascii.lib:     $(ALLO)
-       ar cr ascii.lib $(ALLO)
-       ranlib ascii.lib
+.c.obj:
+       ${CC} ${CFLAGS} -c $<
+
+asciilib.a:    $(ALLO)
+       ${RM} $@
+       for i in ${ALLO}; do (${AR} ${AR1} $@ ${AR2} $$i${AR3}); done
+       ${RANLIB} $@
 
 clean:
 
 clean:
-       rm -f $(ALLO) m4.out astosc.out errs makefile.bak ascii.lib
+       for i in $(ALLO) errs makefile.bak asciilib.a; \
+               do (${RM} $$i); done
+
+sccsclean:
+       -sccs clean
+       -sccs get makefile
+
+clist: ${ALLC}
+       @for i in ${ALLC} ; \
+               do (echo ${DIRPATH}$$i); done
+
+hclist:        ${ALLHC}
+       @for i in ${ALLHC} ; \
+               do (echo ${DIRPATH}$$i); done
+
+sourcelist:    ${ALLSOURCE}
+       @for i in ${ALLSOURCE}; \
+               do (echo ${DIRPATH}$$i); done
 
 print:
 
 print:
-       ${PRINT} ${ALLH} ${ALLC}
+       ${PRINT} ${ALLPRINT}
 
 tags:  ${ALLC} ${ALLH}
        ctags -t ${ALLC} ${ALLH}
 
 tags:  ${ALLC} ${ALLH}
        ctags -t ${ALLC} ${ALLH}
@@ -53,20 +131,10 @@ lint:
 .DEFAULT:
        sccs get $<
 
 .DEFAULT:
        sccs get $<
 
-astosc.out:    ../ctlr/function.h ../ctlr/hostctlr.h ../ctlr/$(KBD) m4.out
-       (cd ../tools; make mkastosc $(MFLAGS) )
-       -/bin/rm $@
-       ../tools/mkastosc < ../ctlr/$(KBD) > $@
-
-m4.out:                termcodes.m4
-       /bin/rm -f m4.out
-       m4 termcodes.m4 > m4.out
-       /bin/chmod 444 m4.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 } } \
@@ -75,15 +143,15 @@ 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
 
-map3270.o: m4.out state.h ../general/globals.h map3270.ext default.map
-termin.o: ../general/general.h m4.out state.h ../general/globals.h
-termin.o: ../ctlr/function.h ../ctlr/inbound.ext ../ctlr/outbound.ext
-termin.o: ../telnet.ext termin.ext astosc.out
-asctab.o: ascebc.h
-ebctab.o: ascebc.h
+map3270$O: state.h map3270.h ../general/globals.h default.map
+mset$O: ../ctlr/function.h state.h map3270.h ../api/astosc.h
+mset$O: ../general/globals.h
+termin$O: ../general/general.h ../ctlr/function.h ../ctlr/externs.h
+termin$O: ../ctlr/declare.h ../api/astosc.h state.h ../general/globals.h