summaryrefslogtreecommitdiff
path: root/benchmarks/hbench/Makefile
blob: 0293e64c148056b34827b9bd0d03f032f9d8d090 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# $NetBSD: Makefile,v 1.23 2004/01/20 12:08:12 agc Exp $

DISTNAME=		hbench-OS-1.0
PKGNAME=		hbench-1.0
PKGREVISION=		1
CATEGORIES=		benchmarks
MASTER_SITES=		ftp://ftp.eecs.harvard.edu/pub/hbench-OS/

MAINTAINER=		root@garbled.net
HOMEPAGE=		http://www.eecs.harvard.edu/vino/perf/hbench/
COMMENT=		Suite of portable benchmarks to measure the OS and the hardware

DEPENDS+=		gnuplot>=3.7:../../graphics/gnuplot

WRKSRC=			${WRKDIR}/hbench-OS
USE_BUILDLINK2=		YES
OSVERSION_SPECIFIC=	YES
ALL_TARGET=		build

PLIST_SRC=		${WRKDIR}/PLIST-src

post-patch:
	@machfiles="";							\
	if [ ${MACHINE} = i386 ]; then					\
		machfiles="$$machfiles ${PKGDIR}/PLIST.${MACHINE}";	\
	fi ;								\
	${CAT} ${PKGDIR}/PLIST.md $$machfiles ${PKGDIR}/PLIST.common	\
		> ${PLIST_SRC}

post-configure:
	@cd ${WRKSRC};							\
	for f in scripts/create-all-analyses				\
		scripts/create-all-latgraphs				\
		scripts/create-all-summaries scripts/gen-analysis	\
		scripts/gen-latgraph scripts/gen-summary 		\
		scripts/interactive-setup scripts/maindriver		\
		Results/Makefile; do					\
		${MV} $$f $$f.in;					\
		${SED} -e 's|@PREFIX@|${PREFIX}|g' $$f.in > $$f;	\
	done
	@ ${CHMOD} 0755 ${WRKSRC}/scripts/*

do-install:
	@${SETENV} PREFIX=${PREFIX} WRKSRC=${WRKSRC} ${FILESDIR}/do-install

benchmark:
	@if [ `id -u` != 0 ]; then ${ECHO} "This benchmark must be run as root!" ; exit 1 ; fi
	cd ${WRKSRC};							\
	${MKDIR} conf;							\
	${MKDIR} results;						\
	${SED} -e 's|@pwd@|'`/bin/pwd`'|g' 				\
		-e 's|@hostname@|'`/bin/hostname -s`'|g'		\
		-e 's|@wrksrc@|'`/bin/pwd`'|g'				\
		${FILESDIR}/setup.answers | ${MAKE} setup;		\
	${MV} conf/`/bin/hostname -s`.run conf/foo ;			\
	${SED} -e 's|#PLAINBINDIR=${HBENCHROOT}|PLAINBINDIR='`/bin/pwd`'|' \
		< conf/foo > conf/`/bin/hostname -s`.run ;		\
	${MAKE} run

results:
	@${MKDIR} /tmp/benches/`domainname`
	-@cd ${WRKSRC} ; \
	tar -cf /tmp/benches/`domainname`/hbench.`uname`-`uname -m`-`uname -r`.`hostname`.tar results conf

.include "../../lang/perl5/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"