added PDX constant
[unix-history] / usr / src / usr.bin / pascal / px / Makefile
CommitLineData
65e56240 1SCCSID = "@(#)Makefile 1.9 %G%"
1b89c061 2
15834a19 3CFLAGS = -O
63d45e55
KM
4DESTDIR =
5SRCDIR = /usr/ucb
6LIBDIR = /usr/lib
1b89c061
KM
7PASCALDIR = /usr/src/cmd/pascal
8LIBPCDIR = /usr/src/lib/libpc
9CC = cc
dd94e49f 10OPT = /lib/c2
1b89c061
KM
11AS = as
12RM = rm -f
13
9a92014d 14PSHDR = OPnames.h whoami.h objfmt.h opc.c pic.c
65e56240 15PCHDR = libpc.h
15834a19
KM
16
17PXHDR = vars.h machdep.h
1b89c061
KM
18
19PXSRC = int.c interp.c except.c utilities.c
20
21PXOBJ = int.o interp.o except.o utilities.o
22
15834a19 23PXUTL = make.ed1 panics interp.sed clean.sed version.c
1b89c061
KM
24
25sources: ${PXHDR} ${PXSRC} ${PXUTL}
15834a19
KM
26${PSHDR}:
27 cp ${PASCALDIR}/$@ $@
28${PCHDR}:
29 cp ${LIBPCDIR}/$@ $@
30
31.c.o:
63d45e55 32 ${CC} ${CFLAGS} -c $*.c
1b89c061
KM
33
34px: Version.c ${PXOBJ}
9a92014d 35 ${CC} ${CFLAGS} -o px Version.c ${PXOBJ} -lpc -lm
15834a19
KM
36Version.c: version.c
37 ${CC} ${CFLAGS} -o version version.c
1b89c061
KM
38 ./version >Version.c
39 ${RM} version
40interp.o interp.s: interp.c
63d45e55 41 ${CC} -S interp.c
1b89c061 42 sed -f interp.sed <interp.s >tmp
c3c85287
KM
43 ${OPT} tmp interp.s
44 /usr/lib/pc2 <interp.s >tmp
1b89c061
KM
45 mv tmp interp.s
46 as -o interp.o interp.s
47panics.h: panics make.ed1
48 ex - <make.ed1
15834a19
KM
49h02opcs.h: OPnames.h opc.c
50 ${CC} ${CFLAGS} opc.c -o opc
1b89c061
KM
51 ./opc >h02opcs.h
52 ${RM} opc
53
54install: px
63d45e55 55 cp px ${DESTDIR}/usr/ucb/px
1b89c061
KM
56
57clean:
4411d87f 58 ${RM} *.o *.s px version opc* pic* OPnames.h objfmt.h libpc.h\
65e56240 59 panics.h h02opcs.h errs lpr core tmp
1b89c061
KM
60
61prt: interp.s
62 sed -f clean.sed <interp.s
63
64grind: sources
dc5520f8
KM
65 ${SRCDIR}/ctags -v *.h *.c *.s | sort -f >index
66 ${SRCDIR}/vgrind -t -x index >lpr
67 ${CC} ${CFLAGS} -o pic pic.c
68 ${SRCDIR}/vgrind -t -n READ_ME makefile lst >>lpr
69 ${SRCDIR}/vgrind -t ${PCHDR} ${PXHDR} objfmt.h panics.h whoami.h >>lpr
70 ${SRCDIR}/vgrind -t ${PXSRC} >>lpr
71 ./pic >lst
72 ${SRCDIR}/vpr lst
73 ${SRCDIR}/vpr -t lpr
74 ${RM} index pic lst
1b89c061
KM
75
76depend: sources
77 /bin/grep '^#[ ]*include' *.c \
78 | sed '/<.*>/d' \
79 | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \
80 | sed 's/\.c/.o/' >makedep
81 echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
82 echo '$$r makedep' >>eddep
83 echo 'w' >>eddep
84 cp makefile makefile.bak
85 ed - makefile < eddep
86 rm eddep makedep
87 echo '# DEPENDENCIES MUST END AT END OF FILE' >> makefile
88 echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> makefile
89 echo '# see make depend above' >> makefile
90
91# DO NOT DELETE THIS LINE -- make depend uses it
92# DEPENDENCIES MUST END AT END OF FILE
dc5520f8 93except.o: whoami.h
1b89c061 94except.o: panics.h
15834a19 95except.o: vars.h
dc5520f8 96int.o: whoami.h
15834a19 97int.o: vars.h
1b89c061 98int.o: objfmt.h
dc5520f8
KM
99interp.o: whoami.h
100interp.o: objfmt.h
15834a19 101interp.o: vars.h
1b89c061
KM
102interp.o: panics.h
103interp.o: h02opcs.h
104interp.o: machdep.h
105interp.o: libpc.h
4411d87f 106opc.o: OPnames.h
c3c85287 107pic.o: OPnames.h
dc5520f8 108utilities.o: whoami.h
15834a19 109utilities.o: vars.h
1b89c061
KM
110utilities.o: panics.h
111utilities.o: h02opcs.h
112# DEPENDENCIES MUST END AT END OF FILE
113# IF YOU PUT STUFF HERE IT WILL GO AWAY
114# see make depend above