1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 18:23:09 +02:00

allow concurrent use of host-build.mk and package.mk as well as their templates

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14621 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2009-02-22 18:10:05 +00:00
parent ca3f76d2a5
commit 3d7b088997
3 changed files with 26 additions and 17 deletions

View File

@ -6,7 +6,7 @@
# #
HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) 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)/host.mk
include $(INCLUDE_DIR)/unpack.mk include $(INCLUDE_DIR)/unpack.mk
@ -86,9 +86,10 @@ define Download/default
MD5SUM:=$(PKG_MD5SUM) MD5SUM:=$(PKG_MD5SUM)
endef endef
define HostBuild ifndef DUMP
define HostBuild
$(if $(QUILT),$(Host/Quilt)) $(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)) $(if $(DUMP),,$(call HostHost/Autoclean))
$(HOST_STAMP_PREPARED): $(HOST_STAMP_PREPARED):
@ -111,21 +112,25 @@ define HostBuild
touch $$@ touch $$@
ifdef Host/Install ifdef Host/Install
install: $(HOST_STAMP_INSTALLED) host-install: $(HOST_STAMP_INSTALLED)
endif 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/Clean)
$(call Host/Uninstall) $(call Host/Uninstall)
rm -f $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT) rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
download: endef
prepare: $(HOST_STAMP_PREPARED)
configure: $(HOST_STAMP_CONFIGURED) prepare: host-prepare
compile: $(HOST_STAMP_BUILT) compile: host-compile
install: install: host-install
clean: FORCE clean: host-clean
$(call Host/Clean)
rm -rf $(HOST_BUILD_DIR) endif
endef

View File

@ -69,7 +69,7 @@ define Build/DefaultTargets
$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)) $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
$(call Build/Autoclean) $(call Build/Autoclean)
$(STAMP_PREPARED): $(STAMP_PREPARED): $(HOST_STAMP_INSTALLED)
@-rm -rf $(PKG_BUILD_DIR) @-rm -rf $(PKG_BUILD_DIR)
@mkdir -p $(PKG_BUILD_DIR) @mkdir -p $(PKG_BUILD_DIR)
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep)) $(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))

View File

@ -17,7 +17,7 @@ UNZIP_CMD=unzip -d $(1)/.. $(DL_DIR)/$(PKG_SOURCE)
ifeq ($(PKG_SOURCE),) ifeq ($(PKG_SOURCE),)
PKG_UNPACK ?= true PKG_UNPACK ?= true
endif endif
ifeq ($(strip $(PKG_UNPACK))$(strip $(HOST_UNPACK)),) ifeq ($(strip $(UNPACK_CMD)),)
ifeq ($(strip $(PKG_CAT)),) ifeq ($(strip $(PKG_CAT)),)
# try to autodetect file type # try to autodetect file type
EXT:=$(call ext,$(PKG_SOURCE)) EXT:=$(call ext,$(PKG_SOURCE))
@ -63,6 +63,10 @@ ifeq ($(strip $(PKG_UNPACK))$(strip $(HOST_UNPACK)),)
else else
CRLF_CMD := CRLF_CMD :=
endif endif
endif
ifdef PKG_BUILD_DIR
PKG_UNPACK := $(call UNPACK_CMD,$(PKG_BUILD_DIR)) $(call CRLF_CMD,$(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)) HOST_UNPACK := $(call UNPACK_CMD,$(HOST_BUILD_DIR)) $(call CRLF_CMD,$(HOST_BUILD_DIR))
endif endif