summaryrefslogtreecommitdiff
path: root/benchmarks/lmbench/Makefile
blob: 184be049c5dadb5bbd661a5a44d68795a0e39228 (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
# $NetBSD: Makefile,v 1.15 2002/11/14 23:08:51 jlam Exp $

DISTNAME=		lmbench-2alpha11
PKGNAME=		lmbench-2.11a
CATEGORIES=		benchmarks
MASTER_SITES=		ftp://ftp.bitmover.com/lmbench/
EXTRACT_SUFX=		.tgz

MAINTAINER=		root@garbled.net
HOMEPAGE=		http://www.bitmover.com/lm/lmbench/
COMMENT=		Complete benchmark that gives a large amount of information

USE_BUILDLINK2=		YES
USE_GMAKE=		YES
ALL_TARGET=		build
MAKE_ENV+=		MACHINE_ARCH=${MACHINE_ARCH}

post-configure:
	@cd ${WRKSRC};						\
	for f in src/Makefile; do				\
		${SED} -e "s|^\(CC.*\)|#\1|g" $$f > $$f.new;	\
		${MV} -f $$f.new $$f;				\
	done
	@cd ${WRKSRC};						\
	for f in scripts/os scripts/results scripts/config-run	\
		 scripts/lmbench results/Makefile; do		\
		${SED} -e 's|@PREFIX@|${PREFIX}|g' $$f > $$f.new; \
		${MV} -f $$f.new $$f;				\
	done
	@${CHMOD} 0755 ${WRKSRC}/scripts/config-run
	@${CHMOD} 0755 ${WRKSRC}/scripts/os
	@${CHMOD} 0755 ${WRKSRC}/scripts/results
	@${CHMOD} 0755 ${WRKSRC}/scripts/lmbench

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

.include "../../mk/bsd.prefs.mk"

benchmark:
	if [ ! -f ${PREFIX}/bin/lmbench/hello ]; then \
		@${ECHO} "*** This benchmark must be installed to run" ; \
		exit 1 ; \
	fi
.if defined(BATCH)
	@${ECHO} "*** This benchmark should only be run in non-batch mode" ; \
	if [ `id -u` != 0 ]; then ${ECHO} "This benchmark must be run as root!" ; exit 1 ; fi ; \
	@${SED} -e 's|@wrksrc@|${WRKSRC}|' < ${FILESDIR}/setup.answers | \
	(cd ${WRKSRC}/src; ${GMAKE} results)
.else
	@if [ `id -u` != 0 ]; then ${ECHO} "This benchmark must be run as root!" ; exit 1 ; fi
	@cd ${WRKSRC}/src; ${GMAKE} results
.endif

results:
	@${MKDIR} /tmp/benches/`domainname`
	-@cd ${PREFIX}/share/lmbench ; \
	tar -cf /tmp/benches/`domainname`/lmbench.`uname`-`uname -m`-`uname -r`.`hostname`.tar results

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