summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-06-02 12:08:54 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-06-02 12:08:54 +0200
commit76f89809596006fc79ac7948f443d73f437307cf (patch)
tree0bd37fda77e4087d7da6fb35061db249024f2371 /mk
parent2d4259cc15df8e20dbb5da2396e0dd39a7d29274 (diff)
downloadembtoolkit-76f89809596006fc79ac7948f443d73f437307cf.tar.gz
embtoolkit-76f89809596006fc79ac7948f443d73f437307cf.tar.bz2
embtoolkit-76f89809596006fc79ac7948f443d73f437307cf.tar.xz
Build system: Improve decompress macros
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/macros.mk80
1 files changed, 48 insertions, 32 deletions
diff --git a/mk/macros.mk b/mk/macros.mk
index 1a41b72..a78c4ab 100644
--- a/mk/macros.mk
+++ b/mk/macros.mk
@@ -315,7 +315,7 @@ define __EMBTK_INSTALL_PKG_MAKE
endef
define EMBTK_INSTALL_PKG
@$(if $(shell test -e $($(1)_BUILD_DIR)/.installed && echo y), \
- echo,$(call __EMBTK_INSTALL_PKG_MAKE,$(1)))
+ true,$(call __EMBTK_INSTALL_PKG_MAKE,$(1)))
endef
#
@@ -336,7 +336,7 @@ define __EMBTK_INSTALL_HOSTPKG_MAKE
endef
define EMBTK_INSTALL_HOSTPKG
@$(if $(shell test -e $($(1)_BUILD_DIR)/.installed && echo y), \
- echo,$(call __EMBTK_INSTALL_HOSTPKG_MAKE,$(1)))
+ true,$(call __EMBTK_INSTALL_HOSTPKG_MAKE,$(1)))
endef
#
@@ -383,23 +383,31 @@ endef
#
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; \
+ @if [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARGZ)" == "xy" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.decompressed ]; then \
+ tar -C $(PACKAGES_BUILD) -xzf \
+ $(DOWNLOAD_DIR)/$($(1)_PACKAGE) && \
+ mkdir -p $($(1)_BUILD_DIR) && \
+ touch $($(1)_BUILD_DIR)/.decompressed; \
+ elif [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARBZ2)" == "xy" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.decompressed ]; then \
+ tar -C $(PACKAGES_BUILD) -xjf \
+ $(DOWNLOAD_DIR)/$($(1)_PACKAGE) && \
+ mkdir -p $($(1)_BUILD_DIR) && \
+ touch $($(1)_BUILD_DIR)/.decompressed; \
+ elif [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARBZ2)" == "x" ] && \
+ [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARGZ)" == "x" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.decompressed ]; then \
+ echo -e "\E[1;31m!Unknown package compression type!\E[0m"; \
+ exit 1; \
fi
- @if [ "x$(CONFIG_EMBTK_$(1)_NEED_PATCH)" == "xy" ]; then \
- cd $($(1)_SRC_DIR); \
- patch -p1 < \
- $(DOWNLOAD_DIR)/$($(1)_NAME)-$($(1)_VERSION).patch; \
+ @if [ "x$(CONFIG_EMBTK_$(1)_NEED_PATCH)" == "xy" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.patched ]; then \
+ cd $($(1)_SRC_DIR); \
+ patch -p1 < \
+ $(DOWNLOAD_DIR)/$($(1)_NAME)-$($(1)_VERSION).patch && \
+ touch $($(1)_BUILD_DIR)/.patched; \
fi
- @mkdir -p $($(1)_BUILD_DIR)
- @touch $($(1)_BUILD_DIR)/.decompressed
endef
#
@@ -410,23 +418,31 @@ endef
#
define EMBTK_DECOMPRESS_HOSTPKG
$(call EMBTK_GENERIC_MSG,"Decrompressing $($(1)_PACKAGE) ...")
- @if [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARGZ)" == "xy" ]; then \
- tar -C $(TOOLS_BUILD) -xzf \
- $(DOWNLOAD_DIR)/$($(1)_PACKAGE); \
- elif [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARBZ2)" == "xy" ]; then \
- tar -C $(TOOLS_BUILD) -xjf \
- $(DOWNLOAD_DIR)/$($(1)_PACKAGE); \
- else \
- echo "!!!!Unknown package compression type!!!!"; \
- exit 1; \
+ @if [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARGZ)" == "xy" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.decompressed ]; then \
+ tar -C $(TOOLS_BUILD) -xzf \
+ $(DOWNLOAD_DIR)/$($(1)_PACKAGE) && \
+ mkdir -p $($(1)_BUILD_DIR) && \
+ touch $($(1)_BUILD_DIR)/.decompressed; \
+ elif [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARBZ2)" == "xy" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.decompressed ]; then \
+ tar -C $(TOOLS_BUILD) -xjf \
+ $(DOWNLOAD_DIR)/$($(1)_PACKAGE) && \
+ mkdir -p $($(1)_BUILD_DIR) && \
+ touch $($(1)_BUILD_DIR)/.decompressed; \
+ elif [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARBZ2)" == "x" ] && \
+ [ "x$(CONFIG_EMBTK_$(1)_PKG_IS_TARGZ)" == "x" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.decompressed ]; then \
+ echo -e "\E[1;31m!Unknown package compression type!\E[0m"; \
+ exit 1; \
fi
- @if [ "x$(CONFIG_EMBTK_$(1)_NEED_PATCH)" == "xy" ]; then \
- cd $($(1)_SRC_DIR); \
- patch -p1 < \
- $(DOWNLOAD_DIR)/$($(1)_NAME)-$($(1)_VERSION).patch; \
+ @if [ "x$(CONFIG_EMBTK_$(1)_NEED_PATCH)" == "xy" ] && \
+ [ ! -e $($(1)_BUILD_DIR)/.patched ]; then \
+ cd $($(1)_SRC_DIR); \
+ patch -p1 < \
+ $(DOWNLOAD_DIR)/$($(1)_NAME)-$($(1)_VERSION).patch && \
+ touch $($(1)_BUILD_DIR)/.patched; \
fi
- @mkdir -p $($(1)_BUILD_DIR)
- @touch $($(1)_BUILD_DIR)/.decompressed
endef
#