aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-02-22 18:10:05 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-02-22 18:10:05 +0000
commitaa0778f77efb1d5c0d49e66a9d52ff438bc1ba7d (patch)
tree5e0e39f175532ad6e626f77994a14c87013e35cc /include
parentbc6fcb0067e2af16337cd3144c4c5ab532f09ac0 (diff)
downloadupstream-aa0778f77efb1d5c0d49e66a9d52ff438bc1ba7d.tar.gz
upstream-aa0778f77efb1d5c0d49e66a9d52ff438bc1ba7d.tar.bz2
upstream-aa0778f77efb1d5c0d49e66a9d52ff438bc1ba7d.zip
allow concurrent use of host-build.mk and package.mk as well as their templates
SVN-Revision: 14621
Diffstat (limited to 'include')
-rw-r--r--include/host-build.mk35
-rw-r--r--include/package.mk2
-rw-r--r--include/unpack.mk6
3 files changed, 26 insertions, 17 deletions
diff --git a/include/host-build.mk b/include/host-build.mk
index 3f714cd682..2ce3e1598d 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -6,7 +6,7 @@
#
HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
-PKG_INSTALL_DIR ?= $(HOST_BUILD_DIR)/host-install
+HOST_INSTALL_DIR ?= $(HOST_BUILD_DIR)/host-install
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/unpack.mk
@@ -86,9 +86,10 @@ define Download/default
MD5SUM:=$(PKG_MD5SUM)
endef
-define HostBuild
+ifndef DUMP
+ define HostBuild
$(if $(QUILT),$(Host/Quilt))
- $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
+ $(if $(STAMP_PREPARED),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(DUMP),,$(call HostHost/Autoclean))
$(HOST_STAMP_PREPARED):
@@ -111,21 +112,25 @@ define HostBuild
touch $$@
ifdef Host/Install
- install: $(HOST_STAMP_INSTALLED)
+ host-install: $(HOST_STAMP_INSTALLED)
endif
- package-clean: FORCE
+ download:
+ host-prepare: $(HOST_STAMP_PREPARED)
+ host-configure: $(HOST_STAMP_CONFIGURED)
+ host-compile: $(HOST_STAMP_BUILT)
+ host-install:
+ host-clean: FORCE
$(call Host/Clean)
$(call Host/Uninstall)
- rm -f $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
+ rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
- download:
- prepare: $(HOST_STAMP_PREPARED)
- configure: $(HOST_STAMP_CONFIGURED)
- compile: $(HOST_STAMP_BUILT)
- install:
- clean: FORCE
- $(call Host/Clean)
- rm -rf $(HOST_BUILD_DIR)
+ endef
+
+ prepare: host-prepare
+ compile: host-compile
+ install: host-install
+ clean: host-clean
+
+endif
-endef
diff --git a/include/package.mk b/include/package.mk
index 13dece4c0e..2b28b648b2 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -69,7 +69,7 @@ define Build/DefaultTargets
$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
$(call Build/Autoclean)
- $(STAMP_PREPARED):
+ $(STAMP_PREPARED): $(HOST_STAMP_INSTALLED)
@-rm -rf $(PKG_BUILD_DIR)
@mkdir -p $(PKG_BUILD_DIR)
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
diff --git a/include/unpack.mk b/include/unpack.mk
index ddd5fd11fe..ae8cdecb27 100644
--- a/include/unpack.mk
+++ b/include/unpack.mk
@@ -17,7 +17,7 @@ UNZIP_CMD=unzip -d $(1)/.. $(DL_DIR)/$(PKG_SOURCE)
ifeq ($(PKG_SOURCE),)
PKG_UNPACK ?= true
endif
-ifeq ($(strip $(PKG_UNPACK))$(strip $(HOST_UNPACK)),)
+ifeq ($(strip $(UNPACK_CMD)),)
ifeq ($(strip $(PKG_CAT)),)
# try to autodetect file type
EXT:=$(call ext,$(PKG_SOURCE))
@@ -63,6 +63,10 @@ ifeq ($(strip $(PKG_UNPACK))$(strip $(HOST_UNPACK)),)
else
CRLF_CMD :=
endif
+endif
+ifdef PKG_BUILD_DIR
PKG_UNPACK := $(call UNPACK_CMD,$(PKG_BUILD_DIR)) $(call CRLF_CMD,$(PKG_BUILD_DIR))
+endif
+ifdef HOST_BUILD_DIR
HOST_UNPACK := $(call UNPACK_CMD,$(HOST_BUILD_DIR)) $(call CRLF_CMD,$(HOST_BUILD_DIR))
endif