From 14d4be2348f2412c1cf14b89bc4121838d6ff90d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 16 Nov 2012 00:43:08 -0500 Subject: Move user-set target check to common function. --- (limited to 'lib/buildsystem') 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}" -- cgit v0.9.1