xref: /original-bsd/old/pcc/ccom.tahoe/Makefile (revision 279692fa)
1#
2#	Makefile	1.10	88/01/15
3#
4# Makefile for tahoe pcc
5#
6RM=	/bin/rm -f
7GREP=	egrep
8MIP=	../../mip
9#
10# Some symbols are specific to certain compilers:
11#	ONEPASS		compile pass 1 and pass 2 together
12#	FORT		get f77-style pass 2
13#
14INCS=	-I. -I${MIP}
15CFLAGS=	-O
16LDFLAGS=
17LIBS=
18
19# c version
20OPTS=	-DONEPASS ${INCS}
21FLAGS=	${CFLAGS} ${OPTS}
22SRCS=	code.c local.c local2.c order.c rel.c stab.c \
23	${MIP}/common.c ${MIP}/match.c ${MIP}/optim.c ${MIP}/pftn.c \
24	${MIP}/reader.c ${MIP}/scan.c ${MIP}/xdefs.c ${MIP}/cgram.y \
25	${MIP}/allo.c ${MIP}/trees.c table.c
26OBJS=	code.o local.o local2.o order.o rel.o stab.o \
27	comm1.o match.o optim.o pftn.o reader.o scan.o xdefs.o cgram.o \
28	allo.o trees.o table.o rodata.o
29# fortran version
30FOPTS=	-DFORT ${INCS}
31FFLAGS=	${CFLAGS} ${FOPTS}
32FSRCS=	freader.c fallo.c fmatch.c ftable.c forder.c flocal2.c fcomm2.c ftable.c
33FOBJS=	freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o ftable.o
34
35TESTDIR=.
36
37all:	ccom f1
38
39#
40# 'ccom' is a one-pass C compiler.
41#
42ccom:	${OBJS} rel.o
43	${CC} ${LDFLAGS} -o ${TESTDIR}/ccom ${OBJS} rel.o ${LIBS}
44trees.o: ${MIP}/trees.c
45	${CC} -c ${FLAGS} ${MIP}/trees.c
46optim.o: ${MIP}/optim.c
47	${CC} -c ${FLAGS} ${MIP}/optim.c
48pftn.o: ${MIP}/pftn.c
49	${CC} -c ${FLAGS} ${MIP}/pftn.c
50code.o: code.c
51	${CC} -c ${FLAGS} code.c
52local.o: local.c
53	${CC} -c ${FLAGS} local.c
54scan.o: ${MIP}/scan.c
55	${CC} -c ${FLAGS} ${MIP}/scan.c
56xdefs.o: ${MIP}/xdefs.c
57	${CC} -c ${FLAGS} ${MIP}/xdefs.c
58cgram.o: cgram.c
59	${CC} -c ${FLAGS} cgram.c
60rodata.o: rodata.c
61	${CC} -c ${FLAGS} -R rodata.c
62rodata.c cgram.c: ${MIP}/cgram.y pcctokens
63	cat pcctokens ${MIP}/cgram.y > gram.in
64	${YACC} gram.in
65	${RM} rodata.c
66	sh :yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef
67	mv y.tab.c cgram.c
68comm1.o: ${MIP}/common.c
69	ln ${MIP}/common.c comm1.c
70	${CC} -c ${FLAGS} -DPASS1COMMON comm1.c
71	${RM} comm1.c
72stab.o: stab.c
73	${CC} -c ${FLAGS} stab.c
74table.o: table.c
75	${CC} -c ${FLAGS} -R table.c
76reader.o: ${MIP}/reader.c
77	${CC} -c ${FLAGS} ${MIP}/reader.c
78local2.o: local2.c
79	${CC} -c ${FLAGS} local2.c
80order.o: order.c
81	${CC} -c ${FLAGS} order.c
82match.o: ${MIP}/match.c
83	${CC} -c ${FLAGS} ${MIP}/match.c
84allo.o: ${MIP}/allo.c
85	${CC} -c ${FLAGS} ${MIP}/allo.c
86
87#
88# 'f1' is the f77 and pc code generator.
89#
90f1:	fort.o ${FOBJS}
91	${CC} ${LDFLAGS} -o ${TESTDIR}/f1 fort.o ${FOBJS} ${LIBS}
92fort.o: fort.h ${MIP}/fort.c
93	${CC} -c ${FFLAGS} ${MIP}/fort.c
94freader.o: ${MIP}/reader.c
95	ln ${MIP}/reader.c freader.c
96	${CC} -c ${FFLAGS} freader.c
97	${RM} freader.c
98fallo.o: ${MIP}/allo.c
99	ln ${MIP}/allo.c fallo.c
100	${CC} -c ${FFLAGS} fallo.c
101	${RM} fallo.c
102fmatch.o: ${MIP}/match.c
103	ln ${MIP}/match.c fmatch.c
104	${CC} -c ${FFLAGS} fmatch.c
105	${RM} fmatch.c
106ftable.o: table.c
107	ln table.c ftable.c
108	${CC} -c -R ${FFLAGS} ftable.c
109	${RM} ftable.c
110forder.o: order.c
111	ln order.c forder.c
112	${CC} -c ${FFLAGS} forder.c
113	${RM} forder.c
114flocal2.o: local2.c
115	ln local2.c flocal2.c
116	${CC} -c ${FFLAGS} flocal2.c
117	${RM} flocal2.c
118fcomm2.o: ${MIP}/common.c
119	ln ${MIP}/common.c fcomm2.c
120	${CC} -c ${FFLAGS} -DPASS2COMMON fcomm2.c
121	${RM} fcomm2.c
122
123install:
124	install -s -o bin -g bin -m 755 ${TESTDIR}/ccom ${DESTDIR}/lib/ccom
125	install -s -o bin -g bin -m 755 ${TESTDIR}/f1 ${DESTDIR}/lib/f1
126
127pcclocal.h: ../localdefs.h /usr/include/pcc.h
128	${RM} pcclocal.h
129	cat /usr/include/pcc.h ../localdefs.h | \
130	    ${GREP} '^#[ 	]*(define[ 	][ 	]*PCC(F|T|TM|OM)?_|ifdef|ifndef|endif)' | \
131	    sed -e 's/PCC[A-Z]*_//' > pcclocal.h
132
133pcctokens: ../localdefs.h /usr/include/pcc.h
134	${RM} pcctokens
135	cat /usr/include/pcc.h ../localdefs.h | \
136	    ${GREP} '^#[ 	]*define[ 	][ 	]*PCC_' | sed -e 's/^#[ 	]*define[ 	][ 	]*PCC_/%term	/' > pcctokens
137
138clean:
139	${RM} *.o ccom f1 cgram.c rodata.c pcctokens pcclocal.h \
140	    gram.in ${SSRCS} ${FSRCS}
141
142lint:
143	lint -hx ${OPTS} -DPASS1COMMON cgram.c \
144	    ${MIP}/xdefs.c ${MIP}/scan.c ${MIP}/pftn.c ${MIP}/trees.c \
145	    ${MIP}/optim.c ${MIP}/reader.c ${MIP}/match.c ${MIP}/allo.c \
146	    ${MIP}/common.c \
147	    code.c local.c stab.c local2.c order.c table.c rel.c
148
149tags:	${SRCS}
150	ctags ${SRCS}
151
152# XXX this is less than complete
153depend: ${SRCS} ${MIP}/fort.c pcclocal.h pcctokens
154	mkdep ${CFLAGS} ${INCS} ${SRCS} ${MIP}/fort.c
155
156# DO NOT DELETE THIS LINE -- mkdep uses it.
157# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
158
159code.o: code.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
160code.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
161code.o: /usr/include/sys/types.h /usr/include/a.out.h /usr/include/sys/exec.h
162code.o: /usr/include/stab.h
163local.o: local.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
164local.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
165local2.o: local2.c ../../mip/pass2.h macdefs.h mac2defs.h ../../mip/manifest.h
166local2.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
167local2.o: /usr/include/ctype.h
168order.o: order.c ../../mip/pass2.h macdefs.h mac2defs.h ../../mip/manifest.h
169order.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
170rel.o: rel.c
171stab.o: stab.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
172stab.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
173stab.o: /usr/include/sys/types.h /usr/include/a.out.h /usr/include/sys/exec.h
174stab.o: /usr/include/stab.h
175common.o: ../../mip/common.c
176match.o: ../../mip/match.c ../../mip/pass2.h macdefs.h mac2defs.h
177match.o: ../../mip/manifest.h /usr/include/stdio.h pcclocal.h
178match.o: ../../mip/config.h ../../mip/ndu.h
179optim.o: ../../mip/optim.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
180optim.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
181pftn.o: ../../mip/pftn.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
182pftn.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
183reader.o: ../../mip/reader.c ../../mip/pass2.h macdefs.h mac2defs.h
184reader.o: ../../mip/manifest.h /usr/include/stdio.h pcclocal.h
185reader.o: ../../mip/config.h ../../mip/ndu.h
186scan.o: ../../mip/scan.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
187scan.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
188scan.o: /usr/include/a.out.h /usr/include/sys/exec.h /usr/include/stab.h
189scan.o: /usr/include/ctype.h /usr/include/signal.h /usr/include/machine/trap.h
190xdefs.o: ../../mip/xdefs.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
191xdefs.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
192cgram.o: ../../mip/cgram.y ../../mip/pass1.h macdefs.h ../../mip/manifest.h
193cgram.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
194allo.o: ../../mip/allo.c ../../mip/pass2.h macdefs.h mac2defs.h
195allo.o: ../../mip/manifest.h /usr/include/stdio.h pcclocal.h ../../mip/config.h
196allo.o: ../../mip/ndu.h
197trees.o: ../../mip/trees.c ../../mip/pass1.h macdefs.h ../../mip/manifest.h
198trees.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
199trees.o: /usr/include/setjmp.h
200table.o: table.c ../../mip/pass2.h macdefs.h mac2defs.h ../../mip/manifest.h
201table.o: /usr/include/stdio.h pcclocal.h ../../mip/config.h ../../mip/ndu.h
202fort.o: ../../mip/fort.c ../../mip/pass2.h macdefs.h mac2defs.h
203fort.o: ../../mip/manifest.h /usr/include/stdio.h pcclocal.h ../../mip/config.h
204fort.o: ../../mip/ndu.h fort.h
205
206# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
207