delete mention of ^Y; currently don't allow ^Y or ^E.
[unix-history] / usr / src / usr.bin / pascal / pdx / Makefile
index 85dfef1..da51d18 100644 (file)
@@ -1,6 +1,8 @@
-#/* Copyright (c) 1982 Regents of the University of California */
+# Copyright (c) 1982 Regents of the University of California.
+# All rights reserved.  The Berkeley software License Agreement
+# specifies the terms and conditions for redistribution.
 #
 #
-# static char sccsid[] = "@(#)Makefile 1.4 %G%";
+#      @(#)Makefile    1.19 (Berkeley) %G%
 #
 # make file for pdx
 #
 #
 # make file for pdx
 #
 # declarations (since you can't have forward type references in C).
 # It also defines various things of general use and includes <stdio.h>.
 #
 # declarations (since you can't have forward type references in C).
 # It also defines various things of general use and includes <stdio.h>.
 #
-# The subdirectory "library" contains routines which are generally useful
-# and are independent from pdx.  These are compiled into a separate archive
-# and they must be made independently from pdx.
+# The file "library.c" contains routines which are generally useful
+# and are independent from pdx.
 #
 #
-# N.B.: My version of cerror automatically catches certain erros
+# N.B.: My version of cerror in "cerror.s" automatically catches certain errors
 #      such as out of memory, I/O error.  If you re-make pdx with
 #      the standard cerror, the program could fault unexpectedly.
 #
 #      such as out of memory, I/O error.  If you re-make pdx with
 #      the standard cerror, the program could fault unexpectedly.
 #
 #      to touch the C files that include it.
 #
 
 #      to touch the C files that include it.
 #
 
-HOME   = /usr/src/cmd/pdx
-LIB            = ${HOME}/library/pdxlib
-PASCAL = /usr/src/cmd/pascal/
-INSTALL        = /usr/ucb/pdx
+DESTDIR        =
+HOME   = /usr/src/ucb/pdx
+LIB    = library.o cerror.o
+SRCDIR = ../src/
+INSTALL        = ${DESTDIR}/usr/ucb/pdx
 
 
-#
-# LDFLAGS should be -i for pdp-11
-#
-
-CFLAGS = -Disvaxpx -I.. -I${PASCAL} -DOBJ -DVAX -O
-LDFLAGS        =
-
-#
-# Regardless of what CFLAGS is, the file "compile.csh" controls
-# how compilation is done for the majority of the source files.
-#
+RM     = /bin/rm -f
+CFLAGS = -I.. -I../${SRCDIR} -DOBJ -DADDR32 -O
+LINTFLAGS= -I. -I${SRCDIR} -DOBJ -DADDR32
+LDFLAGS        = # -i for pdp-11
 
 .c.o:
        @echo "compiling $*.c"
 
 .c.o:
        @echo "compiling $*.c"
-       @csh -f compile.csh $*.c
+       @csh -f -c ' \
+           set a=$*.c; \
+           if ($$a:h != $$a) cd $$a:h; \
+           ${CC} ${CFLAGS} -c $$a:t \
+       '
 
 #
 # source directory specifications
 
 #
 # source directory specifications
@@ -53,7 +52,7 @@ SYMTAB                = symtab/
 SOURCE         = source/
 COMMAND                = command/
 TREE           = tree/
 SOURCE         = source/
 COMMAND                = command/
 TREE           = tree/
-SYM                    = sym/
+SYM            = sym/
 BREAKPOINT     = breakpoint/
 RUNTIME                = runtime/
 OBJECT         = object/
 BREAKPOINT     = breakpoint/
 RUNTIME                = runtime/
 OBJECT         = object/
@@ -101,8 +100,7 @@ MACHOBJ =\
        ${MACHINE}optab.o\
        ${MACHINE}printdata.o\
        ${MACHINE}printerror.o\
        ${MACHINE}optab.o\
        ${MACHINE}printdata.o\
        ${MACHINE}printerror.o\
-       ${MACHINE}printinst.o\
-       ${MACHINE}pxerrors.o
+       ${MACHINE}printinst.o
 
 PROCOBJ =\
        ${PROCESS}runcont.o\
 
 PROCOBJ =\
        ${PROCESS}runcont.o\
@@ -147,7 +145,7 @@ OBJS =\
        ${PROCOBJ}\
        ${MACHOBJ}
 
        ${PROCOBJ}\
        ${MACHOBJ}
 
-a.out: ${OBJS}
+a.out: ${OBJS} ${LIB}
        @echo "linking"
        @cc ${LDFLAGS} ${OBJS} ${LIB}
 
        @echo "linking"
        @cc ${LDFLAGS} ${OBJS} ${LIB}
 
@@ -155,13 +153,22 @@ profile: ${OBJS}
        @echo "linking with -p"
        @cc ${LDFLAGS} -p ${OBJS} ${LIB}
 
        @echo "linking with -p"
        @cc ${LDFLAGS} -p ${OBJS} ${LIB}
 
+lint:
+       @cd ${COMMAND}; yacc -d grammar.yacc; lex token.lex
+       -@lint ${LINTFLAGS} `echo ${OBJS} library.c | sed 's/\.o/.c/g'`
+       @${RM} ${COMMAND}lex.yy.c ${COMMAND}y.tab.c
+
+cerror.o:
+       @echo "assembling `machine`/$*.s"
+       @cc -c `machine`/$*.s
+
 ${COMMAND}y.tab.o: ${COMMAND}grammar.yacc
 ${COMMAND}y.tab.o: ${COMMAND}grammar.yacc
-       chdir ${COMMAND}; yacc -d grammar.yacc; cc -c ${CFLAGS} y.tab.c
-       rm ${COMMAND}y.tab.c
+       cd ${COMMAND}; yacc -d grammar.yacc; cc -c ${CFLAGS} y.tab.c
+       ${RM} ${COMMAND}y.tab.c
 
 ${COMMAND}lex.yy.o: ${COMMAND}token.lex ${COMMAND}y.tab.h
 
 ${COMMAND}lex.yy.o: ${COMMAND}token.lex ${COMMAND}y.tab.h
-       chdir ${COMMAND}; lex token.lex; cc -c ${CFLAGS} lex.yy.c
-       rm ${COMMAND}lex.yy.c
+       cd ${COMMAND}; lex token.lex; cc -c ${CFLAGS} lex.yy.c
+       ${RM} ${COMMAND}lex.yy.c
 
 ${BPOBJ}:      ${BREAKPOINT}bp.rep
 ${RUNTIMEOBJ}: ${RUNTIME}frame.rep
 
 ${BPOBJ}:      ${BREAKPOINT}bp.rep
 ${RUNTIMEOBJ}: ${RUNTIME}frame.rep
@@ -169,7 +176,20 @@ ${PROCOBJ}:        ${PROCESS}process.rep
 ${SYMOBJ}:     ${SYM}sym.rep
 ${TREEOBJ}:    ${TREE}tree.rep
 ${OBJOBJ}:     ${OBJECT}objsym.rep
 ${SYMOBJ}:     ${SYM}sym.rep
 ${TREEOBJ}:    ${TREE}tree.rep
 ${OBJOBJ}:     ${OBJECT}objsym.rep
-${OBJECT}readobj.o ${OBJECT}readsym.o: ${PASCAL}objfmt.h
+${OBJECT}readobj.o ${OBJECT}readsym.o: ${SRCDIR}objfmt.h
+
+install: a.out
+       install -s a.out ${INSTALL}
+
+clean:
+       ${RM} a.out *.o */*.o
+
+depend:
+
+#
+# Warning:  This will produce a very long listing.  You would be better
+#           off just looking at things on-line.
+#
 
 
-install:
-       mv a.out ${INSTALL}
+print:
+       pr *.h [a-z]*/*.{h,rep,yacc,lex,c}