| 1 | # |
| 2 | # Copyright (c) 1980 Regents of the University of California. |
| 3 | # All rights reserved. The Berkeley software License Agreement |
| 4 | # specifies the terms and conditions for redistribution. |
| 5 | # |
| 6 | # @(#)Makefile 5.7 (Berkeley) %G% |
| 7 | # |
| 8 | SCCSID = "@(#)Makefile 5.7 %G%" |
| 9 | |
| 10 | DESTDIR = |
| 11 | BINDIR = /usr/bin |
| 12 | LIBDIR = /usr/lib |
| 13 | SRCDIR = ../src |
| 14 | LIBPCDIR = ../../../lib/libpc |
| 15 | CC = cc |
| 16 | CFLAGS = -O ${INCLUDES} |
| 17 | INCLUDES = -I${SRCDIR} -I${LIBPCDIR} |
| 18 | LINTFLAGS = -hbxc |
| 19 | RM = rm -f |
| 20 | |
| 21 | PSHDR = opc.c pic.c |
| 22 | |
| 23 | PXHDR = vars.h machdep.h |
| 24 | |
| 25 | PXSRC = int.c interp.c utilities.c |
| 26 | |
| 27 | PXOBJ = int.o interp.o utilities.o |
| 28 | |
| 29 | PXUTL = version.c |
| 30 | |
| 31 | .c.o: |
| 32 | ${CC} ${CFLAGS} -c $*.c |
| 33 | |
| 34 | all px: Version.c ${PXOBJ} |
| 35 | ${CC} ${CFLAGS} -o px Version.c ${PXOBJ} -lpc -lm |
| 36 | |
| 37 | lint: Version.c ${PXSRC} |
| 38 | lint ${LINTFLAGS} ${INCLUDES} Version.c ${PXSRC} -lpc -lm |
| 39 | |
| 40 | Version.c: version.c |
| 41 | ${CC} ${CFLAGS} -o version version.c |
| 42 | ./version >Version.c |
| 43 | ${RM} version |
| 44 | |
| 45 | h02opcs.h: ${SRCDIR}/OPnames.h opc.c |
| 46 | ${CC} ${CFLAGS} opc.c -o opc |
| 47 | ./opc >h02opcs.h |
| 48 | ${RM} opc |
| 49 | |
| 50 | install: px |
| 51 | install -s px ${DESTDIR}/usr/bin/px |
| 52 | |
| 53 | sources: ${PXHDR} ${PXSRC} ${PXUTL} |
| 54 | ${PSHDR}: |
| 55 | ln -s ${SRCDIR}/$@ $@ |
| 56 | |
| 57 | cleandir clean: |
| 58 | ${RM} *.o *.s px version opc* pic* |
| 59 | ${RM} h02opcs.h errs lpr core tmp |
| 60 | |
| 61 | grind: sources |
| 62 | ${BINDIR}/ctags -v *.h *.c | sort -f >index |
| 63 | ${BINDIR}/vgrind -t -x index >lpr |
| 64 | ${CC} ${CFLAGS} -o pic pic.c |
| 65 | ${BINDIR}/vgrind -t -n READ_ME Makefile lst >>lpr |
| 66 | ${BINDIR}/vgrind -t ${PXSRC} >>lpr |
| 67 | ./pic >lst |
| 68 | ${BINDIR}/vpr lst |
| 69 | ${BINDIR}/vpr -t lpr |
| 70 | ${RM} index pic lst |
| 71 | |
| 72 | depend: sources |
| 73 | ls *.c | sed 's;^\(.*\)\.c;\1.o: \1.c;' >.depend |
| 74 | grep '^#[ ]*include' *.c | sed \ |
| 75 | -e '/<.*>/d' \ |
| 76 | -e 's;:[^"]*"\([^"]*\)".*;: \1;' \ |
| 77 | -e 's/\.c/\.o/' \ |
| 78 | -e 's;: libpc.h;: ${LIBPCDIR}/libpc.h;' \ |
| 79 | -e 's;: objfmt.h;: ${SRCDIR}/objfmt.h;' \ |
| 80 | -e 's;: OPnames.h;: ${SRCDIR}/OPnames.h;' >>.depend |
| 81 | |