summaryrefslogtreecommitdiff
path: root/scripts/include/common.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-05-06 04:51:16 +0300
committerAndrei Karas <akaras@inbox.ru>2018-05-06 04:52:14 +0300
commit424e61211927f71eb002be0e6beb36423a3b9c15 (patch)
treee311ab592b00ec7944ee077b043a21bb25eb790a /scripts/include/common.sh
parentb10c5b3cc6272ba3a3a75483d57c8a774e2512b2 (diff)
downloadspm-424e61211927f71eb002be0e6beb36423a3b9c15.tar.gz
spm-424e61211927f71eb002be0e6beb36423a3b9c15.tar.bz2
spm-424e61211927f71eb002be0e6beb36423a3b9c15.tar.xz
spm-424e61211927f71eb002be0e6beb36423a3b9c15.zip
Allow use configurable make by variable MAKE.
This need for systems where make binary is not gnu make, but make file created for gnu make only.
Diffstat (limited to 'scripts/include/common.sh')
-rw-r--r--scripts/include/common.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh
index 974d66c..2383724 100644
--- a/scripts/include/common.sh
+++ b/scripts/include/common.sh
@@ -18,6 +18,10 @@ function common_build_init {
export envname=${package}
fi
+ if [[ "${MAKE}" == "" ]]; then
+ export MAKE="make"
+ fi
+
export srcdir=$(realpath "${dir}/../src/${package}")
if [ ! -d "${srcdir}" ]; then
echo "Error: Package sources directory not exists for package '${package}'."
@@ -111,8 +115,8 @@ function run_autoreconf {
echo "cd ${srcdir}/${SUBDIR}"
cd "${srcdir}/${SUBDIR}"
check_error $?
- echo "make distclean"
- make distclean
+ echo "${MAKE} distclean"
+ ${MAKE} distclean
echo "autoreconf ${flags}"
autoreconf ${flags}
unset flags
@@ -169,21 +173,21 @@ function run_make {
if [[ "${jobs}" == "" ]]; then
if [ -f "/proc/cpuinfo" ]; then
jobs="$(cat /proc/cpuinfo|grep processor|wc -l)"
+ j=" -j${jobs}"
else
- jobs="1"
+ j=""
fi
fi
- j=" -j${jobs}"
- echo "make$j"
- make$j
+ echo "${MAKE}$j"
+ ${MAKE}$j
check_error $?
unset j
}
function run_make_install {
- echo "make install"
- make install
+ echo "${MAKE} install"
+ ${MAKE} install
check_error $?
}