xref: /original-bsd/old/cpp/Makefile (revision 8431ec24)
1#
2# Copyright (c) 1987 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	1.8	(Berkeley)	02/20/90
7#
8CFLAGS=	-O -Dunix=1 -DFLEXNAMES
9LIBC=	/lib/libc.a
10YYFIX=	../../libexec/pcc/pcc.${MACHINE}/:yyfix
11SRCS=	cpp.c cpy.c rodata.c
12OBJS=	cpp.o cpy.o rodata.o
13
14all: cpp
15
16cpp:	${OBJS} ${LIBC}
17	${CC} -o $@ ${CFLAGS} ${OBJS}
18
19cpy.c: cpy.y
20	yacc cpy.y
21	${YYFIX}  yylhs yylen yydefred yydgoto yysindex yyrindex \
22	    yygindex yytable yycheck
23	mv y.tab.c cpy.c
24
25cpy.o: cpy.c yylex.c
26
27rodata.o: cpy.c
28	${CC} ${CFLAGS} -R -c rodata.c
29
30clean:
31	rm -f ${OBJS} cpp core cpy.c rodata.c
32
33cleandir: clean
34	rm -f ${MAN} tags .depend
35
36depend: ${SRCS}
37	mkdep ${CFLAGS} ${SRCS}
38
39install: ${MAN}
40	install -s -o bin -g bin -m 755 cpp ${DESTDIR}/usr/bin
41
42lint: ${SRCS}
43	lint ${CFLAGS} ${SRCS}
44
45tags: ${SRCS}
46	ctags ${SRCS}
47