xref: /original-bsd/old/pcc/lint/Makefile (revision ed20bae8)
1#
2#	@(#)Makefile	1.22	(Berkeley)	10/25/88
3#
4M=../../lib/mip
5P=../../lib/pcc
6CFLAGS=-O
7LINTLIBS=llib-port.ln llib-lc.ln llib-lcurses.ln llib-ldbm.ln llib-lm.ln \
8	llib-lmp.ln llib-lplot.ln llib-ltermcap.ln
9SRCS=	$M/cgram.y $M/common.c $M/optim.c $M/pftn.c $M/scan.c $M/trees.c \
10	$M/xdefs.c lint.c hash.c $M/pass1.h $M/manifest.h macdefs.h \
11	lpass2.c
12MAN=	lint.0
13
14all: lpass1 lpass2 ${LINTLIBS}
15
16lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
17	lint.o hash.o rel.o
18	${CC} ${CFLAGS} cgram.o rodata.o comm1.o optim.o pftn.o scan.o \
19		trees.o xdefs.o lint.o hash.o rel.o -o lpass1
20
21cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c
22	$(CC) -c $(CFLAGS) -I$M -I. cgram.c
23
24rodata.o: rodata.c
25	$(CC) -c $(CFLAGS) -R rodata.c
26
27comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h
28	ln -s $M/common.c comm1.c
29	$(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c
30	rm -f comm1.c
31
32optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c
33	$(CC) -c $(CFLAGS) -I$M -I. $M/optim.c
34
35pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c
36	$(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c
37
38scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c
39	$(CC) -c $(CFLAGS) -I$M -I. $M/scan.c
40
41trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c
42	$(CC) -c $(CFLAGS) -I$M -I. $M/trees.c
43
44xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c
45	$(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c
46
47rodata.c cgram.c: $M/cgram.y pcctokens
48	cat pcctokens $M/cgram.y > gram.in
49	$(YACC) gram.in
50	rm -f rodata.c
51	sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef
52	mv y.tab.c cgram.c
53
54GREP=	egrep
55
56pcclocal.h: $P/localdefs.h /usr/include/pcc.h
57	rm -f pcclocal.h
58	cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ 	]*(define[ 	][ 	]*PCC(F|T|TM|OM)?_|ifdef|ifndef|endif)' | sed -e 's/PCC[A-Z]*_//' > pcclocal.h
59
60pcctokens: $P/localdefs.h /usr/include/pcc.h
61	rm -f pcctokens
62	cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ 	]*define[ 	][ 	]*PCC_' | sed -e 's/^#[ 	]*define[ 	][ 	]*PCC_/%term	/' > pcctokens
63
64lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h
65	${CC} -c ${CFLAGS} -I$M -I. lint.c
66
67llib-port.ln: llib-port lpass1
68	-(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln )
69
70llib-ldbm.ln: llib-ldbm lpass1
71	-(/lib/cpp -C -Dlint llib-ldbm | ./lpass1 -uv > llib-ldbm.ln )
72
73llib-lm.ln: llib-lm lpass1
74	-(/lib/cpp -C -Dlint llib-lm | ./lpass1 -uv > llib-lm.ln )
75
76llib-lmp.ln: llib-lmp lpass1
77	-(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -uv > llib-lmp.ln )
78
79llib-lplot.ln: llib-lplot lpass1
80	-(/lib/cpp -C -Dlint llib-lplot | ./lpass1 -uv > llib-lplot.ln )
81
82llib-ltermcap.ln: llib-ltermcap lpass1
83	-(/lib/cpp -C -Dlint llib-ltermcap | ./lpass1 -uv > llib-ltermcap.ln )
84
85llib-lc.ln: llib-lc lpass1
86	-(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln )
87
88llib-lcurses.ln: llib-lcurses lpass1
89	-(/lib/cpp -C -Dlint -D__void__=__curses__ llib-lcurses | ./lpass1 -v > llib-lcurses.ln )
90
91lpass2: lpass2.o hash.o
92	${CC} ${CFLAGS} lpass2.o hash.o -o lpass2
93
94lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h
95	${CC} ${CFLAGS} -c -I$M -I. lpass2.c
96
97hash.o: hash.c
98	${CC} ${CFLAGS} -c -I$M -I. hash.c
99
100lintall:
101	lint -hpv -I. -I$M  $M/cgram.c $M/xdefs.c $M/scan.c \
102		$M/pftn.c $M/trees.c $M/optim.c lint.c
103
104install: all SHELL ${MAN}
105	install -s -o bin -g bin -m 755 lpass1 ${DESTDIR}/usr/lib/lint/lint1
106	install -s -o bin -g bin -m 755 lpass2 ${DESTDIR}/usr/lib/lint/lint2
107	for i in llib-*; do install -c -o bin -g bin -m 644 $$i ${DESTDIR}/usr/lib/lint; done
108	-rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib*
109	ln -s llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib
110	ln -s llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln
111	install -c -o bin -g bin -m 755 SHELL ${DESTDIR}/usr/bin/lint
112	install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1
113
114shrink:
115	rm -f *.o errs rodata.c pcctokens pcclocal.h
116
117clean: shrink
118	rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS}
119
120cleandir: clean
121	rm -f ${MAN} tags .depend
122
123tags: ${SRCS}
124	ctags -w ${SRCS}
125
126depend lint:
127