summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/buildsystem.sh3
-rw-r--r--lib/buildsystem/make.sh7
-rw-r--r--man/oh-autobuild.1.in4
-rw-r--r--src/oh-autobuild.sh5
4 files changed, 17 insertions, 2 deletions
diff --git a/lib/buildsystem.sh b/lib/buildsystem.sh
index 0f9b8b0..11d581b 100644
--- a/lib/buildsystem.sh
+++ b/lib/buildsystem.sh
@@ -69,6 +69,9 @@ oh_set_buildsystem_option()
'target-arch')
_OH_BUILDSYSTEM_TARGET_ARCH="${_ohsbso_value}"
;;
+ 'build-target')
+ _OH_BUILDSYSTEM_BUILD_TARGET="${_ohsbso_value}"
+ ;;
*)
_oh_return 125
return ${?}
diff --git a/lib/buildsystem/make.sh b/lib/buildsystem/make.sh
index 5df424a..0268c8c 100644
--- a/lib/buildsystem/make.sh
+++ b/lib/buildsystem/make.sh
@@ -33,7 +33,12 @@ _oh_make_can_build()
_oh_make_build()
{
- _oh_make_update_first_defined_target '' "${@}"
+ 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_can_clean()
diff --git a/man/oh-autobuild.1.in b/man/oh-autobuild.1.in
index 4ebbe16..21b94da 100644
--- a/man/oh-autobuild.1.in
+++ b/man/oh-autobuild.1.in
@@ -29,6 +29,10 @@ instead of trying to detect the one used by the package.
Build in
.I builddir
instead of in the source directory.
+.BI \-T \ buildtarget
+Update the
+.I buildtarget
+target.
.SH COPYRIGHT
Copyright (C) 2012 Patrick "P. J." McDermott
diff --git a/src/oh-autobuild.sh b/src/oh-autobuild.sh
index 1bfe420..1f24d5c 100644
--- a/src/oh-autobuild.sh
+++ b/src/oh-autobuild.sh
@@ -27,7 +27,7 @@ main()
{
oh_init
- while getopts 'S:B:' opt; do
+ while getopts 'S:B:T:' opt; do
case "${opt}" in
S)
oh_set_buildsystem_option 'build-system' "${OPTARG}"
@@ -35,6 +35,9 @@ main()
B)
oh_set_buildsystem_option 'build-dir' "${OPTARG}"
;;
+ T)
+ oh_set_buildsystem_option 'build-target' "${OPTARG}"
+ ;;
?)
ob_error "$(ob_get_msg 'bad_opt')"
exit 1