xref: /original-bsd/usr.bin/pascal/pc0/Makefile (revision ec35a16d)
1#	@(#)Makefile	8.1 (Berkeley) 06/06/93
2
3PROG=	pc0
4SRCDIR=	${.CURDIR}/../src
5CFLAGS=	-I. -I${.CURDIR} -I${SRCDIR}
6.PATH:	${SRCDIR}
7BINDIR=	/usr/libexec/pascal
8NOMAN=	noman
9CLEANFILES+=main.c xmain.c
10
11EYACC=	/usr/libexec/pascal/eyacc
12
13WHOAMI=	pc
14.include "${SRCDIR}/config.include"
15
16SRCS=	TRdata.c ato.c call.c case.c clas.c const.c conv.c cset.c error.c \
17	fdec.c fend.c fhdr.c flvalue.c forop.c func.c gen.c hash.c lab.c \
18	lookup.c lval.c main.c nl.c p2put.c pccaseop.c pcfunc.c pclval.c \
19	pcproc.c proc.c put.c rec.c rval.c savenl.c sconv.c stab.c stat.c \
20	stklval.c stkrval.c string.c subr.c tmps.c tree.c treen.c type.c \
21	var.c yycopy.c yycosts.c yyerror.c yyget.c yyid.c yylex.c yymain.c \
22	yyoptions.c yypanic.c yyparse.c yyprint.c yyput.c yyrecover.c \
23	yyseman.c yytree.c
24OBJS+=	config.c y.tab.o
25CLEANFILES+=opc y.tab.h y.tab.c y.tab.out ${WHOAMI}*strings config.c \
26	    opcode.h picture opc pic *.list ${ERRORSTRINGS} config.o
27
28.c.o:
29	rm -f ${.IMPSRC:T}
30	ln -s ${.IMPSRC} .
31	mkstr - ${ERRORSTRINGS} x ${.IMPSRC:T}
32	${CC} ${CFLAGS} -c x${.IMPSRC:T} -o ${.TARGET}
33	rm -f x${.IMPSRC:T} ${.IMPSRC:T}
34
35y.tab.o: y.tab.c y.tab.h
36	rm -f x.y.tab.c
37	mkstr - ${ERRORSTRINGS} x. y.tab.c
38	${CC} ${CFLAGS} -c x.y.tab.c
39	mv x.y.tab.o y.tab.o
40	rm -f x.y.tab.c
41
42y.tab.c: y.tab.h
43
44y.tab.h: ${SRCDIR}/pas.y ${SRCDIR}/gram
45	@echo make y.tab.h and y.tab.c
46	rm -f y.tab.h y.tab.c
47	${EYACC} ${SRCDIR}/pas.y > /dev/null
48	ex - y.tab.c < ${SRCDIR}/gram
49
50picture: pic ${SRCDIR}/OPnames.h
51	./pic > picture
52
53pic: pic.c
54	${CC} ${.ALLSRC} -o ${.TARGET}
55
56opcode.h: opc ${SRCDIR}/OPnames.h ${SRCDIR}/opc.c
57	./opc > ${.TARGET}
58
59opc: opc.c
60	${CC} ${.ALLSRC} -o ${.TARGET}
61
62beforeinstall:
63	install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${ERRORSTRINGS} \
64	    ${DESTDIR}${LIBDATA}/${ERRORSTRINGS}
65
66.include <bsd.prog.mk>
67
68${OBJS} .depend: opcode.h y.tab.h
69