diff options
-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 |