BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / tn3270 / api / makefile
index 6d081d0..4e30b96 100644 (file)
@@ -1,33 +1,62 @@
-CFLAGS = -g
+#
+# 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.3 (Berkeley) 6/21/90
+#
+DEBUG_FLAGS = -g
+
+CFLAGS = -I obj ${DEBUG_FLAGS}
 
 PRINT = lpr -p
 
 KBD    = 3270pc.kbd
 KBD    = unix.kbd
 
 
 PRINT = lpr -p
 
 KBD    = 3270pc.kbd
 KBD    = unix.kbd
 
-ALLC = apilib.c api_bsd.c api_exch.c asc_ebc.c astosc.c dctype.c ebc_disp.c
+ALLC = apilib.c api_bsd.c api_exch.c asc_ebc.c astosc.c dctype.c \
+               disp_asc.c ebc_disp.c
 
 ALLH = apilib.h api_exch.h asc_ebc.h astosc.h disp_asc.h dctype.h ebc_disp.h
 
 
 ALLH = apilib.h api_exch.h asc_ebc.h astosc.h disp_asc.h dctype.h ebc_disp.h
 
-ALLPRINT = ${ALLH} ${ALLC}
+
+ALLHC= ${ALLH} ${ALLC}
+ALLPRINT =     ${ALLHC}
 
 ALLSOURCE = ${ALLPRINT} makefile makefile.mak
 
 
 ALLSOURCE = ${ALLPRINT} makefile makefile.mak
 
-ALLO = apilib.o api_bsd.o api_exch.o astosc.o asc_ebc.o disp_asc.o \
-               dctype.o ebc_disp.o
+ALLO = apilib.o api_bsd.o api_exch.o astosc.o asc_ebc.o dctype.o \
+               disp_asc.o ebc_disp.o
+
+#.c.obj:
+#      ${CC} ${CFLAGS} -c $<
 
 apilib.a: ${ALLO}
 
 apilib.a: ${ALLO}
-       @-/bin/rm -f $@
-       ar cr $@ ${ALLO}
-       ranlib $@
+       -rm $@
+       ${AR} ${ARFLAGS} $@ ${ALLO}
+       ${RANLIB} $@
 
 .DEFAULT:
        sccs get $<
 
 clean:
 
 .DEFAULT:
        sccs get $<
 
 clean:
-       -/bin/rm -f ${ALLO} errs apilib.a makefile.bak \
+       -rm ${ALLO} errs apilib.a makefile.bak \
                disp_out asc_disp.out astosc.out disp_asc.out \
                disp_out asc_disp.out astosc.out disp_asc.out \
+               astosc.OUT disp_asc.OUT \
                test* test.o t1* t1.o t2* t2.o
                test* test.o t1* t1.o t2* t2.o
+
+sccsclean:
        -sccs clean
        -sccs get makefile
 
        -sccs clean
        -sccs get makefile
 
@@ -46,39 +75,41 @@ t2: apilib.a t2.o
 print:
        ${PRINT} ${ALLPRINT}
 
 print:
        ${PRINT} ${ALLPRINT}
 
+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
 
 
 sourcelist:    ${ALLSOURCE}
        @for i in ${ALLSOURCE}; \
                do (echo ${DIRPATH}$$i); done
 
-astosc.out:    ../ctlr/function.h ../ctlr/hostctlr.h ../ctlr/$(KBD)
-       (cd ../tools; make mkastosc $(MFLAGS) )
-       -/bin/rm -f $@
-       ../tools/mkastosc < ../ctlr/$(KBD) > $@
+astosc.OUT:    ../ctlr/function.h ../ctlr/hostctlr.h ../ctlr/$(KBD)
+       (cd ${.CURDIR}/../tools; make mkastosc )
+       -rm $@ astosc.out
+       ../tools/mkastosc ${.CURDIR}/../ctlr/hostctlr.h \
+               ${.CURDIR}/../ctlr/function.h < \
+                               ${.CURDIR}/../ctlr/$(KBD) > $@
+       ln $@ astosc.out
 
 asc_disp.out:  ebc_disp.o
 
 asc_disp.out:  ebc_disp.o
-       (cd ../tools; make mkastods $(MFLAGS) )
-       -/bin/rm -f $@
+       (cd ${.CURDIR}/../tools; make mkastods )
+       -rm $@
        ../tools/mkastods > $@
 
        ../tools/mkastods > $@
 
-disp_asc.out:  ebc_disp.o
-       (cd ../tools; make mkdstoas $(MFLAGS) )
-       -/bin/rm -f $@
+disp_asc.OUT:  ebc_disp.o
+       (cd ${.CURDIR}/../tools; make mkdstoas )
+       -rm $@ disp_asc.out
        ../tools/mkdstoas > $@
        ../tools/mkdstoas > $@
-
-disp_asc.o:    disp_asc.h asc_disp.out disp_asc.out
-       -/bin/rm -f $@ TMPfunc.c
-       /bin/echo \#include \"disp_asc.h\" > TMPfunc.c
-       /bin/echo \#include \"asc_disp.out\" >> TMPfunc.c
-       /bin/echo \#include \"disp_asc.out\" >> TMPfunc.c
-       $(CC) $(CFLAGS) -c TMPfunc.c
-       -/bin/rm -f TMPfunc.c
-       -/bin/mv TMPfunc.o $@
+       ln $@ disp_asc.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 } } \
@@ -87,15 +118,17 @@ 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
        cp makefile makefile.bak
        ed - makefile < eddep
-       rm eddep makedep
+       -rm eddep makedep
 
 # DO NOT DELETE THIS LINE
 
 
 # DO NOT DELETE THIS LINE
 
-apilib.o: ../api/api.h apilib.h
-api_bsd.o: ../api/api.h api_exch.h
-api_exch.o: api_exch.h
+apilib.o: ../ctlr/api.h apilib.h
+api_bsd.o: ../ctlr/api.h api_exch.h
+api_exch.o: ../general/general.h api_exch.h
 asc_ebc.o: asc_ebc.h
 asc_ebc.o: asc_ebc.h
-astosc.o: ../general/general.h ../ctlr/function.h astosc.h astosc.out
+astosc.o: ../general/general.h ../ctlr/function.h astosc.h astosc.OUT
 dctype.o: dctype.h
 dctype.o: dctype.h
+disp_asc.o: disp_asc.h asc_disp.out disp_asc.OUT