| 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.5 2004/05/29 09:53:58 hmp Exp $ |
| 3 | PROG= top |
| 4 | |
| 5 | TOPDIR= ${.CURDIR}/../../contrib/top |
| 6 | .PATH: ${TOPDIR} |
| 7 | |
| 8 | CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -I${.CURDIR} -I${.OBJDIR} \ |
| 9 | -I${TOPDIR} -I. -DORDER |
| 10 | |
| 11 | # |
| 12 | # The table size should be a prime number approximately twice as |
| 13 | # large as the number of lines in /etc/passwd. The default number |
| 14 | # is 20011, use /etc/make.conf to override this. |
| 15 | # |
| 16 | .if defined(TOP_TABLE_SIZE) |
| 17 | CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}" |
| 18 | .endif |
| 19 | |
| 20 | CONTRIBDIR= ${TOPDIR} |
| 21 | PATCHES!= echo ${TOPDIR}/patches/*.patch |
| 22 | |
| 23 | SRCS= ${PATCHES} commands.c display.c machine.c screen.c top.c \ |
| 24 | username.c utils.c version.c top.local.h |
| 25 | |
| 26 | CLEANFILES+= top.local.h top.x top.1 |
| 27 | DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM} |
| 28 | LDADD= -ltermcap -lm -lkvm |
| 29 | BINGRP= kmem |
| 30 | BINMODE=2555 |
| 31 | |
| 32 | top.1: top.x top.local.1 |
| 33 | cat ${.ALLSRC} > top.1 |
| 34 | |
| 35 | .SUFFIXES: .X .x .H .h |
| 36 | |
| 37 | .X.x .H.h: |
| 38 | @${ECHO} Making ${.TARGET} from ${.IMPSRC} |
| 39 | @sed -e's,%LoadMax%,5.0,g' \ |
| 40 | -e's,%TableSize%,20011,g' \ |
| 41 | -e's,%NominalTopn%,18,g' \ |
| 42 | -e's,%topn%,-1,g' \ |
| 43 | -e's,%delay%,2,g' \ |
| 44 | -e's,%random%,1,g' \ |
| 45 | ${.IMPSRC} > ${.TARGET} |
| 46 | |
| 47 | .include <bsd.prog.mk> |