diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2011-01-14 21:35:36 +0100 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2011-01-14 21:35:36 +0100 |
commit | 7030661aa5a5a31daa095a15cdb48bba880a66cb (patch) | |
tree | 08bc4ddc140a90621ada8d47eecf4573d29f6f3c /mk/macros.mk | |
parent | bfd7f88d4f295ad41f3fb99e2ce00cf9e1f1c4f6 (diff) | |
download | embtoolkit-7030661aa5a5a31daa095a15cdb48bba880a66cb.tar.gz embtoolkit-7030661aa5a5a31daa095a15cdb48bba880a66cb.tar.bz2 embtoolkit-7030661aa5a5a31daa095a15cdb48bba880a66cb.tar.xz |
Embtk: add macro to decompress packages
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk/macros.mk')
-rw-r--r-- | mk/macros.mk | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mk/macros.mk b/mk/macros.mk index 91467ee..6b418d3 100644 --- a/mk/macros.mk +++ b/mk/macros.mk @@ -281,7 +281,6 @@ define EMBTK_DOWNLOAD_PKG_PATCHES $($(1)_NAME)-$($(1)_VERSION)-*.patch); \ fi endef - define EMBTK_DOWNLOAD_PKG_FROM_MIRROR if [ "x$($(1)_SITE_MIRROR$(2))" == "x" ]; then \ false; \ @@ -304,3 +303,28 @@ define EMBTK_DOWNLOAD_PKG $(call EMBTK_DOWNLOAD_PKG_FROM_MIRROR,$(1),3) || exit 1 $(call EMBTK_DOWNLOAD_PKG_PATCHES,$(1)) endef + +# +# A macro to decompress packages tarball. +# Usage: +# $(call EMBTK_DECOMPRESS_PKG,PACKAGE) +# +define EMBTK_DECOMPRESS_PKG + $(call EMBTK_GENERIC_MSG,"Decrompressing $($(1)_PACKAGE) ...") + @if [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARGZ)" == "xy" ]; then \ + tar -C $(PACKAGES_BUILD) -xzf \ + $(DOWNLOAD_DIR)/$($(1)_PACKAGE); \ + elif [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARBZ2)" == "xy" ]; then \ + tar -C $(PACKAGES_BUILD) -xjf \ + $(DOWNLOAD_DIR)/$($(1)_PACKAGE); \ + else \ + echo "!!!!Unknown package compression type!!!!"; \ + exit 1; \ + fi + @if [ "x$(CONFIG_EMBTK_$(1)_NEED_PATCH)" == "xy" ]; then \ + cd $($(1)_BUILD_DIR); \ + patch -p1 < \ + $(DOWNLOAD_DIR)/$($(1)_NAME)-$($(1)_VERSION).patch; \ + fi + @touch $@ +endef |