summaryrefslogtreecommitdiff
path: root/sysutils/turbostat/Makefile
blob: 7593c658a256b8316948a7aa86140b4a2f0cd8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

PORTNAME=	turbostat
PORTVERSION=	4.17 # Turbostat itself has a version, but we don't bother
PORTREVISION=	2
CATEGORIES=	sysutils
MASTER_SITES=	https://raw.githubusercontent.com/torvalds/linux/v${PORTVERSION}/tools/power/x86/turbostat/ \
		https://raw.githubusercontent.com/torvalds/linux/v${PORTVERSION}/arch/x86/include/asm/
DISTFILES=	${PORTNAME}.c ${PORTNAME}.8 msr-index.h intel-family.h
DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}

MAINTAINER=	d.scott.phillips@intel.com
COMMENT=	Report power statistics for Intel CPUs

LICENSE=	GPLv2

ONLY_FOR_ARCHS=	amd64

NO_WRKSUBDIR=yes
PLIST_FILES=	sbin/turbostat man/man8/turbostat.8.gz

post-extract:

do-extract:
	@${MKDIR} ${WRKSRC}
	${CP} ${_DISTDIR}/${PORTNAME}.c ${WRKSRC}
	${CP} ${_DISTDIR}/${PORTNAME}.8 ${WRKSRC}
	${CP} ${_DISTDIR}/msr-index.h ${WRKSRC}
	${CP} ${_DISTDIR}/intel-family.h ${WRKSRC}

do-build:
	cd ${WRKSRC} && ${CC} ${CFLAGS} -DMSRHEADER='"msr-index.h"' -DINTEL_FAMILY_HEADER='"intel-family.h"' -o ${PORTNAME} ${PORTNAME}.c -lutil

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MANPREFIX}/man/man8

.include <bsd.port.mk>