aboutsummaryrefslogtreecommitdiffstats
path: root/bin/ebuild-helpers/emake
blob: d842781a7bbe3bfe6899ffd7b3a6c6e64f5d49df (plain) (blame)
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
#!/bin/bash
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# emake: Supplies some default parameters to GNU make. At the moment the
#        only parameter supplied is -jN, where N is a number of
#        parallel processes that should be ideal for the running host
#        (e.g. on a single-CPU machine, N=2).  The MAKEOPTS variable
#        is set in make.globals. We don't source make.globals
#        here because emake is only called from an ebuild.

source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh

if [[ $PORTAGE_QUIET != 1 ]] ; then
	(
	for arg in ${MAKE:-make} $MAKEOPTS $EXTRA_EMAKE "$@" ; do
		[[ ${arg} == *" "* ]] \
			&& printf "'%s' " "${arg}" \
			|| printf "%s " "${arg}"
	done
	printf "\n"
	) >&2
fi

${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
ret=$?
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
exit $ret