xref: /freebsd/usr.bin/top/Makefile (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1# $FreeBSD$
2
3TOPDIR=	${.CURDIR}/../../contrib/top
4.PATH: ${TOPDIR}
5
6PROG=	top
7SRCS=	commands.c display.c machine.c screen.c top.c \
8	username.c utils.c version.c
9SRCS+=	sigdesc.h top.local.h
10CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -DORDER
11CFLAGS+= -I${.CURDIR} -I${TOPDIR} -I.
12
13#
14# The table size should be a prime number approximately twice as
15# large as the number of lines in /etc/passwd.  The default number
16# is 20011; use /etc/make.conf to override this.
17#
18.if defined(TOP_TABLE_SIZE)
19CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}"
20.endif
21
22DPADD=	${LIBTERMCAP} ${LIBM} ${LIBKVM}
23LDADD=	-ltermcap -lm -lkvm
24
25CLEANFILES= sigdesc.h
26SIGCONV_AWK= ${.CURDIR}/../../contrib/top/sigconv.awk
27SIGNAL_H= ${DESTDIR}/usr/include/sys/signal.h
28sigdesc.h: ${SIGCONV_AWK} ${SIGNAL_H}
29	awk -f ${SIGCONV_AWK} < ${SIGNAL_H} > ${.TARGET}
30
31CLEANFILES+= top.local.h top.x
32.SUFFIXES: .X .x .H .h
33.X.x .H.h:
34	@${ECHO} Making ${.TARGET} from ${.IMPSRC}
35	@sed -e's,%LoadMax%,5.0,g' \
36	-e's,%TableSize%,20011,g' \
37	-e's,%NominalTopn%,18,g' \
38	-e's,%topn%,-1,g' \
39	-e's,%delay%,2,g' \
40	-e's,%random%,1,g' \
41	${.IMPSRC} > ${.TARGET}
42
43CLEANFILES+= top.1
44top.1: top.x top.local.1
45	cat ${.ALLSRC} > ${.TARGET}
46
47.include <bsd.prog.mk>
48