Merge branch 'vendor/GCC'
[dragonfly.git] / usr.bin / top / Makefile
1 # $FreeBSD: src/usr.bin/top/Makefile,v 1.5.6.2 2002/08/11 17:09:54 dwmalone Exp $
2 # $DragonFly: src/usr.bin/top/Makefile,v 1.8 2007/08/27 16:50:59 pavalos Exp $
3 PROG=   top
4 WARNS?= 4
5
6 TOPDIR= ${.CURDIR}/../../contrib/top
7 .PATH:  ${TOPDIR}
8
9 CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -I${.CURDIR} -I${.OBJDIR} \
10                  -I${TOPDIR} -I. -DORDER
11
12 #
13 # The table size should be a prime number approximately twice as
14 # large as the number of lines in /etc/passwd.  The default number
15 # is 20011, use /etc/make.conf to override this.
16 #
17 .if defined(TOP_TABLE_SIZE)
18 CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}"
19 .endif
20
21 SRCS=   commands.c display.c machine.c screen.c top.c \
22         username.c utils.c version.c top.local.h
23
24 CLEANFILES+= top.local.h top.x top.1
25 DPADD=  ${LIBTERMCAP} ${LIBM} ${LIBKVM} ${LIBKINFO}
26 LDADD=  -ltermcap -lm -lkvm -lkinfo
27 BINGRP= kmem
28 BINMODE=2555
29 WARNS?= 0
30
31 top.1:  top.x top.local.1
32         cat ${.ALLSRC} > top.1
33
34 .SUFFIXES: .X .x .H .h
35
36 .X.x .H.h:
37         @${ECHO} Making ${.TARGET} from ${.IMPSRC}
38         @sed -e's,%LoadMax%,5.0,g' \
39         -e's,%TableSize%,20011,g' \
40         -e's,%NominalTopn%,18,g' \
41         -e's,%topn%,-1,g' \
42         -e's,%delay%,2,g' \
43         -e's,%random%,1,g' \
44         ${.IMPSRC} > ${.TARGET}
45
46 .include <bsd.prog.mk>