xref: /original-bsd/old/awk/Makefile (revision b8338845)
1#
2# Copyright (c) 1987 The Regents of the University of California.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms are permitted
6# provided that the above copyright notice and this paragraph are
7# duplicated in all such forms and that any documentation,
8# advertising materials, and other materials related to such
9# distribution and use acknowledge that the software was developed
10# by the University of California, Berkeley.  The name of the
11# University may not be used to endorse or promote products derived
12# from this software without specific prior written permission.
13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16#
17#	@(#)Makefile	4.10 (Berkeley) 05/10/89
18#
19CFLAGS=	-O
20LIBC=	/lib/libc.a
21YFLAGS=	-d
22OBJS=	awk.lx.o b.o main.o token.o tran.o lib.o run.o parse.o proctab.o \
23	freeze.o
24SRCS=	awk.lx.c b.c lib.c main.c parse.c proctab.c freeze.c run.c \
25	token.c tran.c
26MAN=	awk.0
27
28all: awk
29
30awk: ${OBJS} awk.g.o ${LIBC}
31	${CC} ${CFLAGS} awk.g.o  ${OBJS} -lm -o $@
32
33y.tab.h: awk.g.o
34
35awk.h: y.tab.h
36	-cmp -s y.tab.h awk.h || cp y.tab.h awk.h
37
38token.c: awk.h
39	ex - < tokenscript
40
41profile: awk.g.o ${OBJS} mon.o
42	${CC} -p -i awk.g.o ${OBJS} mon.o -lm
43
44proctab.c: proc
45	./proc > proctab.c
46
47proc: awk.h proc.o token.o
48	${CC} -o $@ proc.o token.o
49
50clean:
51	rm -f *.o core awk awk.h awk.lx.c y.tab.h proc proctab.c yacc* temp
52
53cleandir: clean
54	rm -f ${MAN} tags .depend
55
56depend: y.tab.h ${SRCS}
57	mkdep ${CFLAGS} ${SRCS}
58
59install: ${MAN}
60	install -s -o bin -g bin -m 755 awk ${DESTDIR}/usr/bin
61	install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1
62
63lint: ${SRCS}
64	lint ${CFLAGS} ${SRCS}
65
66tags: ${SRCS}
67	ctags ${SRCS}
68