pkgsrc/benchmarks/hbench/Makefile
dholland cf2f2669c6 Add a distfile patch from yours truly, which may become, or may become
part of, a new upstream version, but I need to talk to some people first.
(I'm keeping this separate from the previous update in case it breaks stuff.)

Changes:
	roll in parts of patch-aa and patch-aq;
	roll in all of patch-ar and patch-src_memsize_c;
	make the ARM-only adjustment from patch-ar universal;
	add enough volatile to make 'mhz' work more or less properly again;
	fix the loop calibration to bail out instead of spinning forever
	  if things go too fast (e.g. because the compiler's optimized out
	  the benchmark loop);
	various hacking and modernization to get sort of a clean compile;
	fix some non-stdc stringifying macros;
	hopefully advance the clang build a bit further.
2011-09-12 11:15:33 +00:00

75 lines
2.3 KiB
Makefile

# $NetBSD: Makefile,v 1.46 2011/09/12 11:15:33 dholland Exp $
DISTNAME= hbench-OS-1.1
PKGNAME= hbench-1.1
PKGREVISION= 1
CATEGORIES= benchmarks
MASTER_SITES= http://www.eecs.harvard.edu/vino/perf/hbench/
PATCHFILES= hbench-OS-1.1-provisional-patch1.diff
PATCH_SITES= http://www.eecs.harvard.edu/~dholland/netbsd/
PATCH_DIST_STRIP= -p1
MAINTAINER= pkgsrc-users@NetBSD.org
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
PKG_INSTALLATION_TYPES= overwrite pkgviews
PKG_DESTDIR_SUPPORT= user-destdir
WRKSRC= ${WRKDIR}/HBenchOS
OSVERSION_SPECIFIC= YES
BUILD_TARGET= build
USE_TOOLS+= perl:run
OVERRIDE_GNU_CONFIG_SCRIPTS= yes
GET_ARCH_CMD= ${PKGSRCDIR:Q}/mk/gnu-config/config.guess | ${SED} -e 's/-.*-.*$$//'
GET_OS_CMD= ${PKGSRCDIR:Q}/mk/gnu-config/config.guess | ${SED} -e 's/^.*-.*-//'
PLIST_SUBST+= PLATFORM=${GET_OS_CMD:sh:Q}-${GET_ARCH_CMD:sh:Q}
.include "../../mk/bsd.prefs.mk"
HB_HOSTNAME!= ${UNAME} -n
HB_SHORTNAME= ${HB_HOSTNAME:C/\..*//}
post-extract:
${CP} ${FILESDIR}/do-install ${WRKSRC}
SUBST_CLASSES+= hb
SUBST_STAGE.hb= pre-configure
SUBST_MESSAGE.hb= Replacing bin with libexec.
SUBST_FILES.hb= do-install
SUBST_FILES.hb+= scripts/*
SUBST_FILES.hb+= Results/Makefile
SUBST_SED.hb= -e 's,@PREFIX@,${PREFIX},g'
SUBST_SED.hb+= -e 's,/bin/hbench,/libexec/hbench,g'
INSTALLATION_DIRS= bin
do-install:
${SETENV} ${MAKE_ENV} WRKSRC=${WRKSRC} BINOWN=${BINOWN} \
REAL_PREFIX=${PREFIX} BINGRP=${BINGRP} \
PREFIX=${DESTDIR}${PREFIX} ${WRKSRC}/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@|${HB_SHORTNAME}|g' \
-e 's|@wrksrc@|'`/bin/pwd`'|g' \
${FILESDIR}/setup.answers | ${MAKE} setup; \
${MV} conf/${HB_SHORTNAME}.run conf/foo ; \
${SED} -e 's|#PLAINBINDIR=${HBENCHROOT}|PLAINBINDIR='`/bin/pwd`'|' \
< conf/foo > conf/${HB_SHORTNAME}.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 "../../mk/bsd.pkg.mk"