summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-09-02 16:38:19 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-09-02 16:54:39 +0200
commitb149882d115e274d3f1ec915e01a2a74f8e64da1 (patch)
treed44611cd574de8eb9f4ebd10a560882cd4207221 /mk
parent5bea5d800a0c4d92c91de16c71b371a7e519c6d2 (diff)
downloadembtoolkit-b149882d115e274d3f1ec915e01a2a74f8e64da1.tar.gz
embtoolkit-b149882d115e274d3f1ec915e01a2a74f8e64da1.tar.bz2
embtoolkit-b149882d115e274d3f1ec915e01a2a74f8e64da1.tar.xz
Build system: generic macros: try to minimize errors while calling generic install macros
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/macros.mk46
1 files changed, 34 insertions, 12 deletions
diff --git a/mk/macros.mk b/mk/macros.mk
index 244c70c..89eeb7e 100644
--- a/mk/macros.mk
+++ b/mk/macros.mk
@@ -459,15 +459,31 @@ define __embtk_install_hostpkg_make
endef
#
+# A macro to exit with error when needed package variables not define.
+# Usage:
+# $(call __embtk_install_paramsfailure,pkgname)
+#
+define __embtk_install_paramsfailure
+ $(call embtk_perror,"!Not all needed variables defined for $(1)!")
+ exit 1
+endef
+
+__embtk_xinstall_xpkg_allvarset-y = $(and $(__embtk_pkg_name), \
+ $(__embtk_pkg_version), \
+ $(__embtk_pkg_site))
+
+#
# A macro to install automatically a package, using autotools scripts, intended
# to run on the target
# Usage:
# $(call embtk_install_pkg,package)
#
define embtk_install_pkg
- $(if $(__embtk_pkg_installed-y),true,
- $(call __embtk_install_pkg_make,$(1),autotools))
- $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv)))
+ $(if $(__embtk_xinstall_xpkg_allvarset-y),
+ $(if $(__embtk_pkg_installed-y),true,
+ $(call __embtk_install_pkg_make,$(1),autotools))
+ $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv))),
+ $(call __embtk_install_paramsfailure,$(1)))
endef
#
@@ -477,9 +493,11 @@ endef
# $(call embtk_makeinstall_pkg,package)
#
define embtk_makeinstall_pkg
- $(if $(__embtk_pkg_installed-y),true,
- $(call __embtk_install_pkg_make,$(1)))
- $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv)))
+ $(if $(__embtk_xinstall_xpkg_allvarset-y),
+ $(if $(__embtk_pkg_installed-y),true,
+ $(call __embtk_install_pkg_make,$(1)))
+ $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv))),
+ $(call __embtk_install_paramsfailure,$(1)))
endef
#
@@ -489,9 +507,11 @@ endef
# $(call embtk_install_hostpkg,package)
#
define embtk_install_hostpkg
- $(if $(__embtk_pkg_installed-y),true,
- $(call __embtk_install_hostpkg_make,$(1),autotools))
- $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv)))
+ $(if $(__embtk_xinstall_xpkg_allvarset-y),
+ $(if $(__embtk_pkg_installed-y),true,
+ $(call __embtk_install_hostpkg_make,$(1),autotools))
+ $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv))),
+ $(call __embtk_install_paramsfailure,$(1)))
endef
#
@@ -501,9 +521,11 @@ endef
# $(call embtk_makeinstall_hostpkg,package)
#
define embtk_makeinstall_hostpkg
- $(if $(__embtk_pkg_installed-y),true,
- $(call __embtk_install_hostpkg_make,$(1)))
- $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv)))
+ $(if $(__embtk_xinstall_xpkg_allvarset-y),
+ $(if $(__embtk_pkg_installed-y),true,
+ $(call __embtk_install_hostpkg_make,$(1)))
+ $(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv))),
+ $(call __embtk_install_paramsfailure,$(1)))
endef
#