summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-11-16 00:43:08 (EST)
committer P. J. McDermott <pjm@nac.net>2012-11-16 00:43:08 (EST)
commit14d4be2348f2412c1cf14b89bc4121838d6ff90d (patch)
tree3907d791a65a2313d7d9b14faee3e4c765a9a5ad
parent480c0566de8d3de4b23830e8d7da893248bdbed7 (diff)
Move user-set target check to common function.
-rw-r--r--lib/buildsystem/make.sh25
1 files changed, 9 insertions, 16 deletions
diff --git a/lib/buildsystem/make.sh b/lib/buildsystem/make.sh
index f041e50..2010bed 100644
--- a/lib/buildsystem/make.sh
+++ b/lib/buildsystem/make.sh
@@ -33,12 +33,7 @@ _oh_make_can_build()
_oh_make_build()
{
- if [ -n "${_OH_BUILDSYSTEM_BUILD_TARGET}" ]; then
- _oh_make_update_first_defined_target "${_OH_BUILDSYSTEM_BUILD_TARGET}" \
- "${@}"
- else
- _oh_make_update_first_defined_target '' "${@}"
- fi
+ _oh_make_update_first_defined_target '' "${@}"
}
_oh_make_can_clean()
@@ -68,13 +63,8 @@ _oh_make_can_install()
_oh_make_install()
{
- if [ -n "${_OH_BUILDSYSTEM_BUILD_TARGET}" ]; then
- _oh_make_update_first_defined_target "${_OH_BUILDSYSTEM_BUILD_TARGET}" \
- "${@}" "DESTDIR=${_OH_BUILDSYSTEM_DESTDIR}"
- else
- _oh_make_update_first_defined_target 'install' \
- "${@}" "DESTDIR=${_OH_BUILDSYSTEM_DESTDIR}"
- fi
+ _oh_make_update_first_defined_target 'install' \
+ "${@}" "DESTDIR=${_OH_BUILDSYSTEM_DESTDIR}"
}
_oh_make_update_first_defined_target()
@@ -87,10 +77,10 @@ _oh_make_update_first_defined_target()
mkdir -p "${_OH_BUILDSYSTEM_BUILD_DIR}"
cd "${_OH_BUILDSYSTEM_BUILD_DIR}"
- if [ -z "${_ohbsmufdt_targets}" ]; then
- make "${@}"
+ if [ -n "${_OH_BUILDSYSTEM_BUILD_TARGET}" ]; then
+ make "${@}" "${_OH_BUILDSYSTEM_BUILD_TARGET}"
_ohbsmufdt_rc=${?}
- else
+ elif [ -n "${_ohbsmufdt_targets}" ]; then
for _ohbsmufdt_target in ${_ohbsmufdt_targets}; do
# If the target is defined, ...
if make -n "${_ohbsmufdt_target}" >/dev/null 2>&1; then
@@ -100,6 +90,9 @@ _oh_make_update_first_defined_target()
break
fi
done
+ else
+ make "${@}"
+ _ohbsmufdt_rc=${?}
fi
cd "${_OH_BUILDSYSTEM_WORK_AREA}"