X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=include%2Fhost-build.mk;h=113e269b4c653af05abac1bec7efb82819492da4;hb=e5e5c3f5fd38f1f0dd8d4672fc64bdd0a1a01add;hp=0bd386781dfbd6d9144c59a12a7708d1e389ab42;hpb=6cf067d084cc551c721e98b6d6c6403a63e521d5;p=openwrt%2Fopenwrt.git diff --git a/include/host-build.mk b/include/host-build.mk index 0bd386781d..113e269b4c 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -19,22 +19,23 @@ else HOST_JOBS?=$(if $(HOST_BUILD_PARALLEL),$(HOST_MAKE_J),-j1) endif -include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/unpack.mk include $(INCLUDE_DIR)/depends.mk +include $(INCLUDE_DIR)/quilt.mk BUILD_TYPES += host -HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))) +HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built -HOST_BUILD_PREFIX:=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST)) +HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST)) HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed override MAKEFLAGS= -include $(INCLUDE_DIR)/quilt.mk include $(INCLUDE_DIR)/autotools.mk +_host_target:=$(if $(HOST_QUILT),,.) + Host/Patch:=$(Host/Patch/Default) ifneq ($(strip $(HOST_UNPACK)),) define Host/Prepare/Default @@ -77,6 +78,10 @@ HOST_MAKE_FLAGS = HOST_CONFIGURE_CMD = $(BASH) ./configure +ifeq ($(HOST_OS),Darwin) + HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin +endif + define Host/Configure/Default $(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \ if [ -x configure ]; then \ @@ -106,7 +111,7 @@ define Host/Compile endef define Host/Install/Default - $(_SINGLE)$(MAKE) -C $(HOST_BUILD_DIR) install + $(call Host/Compile/Default,install) endef define Host/Install @@ -127,6 +132,7 @@ define Host/Exports/Default $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache + $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef Host/Exports=$(Host/Exports/Default) @@ -172,18 +178,29 @@ ifndef DUMP ifndef STAMP_BUILT $(foreach t,$(DEFAULT_SUBDIR_TARGETS), $(t): host-$(t) + .$(t): .host-$(t) ) + clean-build: host-clean-build endif - host-prepare: $(HOST_STAMP_PREPARED) - host-configure: $(HOST_STAMP_CONFIGURED) - host-compile: $(HOST_STAMP_BUILT) $(if $(STAMP_BUILT),$(HOST_STAMP_INSTALLED)) - host-install: $(HOST_STAMP_INSTALLED) - host-clean: FORCE + $(_host_target)host-prepare: $(HOST_STAMP_PREPARED) + $(_host_target)host-configure: $(HOST_STAMP_CONFIGURED) + $(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED) + host-install: host-compile + + host-clean-build: FORCE + rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_BUILT) + + host-clean: host-clean-build $(call Host/Clean) $(call Host/Uninstall) - rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT) + rm -rf $(HOST_STAMP_INSTALLED) + ifneq ($(CONFIG_AUTOREMOVE),) + host-compile: + $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \ + $(XARGS) rm -rf + endif endef endif