From: Felix Fietkau Date: Sun, 22 Feb 2009 04:37:20 +0000 (+0000) Subject: build system refactoring in preparation for allowing packages to do host-build steps X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7eb15898755be46e94078faffdacd8c9b0ce66cd;p=openwrt%2Fstaging%2Frobimarko.git build system refactoring in preparation for allowing packages to do host-build steps SVN-Revision: 14610 --- diff --git a/include/download.mk b/include/download.mk index 0a2dd3c03f..811c42a3c3 100644 --- a/include/download.mk +++ b/include/download.mk @@ -5,7 +5,7 @@ # See /LICENSE for more information. # -DOWNLOAD_RDEP:=$(STAMP_PREPARED) +DOWNLOAD_RDEP:=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED) # Try to guess the download method from the URL define dl_method diff --git a/include/host-build.mk b/include/host-build.mk index 5622e98707..fdba1b36cb 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -5,40 +5,40 @@ # See /LICENSE for more information. # -PKG_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) -PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/host-install +HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) +PKG_INSTALL_DIR ?= $(HOST_BUILD_DIR)/host-install include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/unpack.mk include $(INCLUDE_DIR)/depends.mk -STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPEND),))) -STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured -STAMP_BUILT:=$(PKG_BUILD_DIR)/.built -STAMP_INSTALLED:=$(STAGING_DIR_HOST)/stamp/.$(PKG_NAME)_installed +HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPEND),))) +HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured +HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built +HOST_STAMP_INSTALLED:=$(STAGING_DIR_HOST)/stamp/.$(PKG_NAME)_installed override MAKEFLAGS= include $(INCLUDE_DIR)/download.mk include $(INCLUDE_DIR)/quilt.mk -Build/Patch:=$(Build/Patch/Default) -ifneq ($(strip $(PKG_UNPACK)),) - define Build/Prepare/Default - $(PKG_UNPACK) - $(Build/Patch) - $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used) +Host/Patch:=$(Host/Patch/Default) +ifneq ($(strip $(HOST_UNPACK)),) + define Host/Prepare/Default + $(HOST_UNPACK) + $(Host/Patch) + $(if $(QUILT),touch $(HOST_BUILD_DIR)/.quilt_used) endef endif -define Build/Prepare - $(call Build/Prepare/Default) +define Host/Prepare + $(call Host/Prepare/Default) endef -define Build/Configure/Default - @(cd $(PKG_BUILD_DIR)/$(3); \ +define Host/Configure/Default + @(cd $(HOST_BUILD_DIR)/$(3); \ [ -x configure ] && \ - $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/$(3)/ && \ + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/$(3)/ && \ $(2) \ CPPFLAGS="$(HOST_CFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \ @@ -59,22 +59,22 @@ define Build/Configure/Default ) endef -define Build/Configure - $(call Build/Configure/Default) +define Host/Configure + $(call Host/Configure/Default) endef -define Build/Compile/Default - $(MAKE) -C $(PKG_BUILD_DIR) $(1) +define Host/Compile/Default + $(MAKE) -C $(HOST_BUILD_DIR) $(1) endef -define Build/Compile - $(call Build/Compile/Default) +define Host/Compile + $(call Host/Compile/Default) endef ifneq ($(if $(QUILT),,$(CONFIG_AUTOREBUILD)),) - define HostBuild/Autoclean - $(call rdep,${CURDIR} $(PKG_FILE_DEPEND),$(STAMP_PREPARED)) - $(if $(if $(Build/Compile),$(filter prepare,$(MAKECMDGOALS)),1),,$(call rdep,$(PKG_BUILD_DIR),$(STAMP_BUILT))) + define HostHost/Autoclean + $(call rdep,${CURDIR} $(PKG_FILE_DEPEND),$(HOST_STAMP_PREPARED)) + $(if $(if $(Host/Compile),$(filter prepare,$(MAKECMDGOALS)),1),,$(call rdep,$(HOST_BUILD_DIR),$(HOST_STAMP_BUILT))) endef endif @@ -88,45 +88,45 @@ define Download/default endef define HostBuild - $(if $(QUILT),$(Build/Quilt)) + $(if $(QUILT),$(Host/Quilt)) $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)) - $(if $(DUMP),,$(call HostBuild/Autoclean)) + $(if $(DUMP),,$(call HostHost/Autoclean)) - $(STAMP_PREPARED): - @-rm -rf $(PKG_BUILD_DIR) - @mkdir -p $(PKG_BUILD_DIR) - $(call Build/Prepare) + $(HOST_STAMP_PREPARED): + @-rm -rf $(HOST_BUILD_DIR) + @mkdir -p $(HOST_BUILD_DIR) + $(call Host/Prepare) touch $$@ - $(STAMP_CONFIGURED): $(STAMP_PREPARED) - $(call Build/Configure) + $(HOST_STAMP_CONFIGURED): $(HOST_STAMP_PREPARED) + $(call Host/Configure) touch $$@ - $(STAMP_BUILT): $(STAMP_CONFIGURED) - $(call Build/Compile) + $(HOST_STAMP_BUILT): $(HOST_STAMP_CONFIGURED) + $(call Host/Compile) touch $$@ - $(STAMP_INSTALLED): $(STAMP_BUILT) - $(call Build/Install) + $(HOST_STAMP_INSTALLED): $(HOST_STAMP_BUILT) + $(call Host/Install) mkdir -p $$(shell dirname $$@) touch $$@ - ifdef Build/Install - install: $(STAMP_INSTALLED) + ifdef Host/Install + install: $(HOST_STAMP_INSTALLED) endif package-clean: FORCE - $(call Build/Clean) - $(call Build/Uninstall) - rm -f $(STAMP_INSTALLED) $(STAMP_BUILT) + $(call Host/Clean) + $(call Host/Uninstall) + rm -f $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT) download: - prepare: $(STAMP_PREPARED) - configure: $(STAMP_CONFIGURED) - compile: $(STAMP_BUILT) + prepare: $(HOST_STAMP_PREPARED) + configure: $(HOST_STAMP_CONFIGURED) + compile: $(HOST_STAMP_BUILT) install: clean: FORCE - $(call Build/Clean) - rm -rf $(PKG_BUILD_DIR) + $(call Host/Clean) + rm -rf $(HOST_BUILD_DIR) endef diff --git a/include/quilt.mk b/include/quilt.mk index fb8efacaa7..358b64ba0a 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -25,47 +25,65 @@ sed -e s,\\\#.*,, $(1) | grep -E \[a-zA-Z0-9\] endef define PatchDir/Quilt - @if [ -s $(1)/series ]; then \ - mkdir -p $(PKG_BUILD_DIR)/patches/$(2); \ - cp $(1)/series $(PKG_BUILD_DIR)/patches/$(2); \ + @if [ -s "$(2)/series" ]; then \ + mkdir -p "$(1)/patches/$(3)"; \ + cp "$(2)/series" "$(1)/patches/$(3)"; \ fi - @for patch in $$$$( (cd $(1) && if [ -f series ]; then $(call filter_series,series); else ls; fi; ) 2>/dev/null ); do ( \ - cp "$(1)/$$$$patch" $(PKG_BUILD_DIR); \ - cd $(PKG_BUILD_DIR); \ - $(QUILT_CMD) import -P$(2)$$$$patch -p 1 "$$$$patch"; \ + @for patch in $$$$( (cd "$(2)" && if [ -f series ]; then $(call filter_series,series); else ls; fi; ) 2>/dev/null ); do ( \ + cp "$(2)/$$$$patch" "$(1)"; \ + cd "$(1)"; \ + $(QUILT_CMD) import -P$(3)$$$$patch -p 1 "$$$$patch"; \ $(QUILT_CMD) push -f >/dev/null 2>/dev/null; \ rm -f "$$$$patch"; \ ); done - $(if $(2),@echo $(2) >> $(PKG_BUILD_DIR)/patches/.subdirs) + $(if $(3),@echo $(3) >> "$(1)/patches/.subdirs") endef define PatchDir/Default - @if [ -d "$(1)" -a "$$$$(ls $(1) | wc -l)" -gt 0 ]; then \ - if [ -s "$(1)/series" ]; then \ - $(call filter_series,$(1)/series) | xargs -n1 \ - $(PATCH) $(PKG_BUILD_DIR) "$(1)"; \ + @if [ -d "$(2)" -a "$$$$(ls $(2) | wc -l)" -gt 0 ]; then \ + if [ -s "$(2)/series" ]; then \ + $(call filter_series,$(2)/series) | xargs -n1 \ + $(PATCH) "$(1)" "$(2)"; \ else \ - $(PATCH) $(PKG_BUILD_DIR) "$(1)"; \ + $(PATCH) "$(1)" "$(2)"; \ fi; \ fi endef define PatchDir -$(call PatchDir/$(if $(strip $(QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2))) +$(call PatchDir/$(if $(strip $(QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)),$(strip $(3))) endef -QUILT?=$(strip $(shell test -f $(PKG_BUILD_DIR)/.quilt_used && echo y)) -ifneq ($(QUILT),) - STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched - STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked - override CONFIG_AUTOREBUILD= - prepare: $(STAMP_PATCHED) - quilt-check: $(STAMP_CHECKED) +ifneq ($(PKG_BUILD_DIR),) + QUILT?=$(strip $(shell test -f $(PKG_BUILD_DIR)/.quilt_used && echo y)) + ifneq ($(QUILT),) + STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched + STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked + override CONFIG_AUTOREBUILD= + prepare: $(STAMP_PATCHED) + quilt-check: $(STAMP_CHECKED) + endif endif +ifneq ($(HOST_BUILD_DIR),) + HOST_QUILT?=$(strip $(shell test -f $(if $(PKG_BUILD_DIR),$(PKG_BUILD_DIR),$(HOST_BUILD_DIR))/.quilt_used && echo y)) + ifneq ($(HOST_QUILT),) + HOST_STAMP_PATCHED:=$(HOST_BUILD_DIR)/.quilt_patched + HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked + override CONFIG_AUTOREBUILD= + host-prepare: $(HOST_STAMP_PATCHED) + host-quilt-check: $(HOST_STAMP_CHECKED) + endif +endif + +define Host/Patch/Default + $(if $(QUILT),rm -rf $(HOST_BUILD_DIR)/patches; mkdir -p $(HOST_BUILD_DIR)/patches) + $(call PatchDir,$(HOST_BUILD_DIR),$(PATCH_DIR),) +endef + define Build/Patch/Default $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches) - $(call PatchDir,$(PATCH_DIR),) + $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),) endef kernel_files=$(foreach fdir,$(GENERIC_FILES_DIR) $(FILES_DIR),$(fdir)/.) @@ -73,22 +91,26 @@ define Kernel/Patch/Default rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches $(if $(kernel_files),$(CP) $(kernel_files) $(LINUX_DIR)/) find $(LINUX_DIR)/ -name \*.rej -or -name \*.orig | $(XARGS) rm -f - $(call PatchDir,$(GENERIC_PATCH_DIR),generic/) - $(call PatchDir,$(PATCH_DIR),platform/) + $(call PatchDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/) + $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/) endef define Quilt/RefreshDir - mkdir -p $(1) - -rm -f $(1)/* 2>/dev/null >/dev/null + mkdir -p $(2) + -rm -f $(2)/* 2>/dev/null >/dev/null @( \ - for patch in $$$$($(if $(2),grep "^$(2)",cat) $(PKG_BUILD_DIR)/patches/series | awk '{print $$$$1}'); do \ - $(CP) -v "$(PKG_BUILD_DIR)/patches/$$$$patch" $(1); \ + for patch in $$$$($(if $(3),grep "^$(3)",cat) $(PKG_BUILD_DIR)/patches/series | awk '{print $$$$1}'); do \ + $(CP) -v "$(PKG_BUILD_DIR)/patches/$$$$patch" $(2); \ done; \ ) endef +define Quilt/Refresh/Host + $(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(PATCH_DIR)) +endef + define Quilt/Refresh/Package - $(call Quilt/RefreshDir,$(PATCH_DIR)) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)) endef define Quilt/Refresh/Kernel @@ -96,18 +118,14 @@ define Quilt/Refresh/Kernel echo "All kernel patches must start with either generic/ or platform/"; \ false; \ } - $(call Quilt/RefreshDir,$(GENERIC_PATCH_DIR),generic/) - $(call Quilt/RefreshDir,$(PATCH_DIR),platform/) -endef - -define Quilt/Refresh -$(if $(TARGET_BUILD),$(Quilt/Refresh/Kernel),$(Quilt/Refresh/Package)) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/) + $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/) endef define Build/Quilt - $(STAMP_PATCHED): $(STAMP_PREPARED) + $($(2)STAMP_PATCHED): $($(2)STAMP_PREPARED) @( \ - cd $(PKG_BUILD_DIR)/patches; \ + cd $(1)/patches; \ $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null; \ if [ -s ".subdirs" ]; then \ rm -f series; \ @@ -124,36 +142,47 @@ define Build/Quilt find * -type f \! -name series | sort > series; \ fi; \ ) - touch $$@ - - $(STAMP_CONFIGURED): $(STAMP_CHECKED) FORCE - $(STAMP_CHECKED): $(STAMP_PATCHED) - if [ -s "$(PKG_BUILD_DIR)/patches/series" ]; then (cd $(PKG_BUILD_DIR); if $(QUILT_CMD) next >/dev/null 2>&1; then $(QUILT_CMD) push -a; else $(QUILT_CMD) top >/dev/null 2>&1; fi); fi - touch $$@ + touch "$$@" + + $($(2)STAMP_CONFIGURED): $($(2)STAMP_CHECKED) FORCE + $($(2)STAMP_CHECKED): $($(2)STAMP_PATCHED) + if [ -s "$(1)/patches/series" ]; then \ + (cd "$(1)"; \ + if $(QUILT_CMD) next >/dev/null 2>&1; then \ + $(QUILT_CMD) push -a; \ + else \ + $(QUILT_CMD) top >/dev/null 2>&1; \ + fi \ + ); \ + fi + touch "$$@" - quilt-check: $(STAMP_PREPARED) FORCE - @[ -f "$(PKG_BUILD_DIR)/.quilt_used" ] || { \ + $(3)quilt-check: $($(2)STAMP_PREPARED) FORCE + @[ -f "$(1)/.quilt_used" ] || { \ echo "The source directory was not unpacked using quilt. Please rebuild with QUILT=1"; \ false; \ } - @[ -f "$(PKG_BUILD_DIR)/patches/series" ] || { \ + @[ -f "$(1)/patches/series" ] || { \ echo "The source directory contains no quilt patches."; \ false; \ } - @[ -n "$$$$(ls $(PKG_BUILD_DIR)/patches/series)" -o "$$$$(cat $(PKG_BUILD_DIR)/patches/series | md5sum)" = "$$(sort $(PKG_BUILD_DIR)/patches/series | md5sum)" ] || { \ + @[ -n "$$$$(ls $(1)/patches/series)" -o "$$$$(cat $(1)/patches/series | md5sum)" = "$$(sort $(1)/patches/series | md5sum)" ] || { \ echo "The patches are not sorted in the right order. Please fix."; \ false; \ } - refresh: quilt-check - @cd $(PKG_BUILD_DIR); $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null - @cd $(PKG_BUILD_DIR); while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \ + $(3)refresh: $(3)quilt-check + @cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null + @cd "$(1)"; while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \ QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \ done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null - $(Quilt/Refresh) + $(Quilt/Refresh/$(4)) - update: quilt-check - $(Quilt/Refresh) + $(3)update: $(3)quilt-check + $(Quilt/Refresh/$(4)) endef +Build/Quilt=$(call Quilt/Template,$(PKG_BUILD_DIR),,,$(if $(TARGET_BUILD),Kernel,Package)) +Host/Quilt=$(call Quilt/Template,$(HOST_BUILD_DIR),HOST_,host-,Host) + endif diff --git a/include/unpack.mk b/include/unpack.mk index 9b68e5dea3..ddd5fd11fe 100644 --- a/include/unpack.mk +++ b/include/unpack.mk @@ -11,13 +11,13 @@ ifneq ($(HOST_OS),Linux) else HOST_TAR:=$(TAR) endif -TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) -UNZIP_CMD:=unzip -d $(PKG_BUILD_DIR)/.. $(DL_DIR)/$(PKG_SOURCE) +TAR_CMD=$(HOST_TAR) -C $(1)/.. $(TAR_OPTIONS) +UNZIP_CMD=unzip -d $(1)/.. $(DL_DIR)/$(PKG_SOURCE) ifeq ($(PKG_SOURCE),) PKG_UNPACK ?= true endif -ifeq ($(strip $(PKG_UNPACK)),) +ifeq ($(strip $(PKG_UNPACK))$(strip $(HOST_UNPACK)),) ifeq ($(strip $(PKG_CAT)),) # try to autodetect file type EXT:=$(call ext,$(PKG_SOURCE)) @@ -25,40 +25,44 @@ ifeq ($(strip $(PKG_UNPACK)),) ifeq ($(filter gz tgz,$(EXT)),$(EXT)) EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=)) - UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | - endif + DECOMPRESS_CMD:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | + endif ifeq ($(filter bzip2 bz2 bz tbz2 tbz,$(EXT)),$(EXT)) EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=)) - UNPACK:=bzcat $(DL_DIR)/$(PKG_SOURCE) | + DECOMPRESS_CMD:=bzcat $(DL_DIR)/$(PKG_SOURCE) | endif ifeq ($(filter tgz tbz tbz2,$(EXT1)),$(EXT1)) EXT:=tar endif - UNPACK ?= cat $(DL_DIR)/$(PKG_SOURCE) | + DECOMPRESS_CMD ?= cat $(DL_DIR)/$(PKG_SOURCE) | ifeq ($(EXT),tar) - PKG_UNPACK:=$(UNPACK) $(TAR_CMD) + UNPACK_CMD=$(DECOMPRESS_CMD) $(TAR_CMD) endif ifeq ($(EXT),cpio) - PKG_UNPACK:=$(UNPACK) (cd $(PKG_BUILD_DIR)/..; cpio -i -d) + UNPACK_CMD=$(DECOMPRESS_CMD) (cd $(1)/..; cpio -i -d) endif ifeq ($(EXT),zip) - PKG_UNPACK:=$(UNZIP_CMD) + UNPACK_CMD=$(UNZIP_CMD) endif endif - + # compatibility code for packages that set PKG_CAT - ifeq ($(strip $(PKG_UNPACK)),) + ifeq ($(strip $(UNPACK_CMD)),) # use existing PKG_CAT - PKG_UNPACK:=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD) + UNPACK_CMD=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD) ifeq ($(PKG_CAT),unzip) - PKG_UNPACK:=$(UNZIP_CMD) + UNPACK_CMD=$(UNZIP_CMD) endif # replace zcat with $(ZCAT), because some system don't support it properly ifeq ($(PKG_CAT),zcat) - PKG_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD) + UNPACK_CMD=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD) endif endif ifneq ($(strip $(CRLF_WORKAROUND)),) - PKG_UNPACK += && find $(PKG_BUILD_DIR) -type f -print0 | xargs -0 perl -pi -e 's!\r$$$$!!g' + CRLF_CMD := && find $(PKG_BUILD_DIR) -type f -print0 | xargs -0 perl -pi -e 's!\r$$$$!!g' + else + CRLF_CMD := endif + PKG_UNPACK := $(call UNPACK_CMD,$(PKG_BUILD_DIR)) $(call CRLF_CMD,$(PKG_BUILD_DIR)) + HOST_UNPACK := $(call UNPACK_CMD,$(HOST_BUILD_DIR)) $(call CRLF_CMD,$(HOST_BUILD_DIR)) endif diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index dba6d45688..b0b65f381b 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -61,30 +61,30 @@ ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) endif -define Build/Prepare - $(call Build/Prepare/Default) +define Host/Prepare + $(call Host/Prepare/Default) ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ endef -define Build/Configure - (cd $(PKG_BUILD_DIR); \ +define Host/Configure + (cd $(HOST_BUILD_DIR); \ $(BINUTILS_CONFIGURE) \ ); endef -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) all +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) all endef -define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) install +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) install $(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ + $(HOST_BUILD_DIR) \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) endef diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile index 6e4e3e025f..4eabbbfe6c 100644 --- a/toolchain/eglibc/Makefile +++ b/toolchain/eglibc/Makefile @@ -35,7 +35,7 @@ PATCH_DIR:=./patches/$(PKG_VERSION) STAGING_DIR_HOST:=$(TOOLCHAIN_DIR) BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN) -PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_SUBDIR) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_SUBDIR) override CONFIG_AUTOREBUILD= @@ -44,8 +44,8 @@ include $(INCLUDE_DIR)/host-build.mk STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.eglibc_built STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.eglibc_installed -PKG_BUILD_DIR1:=$(PKG_BUILD_DIR)-initial -PKG_BUILD_DIR2:=$(PKG_BUILD_DIR)-final +HOST_BUILD_DIR1:=$(HOST_BUILD_DIR)-initial +HOST_BUILD_DIR2:=$(HOST_BUILD_DIR)-final # XXX: {e,}glibc does not build w/ -Os # http://sourceware.org/bugzilla/show_bug.cgi?id=5203 @@ -55,7 +55,7 @@ EGLIBC_CONFIGURE:= \ BUILD_CC="$(HOSTCC)" \ $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(EGLIBC_CFLAGS)" \ - $(PKG_BUILD_DIR)/libc/configure \ + $(HOST_BUILD_DIR)/libc/configure \ --prefix=/usr \ --build=$(GNU_HOST_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \ @@ -77,7 +77,7 @@ EGLIBC_MAKE:= \ $(MAKE) \ -define Build/SetToolchainInfo +define Host/SetToolchainInfo $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.eglibc.org/,' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk @@ -85,9 +85,9 @@ define Build/SetToolchainInfo endef define Stage1/Configure - mkdir -p $(PKG_BUILD_DIR1) - $(CP) $(PKG_BUILD_DIR)/libc/option-groups.config $(PKG_BUILD_DIR1)/ - ( cd $(PKG_BUILD_DIR1); rm -f config.cache; \ + mkdir -p $(HOST_BUILD_DIR1) + $(CP) $(HOST_BUILD_DIR)/libc/option-groups.config $(HOST_BUILD_DIR1)/ + ( cd $(HOST_BUILD_DIR1); rm -f config.cache; \ $(EGLIBC_CONFIGURE) \ ); endef @@ -97,13 +97,13 @@ endef define Stage1/Install mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/{include,lib} - $(EGLIBC_MAKE) -C $(PKG_BUILD_DIR1) \ + $(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \ install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ install-bootstrap-headers=yes \ install-headers - $(EGLIBC_MAKE) -C $(PKG_BUILD_DIR1) \ + $(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \ csu/subdir_lib - ( cd $(PKG_BUILD_DIR1); \ + ( cd $(HOST_BUILD_DIR1); \ $(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/lib/ \ ) $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ @@ -111,19 +111,19 @@ define Stage1/Install endef define Stage2/Configure - mkdir -p $(PKG_BUILD_DIR2) - $(CP) $(PKG_BUILD_DIR)/libc/option-groups.config $(PKG_BUILD_DIR2)/ - ( cd $(PKG_BUILD_DIR2); rm -f config.cache; \ + mkdir -p $(HOST_BUILD_DIR2) + $(CP) $(HOST_BUILD_DIR)/libc/option-groups.config $(HOST_BUILD_DIR2)/ + ( cd $(HOST_BUILD_DIR2); rm -f config.cache; \ $(EGLIBC_CONFIGURE) \ ); endef define Stage2/Compile - $(EGLIBC_MAKE) -C $(PKG_BUILD_DIR2) all + $(EGLIBC_MAKE) -C $(HOST_BUILD_DIR2) all endef define Stage2/Install - $(EGLIBC_MAKE) -C $(PKG_BUILD_DIR2) \ + $(EGLIBC_MAKE) -C $(HOST_BUILD_DIR2) \ install_root="$(TOOLCHAIN_DIR)" \ install ( cd $(TOOLCHAIN_DIR) ; \ @@ -137,33 +137,33 @@ define Stage2/Install ) endef -define Build/Prepare - $(call Build/SetToolchainInfo) - $(call Build/Prepare/Default) +define Host/Prepare + $(call Host/SetToolchainInfo) + $(call Host/Prepare/Default) ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(SED) 's,y,n,' $(PKG_BUILD_DIR)/libc/option-groups.defaults - grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/libc/option-groups.config - ln -sf ../ports $(PKG_BUILD_DIR)/libc/ - ( cd $(PKG_BUILD_DIR)/libc; autoconf --force ) + $(SED) 's,y,n,' $(HOST_BUILD_DIR)/libc/option-groups.defaults + grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(HOST_BUILD_DIR)/libc/option-groups.config + ln -sf ../ports $(HOST_BUILD_DIR)/libc/ + ( cd $(HOST_BUILD_DIR)/libc; autoconf --force ) $(call Stage1/Configure) $(call Stage1/Compile) $(call Stage1/Install) endef -define Build/Configure +define Host/Configure endef -define Build/Compile +define Host/Compile $(call Stage2/Configure) $(call Stage2/Compile) $(call Stage2/Install) endef -define Build/Install +define Host/Install endef -define Build/Clean - rm -rf $(PKG_BUILD_DIR) $(PKG_BUILD_DIR1) $(PKG_BUILD_DIR2) \ +define Host/Clean + rm -rf $(HOST_BUILD_DIR) $(HOST_BUILD_DIR1) $(HOST_BUILD_DIR2) \ $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) endef diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 039643db9b..10dab856fd 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -56,16 +56,16 @@ include $(INCLUDE_DIR)/host-build.mk STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed -PKG_BUILD_DIR0:=$(PKG_BUILD_DIR)-minimal -PKG_BUILD_DIR1:=$(PKG_BUILD_DIR)-initial -PKG_BUILD_DIR2:=$(PKG_BUILD_DIR)-final +HOST_BUILD_DIR0:=$(HOST_BUILD_DIR)-minimal +HOST_BUILD_DIR1:=$(HOST_BUILD_DIR)-initial +HOST_BUILD_DIR2:=$(HOST_BUILD_DIR)-final SEP:=, TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)" GCC_CONFIGURE:= \ SHELL="$(BASH)" \ - $(PKG_BUILD_DIR)/configure \ + $(HOST_BUILD_DIR)/configure \ --prefix=$(TOOLCHAIN_DIR)/usr \ --build=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ @@ -138,45 +138,45 @@ GCC_MAKE:= \ $(MAKE) \ -define Build/SetToolchainInfo +define Host/SetToolchainInfo $(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk endef define Stage0/Configure - mkdir -p $(PKG_BUILD_DIR0) - (cd $(PKG_BUILD_DIR0); rm -f config.cache; \ + mkdir -p $(HOST_BUILD_DIR0) + (cd $(HOST_BUILD_DIR0); rm -f config.cache; \ $(GCC_CONFIGURE_STAGE0) \ ); endef define Stage0/Compile - $(GCC_MAKE) -C $(PKG_BUILD_DIR0) all-gcc + $(GCC_MAKE) -C $(HOST_BUILD_DIR0) all-gcc endef define Stage0/Install - $(GCC_MAKE) -C $(PKG_BUILD_DIR0) install-gcc + $(GCC_MAKE) -C $(HOST_BUILD_DIR0) install-gcc endef define Stage1/Configure - mkdir -p $(PKG_BUILD_DIR1) - (cd $(PKG_BUILD_DIR1); rm -f config.cache; \ + mkdir -p $(HOST_BUILD_DIR1) + (cd $(HOST_BUILD_DIR1); rm -f config.cache; \ $(GCC_CONFIGURE_STAGE1) \ ); endef define Stage1/Compile $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ - $(GCC_MAKE) -C $(PKG_BUILD_DIR1) \ + $(GCC_MAKE) -C $(HOST_BUILD_DIR1) \ all-build-libiberty \ all-gcc \ $(if $(GCC_BUILD_TARGET_LIBGCC),all-target-libgcc) endef define Stage1/Install - $(GCC_MAKE) -C $(PKG_BUILD_DIR1) \ + $(GCC_MAKE) -C $(HOST_BUILD_DIR1) \ install-gcc \ $(if $(GCC_BUILD_TARGET_LIBGCC),install-target-libgcc) @@ -188,19 +188,19 @@ endef define Stage2/Configure - mkdir -p $(PKG_BUILD_DIR2) $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME) + mkdir -p $(HOST_BUILD_DIR2) $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME) # Important! Required for limits.h to be fixed. rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include ln -sf ../include $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib ln -sf ../lib $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib - (cd $(PKG_BUILD_DIR2); rm -f config.cache; \ + (cd $(HOST_BUILD_DIR2); rm -f config.cache; \ $(GCC_CONFIGURE_STAGE2) \ ); endef define Stage2/Compile - $(GCC_MAKE) -C $(PKG_BUILD_DIR2) all + $(GCC_MAKE) -C $(HOST_BUILD_DIR2) all endef define SetupExtraArch @@ -217,7 +217,7 @@ define SetupExtraArch endef define Stage2/Install - $(GCC_MAKE) -C $(PKG_BUILD_DIR2) install + $(GCC_MAKE) -C $(HOST_BUILD_DIR2) install # Set up the symlinks to enable lying about target name. set -e; \ (cd $(TOOLCHAIN_DIR)/usr; \ @@ -232,41 +232,41 @@ define Stage2/Install endef -define Build/Prepare - $(call Build/SetToolchainInfo) - $(call Build/Prepare/Default) +define Host/Prepare + $(call Host/SetToolchainInfo) + $(call Host/Prepare/Default) ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ - $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c - $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1\2,' $(PKG_BUILD_DIR)/gcc/version.c - (cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;); - $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ + $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(HOST_BUILD_DIR)/gcc/version.c + $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1\2,' $(HOST_BUILD_DIR)/gcc/version.c + (cd $(HOST_BUILD_DIR)/libstdc++-v3; autoconf;); + $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(HOST_BUILD_DIR)/libstdc++-v3/configure $(call Stage0/Configure) $(call Stage0/Compile) $(call Stage0/Install) endef -define Build/Configure +define Host/Configure endef -define Build/Compile +define Host/Compile $(call Stage1/Configure) $(call Stage1/Compile) $(call Stage1/Install) endef -define Build/Install +define Host/Install $(call Stage2/Configure) $(call Stage2/Compile) $(call Stage2/Install) endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ - $(PKG_BUILD_DIR0) \ - $(PKG_BUILD_DIR1) \ - $(PKG_BUILD_DIR2) \ + $(HOST_BUILD_DIR) \ + $(HOST_BUILD_DIR0) \ + $(HOST_BUILD_DIR1) \ + $(HOST_BUILD_DIR2) \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME) \ $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gc* \ diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index be3e423a1c..4911faef1c 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -19,11 +19,11 @@ BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN) include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - (cd $(PKG_BUILD_DIR); \ +define Host/Configure + (cd $(HOST_BUILD_DIR); \ gdb_cv_func_sigsetjmp=yes \ CFLAGS="-O2" \ - $(PKG_BUILD_DIR)/configure \ + $(HOST_BUILD_DIR)/configure \ --prefix=$(TOOLCHAIN_DIR)/usr \ --build=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ @@ -36,20 +36,20 @@ define Build/Configure ); endef -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) endef -define Build/Install +define Host/Install mkdir -p $(TOOLCHAIN_DIR)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb + $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb strip $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ + $(HOST_BUILD_DIR) \ $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb \ $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb endef diff --git a/toolchain/glibc-ports/Makefile b/toolchain/glibc-ports/Makefile index d9e5d0d7f5..a60b71f431 100644 --- a/toolchain/glibc-ports/Makefile +++ b/toolchain/glibc-ports/Makefile @@ -34,23 +34,23 @@ include $(INCLUDE_DIR)/host-build.mk STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.glibc-ports_built STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc-ports_installed -define Build/Prepare -$(call Build/Prepare/Default) +define Host/Prepare +$(call Host/Prepare/Default) ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) endef -define Build/Configure +define Host/Configure endef -define Build/Compile +define Host/Compile endef -define Build/Install +define Host/Install endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ + $(HOST_BUILD_DIR) \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) endef diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index f808615cd4..73dbdd8fe5 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -34,15 +34,15 @@ include $(INCLUDE_DIR)/host-build.mk STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.glibc_built STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_installed -PKG_BUILD_DIR1:=$(PKG_BUILD_DIR)-initial -PKG_BUILD_DIR2:=$(PKG_BUILD_DIR)-final +HOST_BUILD_DIR1:=$(HOST_BUILD_DIR)-initial +HOST_BUILD_DIR2:=$(HOST_BUILD_DIR)-final GLIBC_ADD_ONS+=nptl, ifneq ($(CONFIG_GLIBC_PORTS),) GLIBC_ADD_ONS+=ports, - define Build/Prepare/ports - ln -snf ../glibc-ports $(PKG_BUILD_DIR)/ports + define Host/Prepare/ports + ln -snf ../glibc-ports $(HOST_BUILD_DIR)/ports endef endif @@ -57,7 +57,7 @@ GLIBC_CONFIGURE:= \ libc_cv_forced_unwind=yes \ libc_cv_c_cleanup=yes \ libc_cv_386_tls=yes \ - $(PKG_BUILD_DIR)/configure \ + $(HOST_BUILD_DIR)/configure \ --prefix=/usr \ --build=$(GNU_HOST_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \ @@ -88,7 +88,7 @@ GLIBC_MAKE:= \ $(MAKE) \ -define Build/SetToolchainInfo +define Host/SetToolchainInfo $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk @@ -96,8 +96,8 @@ define Build/SetToolchainInfo endef define Stage1/Configure - mkdir -p $(PKG_BUILD_DIR1) - ( cd $(PKG_BUILD_DIR1); rm -f config.cache; \ + mkdir -p $(HOST_BUILD_DIR1) + ( cd $(HOST_BUILD_DIR1); rm -f config.cache; \ $(GLIBC_CONFIGURE_STAGE1) \ ); endef @@ -106,31 +106,31 @@ define Stage1/Compile endef define Stage1/Install - $(GLIBC_MAKE) -C $(PKG_BUILD_DIR1) \ + $(GLIBC_MAKE) -C $(HOST_BUILD_DIR1) \ CFLAGS="-DBOOTSTRAP_GCC" \ cross-compiling=yes \ install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ install-headers [ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/bits/stdio_lim.h ] || \ - $(CP) $(PKG_BUILD_DIR1)/bits/stdio_lim.h \ + $(CP) $(HOST_BUILD_DIR1)/bits/stdio_lim.h \ $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/bits/stdio_lim.h [ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/gnu/stubs.h ] || \ touch $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/gnu/stubs.h endef define Stage2/Configure - mkdir -p $(PKG_BUILD_DIR2) - ( cd $(PKG_BUILD_DIR2); rm -f config.cache; \ + mkdir -p $(HOST_BUILD_DIR2) + ( cd $(HOST_BUILD_DIR2); rm -f config.cache; \ $(GLIBC_CONFIGURE_STAGE2) \ ); endef define Stage2/Compile - $(GLIBC_MAKE) -C $(PKG_BUILD_DIR2) all + $(GLIBC_MAKE) -C $(HOST_BUILD_DIR2) all endef define Stage2/Install - $(GLIBC_MAKE) -C $(PKG_BUILD_DIR2) \ + $(GLIBC_MAKE) -C $(HOST_BUILD_DIR2) \ install_root="$(TOOLCHAIN_DIR)" \ install ( cd $(TOOLCHAIN_DIR) ; \ @@ -144,33 +144,33 @@ define Stage2/Install ) endef -define Build/Prepare - $(call Build/SetToolchainInfo) - $(call Build/Prepare/Default) +define Host/Prepare + $(call Host/SetToolchainInfo) + $(call Host/Prepare/Default) ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(call Build/Prepare/ports) + $(call Host/Prepare/ports) $(call Stage1/Configure) $(call Stage1/Compile) $(call Stage1/Install) endef -define Build/Configure +define Host/Configure endef -define Build/Compile +define Host/Compile $(call Stage2/Configure) $(call Stage2/Compile) $(call Stage2/Install) endef -define Build/Install +define Host/Install endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ - $(PKG_BUILD_DIR1) \ - $(PKG_BUILD_DIR2) \ + $(HOST_BUILD_DIR) \ + $(HOST_BUILD_DIR1) \ + $(HOST_BUILD_DIR2) \ $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) endef diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index cf5a384295..38e65189b3 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -21,9 +21,9 @@ PKG_NAME:=linux PKG_VERSION:=$(LINUX_VERSION) PKG_SOURCE:=$(LINUX_SOURCE) PKG_SOURCE_URL:=$(LINUX_SITE) -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) +HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM) -LINUX_DIR := $(PKG_BUILD_DIR) +LINUX_DIR := $(HOST_BUILD_DIR) include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel-defaults.mk @@ -36,26 +36,26 @@ ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.18)),1) LINUX_HAS_HEADERS_INSTALL:=y endif -KMAKE := $(MAKE) -C $(PKG_BUILD_DIR) \ +KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ ARCH=$(LINUX_KARCH) \ KBUILD_HAVE_NLS=no \ CONFIG_SHELL=$(BASH) -define Build/Prepare/pre/cris - ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/include/asm-cris/arch - ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/arch/cris/arch +define Host/Prepare/pre/cris + ln -sf $(HOST_BUILD_DIR)/include/asm-cris/arch-v10 $(HOST_BUILD_DIR)/include/asm-cris/arch + ln -sf $(HOST_BUILD_DIR)/include/asm-cris/arch-v10 $(HOST_BUILD_DIR)/arch/cris/arch endef -define Build/Prepare/pre/powerpc - if [ -d $(PKG_BUILD_DIR)/include/asm-ppc ]; then \ - $(CP) $(PKG_BUILD_DIR)/include/asm-ppc/* $(PKG_BUILD_DIR)/include/asm-powerpc/; \ - rm -rf $(PKG_BUILD_DIR)/include/asm-ppc; \ - ln -s $(PKG_BUILD_DIR)/include/asm-powerpc $(PKG_BUILD_DIR)/include/asm-ppc; \ +define Host/Prepare/pre/powerpc + if [ -d $(HOST_BUILD_DIR)/include/asm-ppc ]; then \ + $(CP) $(HOST_BUILD_DIR)/include/asm-ppc/* $(HOST_BUILD_DIR)/include/asm-powerpc/; \ + rm -rf $(HOST_BUILD_DIR)/include/asm-ppc; \ + ln -s $(HOST_BUILD_DIR)/include/asm-powerpc $(HOST_BUILD_DIR)/include/asm-ppc; \ fi endef ifneq ($(LINUX_HAS_HEADERS_INSTALL),) - define Build/Prepare/all + define Host/Prepare/all mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr $(KMAKE) \ CROSS_COMPILE=$(TARGET_CROSS) \ @@ -63,85 +63,85 @@ ifneq ($(LINUX_HAS_HEADERS_INSTALL),) headers_install endef else - define Build/Prepare/all + define Host/Prepare/all mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include cp -pLR \ - $(PKG_BUILD_DIR)/include/asm \ - $(PKG_BUILD_DIR)/include/asm-generic \ - $(PKG_BUILD_DIR)/include/asm-$(LINUX_KARCH) \ - $(PKG_BUILD_DIR)/include/linux \ + $(HOST_BUILD_DIR)/include/asm \ + $(HOST_BUILD_DIR)/include/asm-generic \ + $(HOST_BUILD_DIR)/include/asm-$(LINUX_KARCH) \ + $(HOST_BUILD_DIR)/include/linux \ $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/ endef endif # XXX: the following is needed to build lzma-loader -define Build/Prepare/lzma +define Host/Prepare/lzma $(CP) \ - $(PKG_BUILD_DIR)/include/asm-mips/asm.h \ - $(PKG_BUILD_DIR)/include/asm-mips/regdef.h \ + $(HOST_BUILD_DIR)/include/asm-mips/asm.h \ + $(HOST_BUILD_DIR)/include/asm-mips/regdef.h \ $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/ endef # XXX: the following are needed to build a cris toolchain -define Build/Prepare/post/cris +define Host/Prepare/post/cris $(CP) \ - $(PKG_BUILD_DIR)/include/linux/user.h \ + $(HOST_BUILD_DIR)/include/linux/user.h \ $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/linux/ $(CP) \ - $(PKG_BUILD_DIR)/include/asm-cris/elf.h \ - $(PKG_BUILD_DIR)/include/asm-cris/page.h \ - $(PKG_BUILD_DIR)/include/asm-cris/user.h \ + $(HOST_BUILD_DIR)/include/asm-cris/elf.h \ + $(HOST_BUILD_DIR)/include/asm-cris/page.h \ + $(HOST_BUILD_DIR)/include/asm-cris/user.h \ $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/ mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/arch $(CP) \ - $(PKG_BUILD_DIR)/include/asm-cris/arch/elf.h \ - $(PKG_BUILD_DIR)/include/asm-cris/arch/page.h \ - $(PKG_BUILD_DIR)/include/asm-cris/arch/ptrace.h \ - $(PKG_BUILD_DIR)/include/asm-cris/arch/user.h \ + $(HOST_BUILD_DIR)/include/asm-cris/arch/elf.h \ + $(HOST_BUILD_DIR)/include/asm-cris/arch/page.h \ + $(HOST_BUILD_DIR)/include/asm-cris/arch/ptrace.h \ + $(HOST_BUILD_DIR)/include/asm-cris/arch/user.h \ $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/arch/ $(CP) \ - $(PKG_BUILD_DIR)/include/asm-generic/memory_model.h \ - $(PKG_BUILD_DIR)/include/asm-generic/page.h \ + $(HOST_BUILD_DIR)/include/asm-generic/memory_model.h \ + $(HOST_BUILD_DIR)/include/asm-generic/page.h \ $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm-generic/ endef -define Build/Prepare/post/mips - $(call Build/Prepare/lzma) +define Host/Prepare/post/mips + $(call Host/Prepare/lzma) endef -define Build/Prepare/post/mipsel - $(call Build/Prepare/lzma) +define Host/Prepare/post/mipsel + $(call Host/Prepare/lzma) endef -define Build/Prepare +define Host/Prepare $(call Kernel/Prepare/Default) ln -sf linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux - $(SED) 's/@expr length/@-expr length/' $(PKG_BUILD_DIR)/Makefile + $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile yes '' | $(KMAKE) oldconfig $(KMAKE) include/linux/version.h include/asm - if [ -d $(PKG_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm ]; then \ + if [ -d $(HOST_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm ]; then \ $(CP) \ - $(PKG_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm/. \ - $(PKG_BUILD_DIR)/include/asm-$(LINUX_KARCH)/; \ + $(HOST_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm/. \ + $(HOST_BUILD_DIR)/include/asm-$(LINUX_KARCH)/; \ fi - $(call Build/Prepare/pre/$(ARCH)) - $(call Build/Prepare/all) - $(call Build/Prepare/post/$(ARCH)) + $(call Host/Prepare/pre/$(ARCH)) + $(call Host/Prepare/all) + $(call Host/Prepare/post/$(ARCH)) endef -define Build/Configure +define Host/Configure endef -define Build/Compile +define Host/Compile endef -define Build/Install +define Host/Install $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/ endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ + $(HOST_BUILD_DIR) \ $(BUILD_DIR_TOOLCHAIN)/linux \ $(BUILD_DIR_TOOLCHAIN)/linux-dev endef diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile index 45dbcef0c5..ce9acad447 100644 --- a/toolchain/uClibc/Makefile +++ b/toolchain/uClibc/Makefile @@ -54,9 +54,9 @@ endif STAGING_DIR_HOST:=$(TOOLCHAIN_DIR) BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN) ifeq ($(PKG_VERSION_SNAPSHOT),y) - PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_EXTRAVERSION) + HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_EXTRAVERSION) else - PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_VERSION)$(PKG_EXTRAVERSION) + HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_VERSION)$(PKG_EXTRAVERSION) endif override CONFIG_AUTOREBUILD= @@ -82,44 +82,44 @@ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ ) -define Build/SetToolchainInfo +define Host/SetToolchainInfo $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_PATCHVER\)=.*,\1=$(PKG_EXTRAVERSION),' $(TOOLCHAIN_DIR)/info.mk endef -define Build/Prepare/Snapshot +define Host/Prepare/Snapshot $(PKG_UNPACK) - rm -Rf $(PKG_BUILD_DIR) - ln -snf $(BUILD_DIR_TOOLCHAIN)/uClibc $(PKG_BUILD_DIR) - $(Build/Patch) - $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used) + rm -Rf $(HOST_BUILD_DIR) + ln -snf $(BUILD_DIR_TOOLCHAIN)/uClibc $(HOST_BUILD_DIR) + $(Host/Patch) + $(if $(QUILT),touch $(HOST_BUILD_DIR)/.quilt_used) endef -define Build/Prepare/V_0_9_28 +define Host/Prepare/V_0_9_28 $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(BUILD_DIR_TOOLCHAIN)/linux\",g' \ - $(PKG_BUILD_DIR)/.config + $(HOST_BUILD_DIR)/.config ifeq ($(CONFIG_SOFT_FLOAT),y) - $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(PKG_BUILD_DIR)/.config + $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(HOST_BUILD_DIR)/.config endif ifeq ($(CONFIG_C99_MATH),y) - $(SED) 's,.*DO_C99_MATH.*,DO_C99_MATH=y,g' $(PKG_BUILD_DIR)/.config + $(SED) 's,.*DO_C99_MATH.*,DO_C99_MATH=y,g' $(HOST_BUILD_DIR)/.config endif endef -define Build/Prepare - $(call Build/SetToolchainInfo) +define Host/Prepare + $(call Host/SetToolchainInfo) @echo prepare uClibc version $(PKG_VERSION)$(PKG_EXTRAVERSION) ifeq ($(PKG_VERSION_SNAPSHOT),y) - $(call Build/Prepare/Snapshot) + $(call Host/Prepare/Snapshot) else - $(call Build/Prepare/Default) + $(call Host/Prepare/Default) ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) endif - $(CP) ./$(CONFIG_DIR)/$(ARCH)$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD)) $(PKG_BUILD_DIR)/.config + $(CP) ./$(CONFIG_DIR)/$(ARCH)$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD)) $(HOST_BUILD_DIR)/.config ifeq ($(PKG_VERSION),0.9.28) - $(call Build/Prepare/V_0_9_28) + $(call Host/Prepare/V_0_9_28) endif $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include\",g' \ -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ @@ -128,9 +128,9 @@ define Build/Prepare -e 's,^.*CONFIG_ARM_EABI.*,CONFIG_ARM_EABI=$(if $(CONFIG_EABI_SUPPORT),y,n),g' \ -e 's,^.*CONFIG_ARM_OABI.*,CONFIG_ARM_OABI=$(if $(CONFIG_EABI_SUPPORT),n,y),g' \ -e 's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \ - $(PKG_BUILD_DIR)/.config - $(MAKE) -C $(PKG_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" - PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \ + $(HOST_BUILD_DIR)/.config + $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" + PATH=$(TARGET_PATH) $(MAKE) -C $(HOST_BUILD_DIR) \ PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ @@ -141,10 +141,10 @@ define Build/Prepare $(if $(CONFIG_UCLIBC_VERSION_0_9_28),install_dev,install_headers) endef -define Build/Configure +define Host/Configure endef -UCLIBC_MAKE := PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \ +UCLIBC_MAKE := PATH=$(TARGET_PATH) $(MAKE) -C $(HOST_BUILD_DIR) \ $(TARGET_CONFIGURE_OPTS) \ DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX=/ \ @@ -152,8 +152,8 @@ UCLIBC_MAKE := PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ DOSTRIP="" -define Build/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(PKG_BUILD_DIR)/Rules.mak +define Host/Compile + $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak $(UCLIBC_MAKE) PREFIX= all $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev ln -sf ../../lib/libc.so.0 $(TOOLCHAIN_DIR)/usr/lib/libc.so @@ -168,21 +168,21 @@ define Build/Compile # ) endef -define Build/Install +define Host/Install $(UCLIBC_MAKE) PREFIX= utils $(INSTALL_DIR) $(TOOLCHAIN_DIR)/usr/bin $(INSTALL_BIN) \ - $(PKG_BUILD_DIR)/utils/ldd \ + $(HOST_BUILD_DIR)/utils/ldd \ $(TOOLCHAIN_DIR)/usr/bin/ $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin $(INSTALL_BIN) \ - $(PKG_BUILD_DIR)/utils/ldconfig \ + $(HOST_BUILD_DIR)/utils/ldconfig \ $(TOOLCHAIN_DIR)/sbin/ endef -define Build/Clean +define Host/Clean rm -rf \ - $(PKG_BUILD_DIR) \ + $(HOST_BUILD_DIR) \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev endef diff --git a/tools/autoconf/Makefile b/tools/autoconf/Makefile index 30ca2d28d1..12bbaba255 100644 --- a/tools/autoconf/Makefile +++ b/tools/autoconf/Makefile @@ -15,23 +15,23 @@ PKG_MD5SUM:=e1fb8fe0b22e651240afdfa2be537a3c include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - $(call Build/Configure/Default,\ +define Host/Configure + $(call Host/Configure/Default,\ --datarootdir=$(STAGING_DIR_HOST)/share \ ) endef -define Build/Compile - export SHELL="$(BASH)"; $(MAKE) -C $(PKG_BUILD_DIR) +define Host/Compile + export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) endef -define Build/Install - export SHELL="$(BASH)"; $(MAKE) -C $(PKG_BUILD_DIR) install +define Host/Install + export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install endef -define Build/Clean - export SHELL="$(BASH)"; $(MAKE) -C $(PKG_BUILD_DIR) uninstall - $(call Build/Clean/Default) +define Host/Clean + export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall + $(call Host/Clean/Default) endef $(eval $(call HostBuild)) diff --git a/tools/automake/Makefile b/tools/automake/Makefile index 2b8a6f3450..679a954218 100644 --- a/tools/automake/Makefile +++ b/tools/automake/Makefile @@ -15,27 +15,27 @@ PKG_MD5SUM:=c11b8100bb311492d8220378fd8bf9e0 include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - $(call Build/Configure/Default,\ +define Host/Configure + $(call Host/Configure/Default,\ --datarootdir=$(STAGING_DIR_HOST)/share \ ) endef -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) endef -define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) install +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) install mv $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal.real $(INSTALL_BIN) ./files/aclocal $(STAGING_DIR_HOST)/bin ln -f $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.9 endef -define Build/Clean - $(MAKE) -C $(PKG_BUILD_DIR) uninstall - $(MAKE) -C $(PKG_BUILD_DIR) clean - $(call Build/Clean/Default) +define Host/Clean + $(MAKE) -C $(HOST_BUILD_DIR) uninstall + $(MAKE) -C $(HOST_BUILD_DIR) clean + $(call Host/Clean/Default) endef $(eval $(call HostBuild)) diff --git a/tools/bison/Makefile b/tools/bison/Makefile index 2b85612059..58a5603ef4 100644 --- a/tools/bison/Makefile +++ b/tools/bison/Makefile @@ -16,18 +16,18 @@ PKG_CAT:=zcat include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) endef -define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) install +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) install endef -define Build/Clean - $(MAKE) -C $(PKG_BUILD_DIR) uninstall - $(MAKE) -C $(PKG_BUILD_DIR) clean - $(call Build/Clean/Default) +define Host/Clean + $(MAKE) -C $(HOST_BUILD_DIR) uninstall + $(MAKE) -C $(HOST_BUILD_DIR) clean + $(call Host/Clean/Default) endef $(eval $(call HostBuild)) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 50714ad7d9..db138c0190 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -18,27 +18,27 @@ PKG_CAT:=zcat include $(INCLUDE_DIR)/host-build.mk ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found) - define Build/Compile - $(MAKE) CC="$(HOSTCC)" -C $(PKG_BUILD_DIR) + define Host/Compile + $(MAKE) CC="$(HOSTCC)" -C $(HOST_BUILD_DIR) endef - define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) install + define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) install endef - define Build/Clean - -$(MAKE) -C $(PKG_BUILD_DIR) uninstall - -$(MAKE) -C $(PKG_BUILD_DIR) clean - $(call Build/Clean/Default) + define Host/Clean + -$(MAKE) -C $(HOST_BUILD_DIR) uninstall + -$(MAKE) -C $(HOST_BUILD_DIR) clean + $(call Host/Clean/Default) endef else - define Build/Prepare + define Host/Prepare endef - define Build/Configure + define Host/Configure endef - define Build/Compile + define Host/Compile endef - define Build/Clean + define Host/Clean endef endif diff --git a/tools/dtc/Makefile b/tools/dtc/Makefile index b41484aae3..c686b204d4 100644 --- a/tools/dtc/Makefile +++ b/tools/dtc/Makefile @@ -14,19 +14,19 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz PKG_SOURCE_URL:=http://www.jdl.com/software PKG_MD5SUM:=6c84b01f500bc989b0b1ad6138fb93d5 PKG_CAT:=zcat -PKG_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME) +HOST_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME) include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) endef -define Build/Install - $(INSTALL_BIN) $(PKG_BUILD_DIR)/dtc $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/dtc $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/dtc endef diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index e2b6cf4d97..5261a2bb62 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,15 +11,15 @@ PKG_NAME := firmware-utils include $(INCLUDE_DIR)/host-build.mk define cc - $(CC) $(HOST_CFLAGS) -include endian.h -o $(PKG_BUILD_DIR)/bin/$(1) src/$(1).c $(2) + $(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(1) src/$(1).c $(2) endef define cc2 - $(CC) $(HOST_CFLAGS) -include endian.h -o $(PKG_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2) + $(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2) endef -define Build/Compile - mkdir -p $(PKG_BUILD_DIR)/bin +define Host/Compile + mkdir -p $(HOST_BUILD_DIR)/bin $(call cc,addpattern) $(call cc,trx) $(call cc,motorola-bin) @@ -41,8 +41,8 @@ define Build/Compile $(call cc2,mkplanexfw sha1) endef -define Build/Install - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/ endef $(eval $(call HostBuild)) diff --git a/tools/genext2fs/Makefile b/tools/genext2fs/Makefile index 5878b5c043..279c40bb58 100644 --- a/tools/genext2fs/Makefile +++ b/tools/genext2fs/Makefile @@ -17,8 +17,8 @@ PKG_MD5SUM:=b7b6361bcce2cedff1ae437fadafe53b include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - ( cd $(PKG_BUILD_DIR); \ +define Host/Configure + ( cd $(HOST_BUILD_DIR); \ ./configure \ --target=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ @@ -38,17 +38,17 @@ define Build/Configure ) endef -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) \ CFLAGS="$(HOST_CFLAGS) -include getline.h" \ all endef -define Build/Install - install -m0755 $(PKG_BUILD_DIR)/genext2fs $(STAGING_DIR_HOST)/bin/ +define Host/Install + install -m0755 $(HOST_BUILD_DIR)/genext2fs $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/genext2fs endef diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index 42646716b5..4c6fac425f 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -15,8 +15,8 @@ PKG_MD5SUM:= include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - (cd $(PKG_BUILD_DIR); \ +define Host/Configure + (cd $(HOST_BUILD_DIR); \ ./configure \ --prefix=$(STAGING_DIR_HOST) \ --build=$(GNU_HOST_NAME) \ @@ -27,16 +27,16 @@ define Build/Configure ); endef -define Build/Compile - make -C $(PKG_BUILD_DIR) all +define Host/Compile + make -C $(HOST_BUILD_DIR) all endef -define Build/Install - make -C $(PKG_BUILD_DIR) install +define Host/Install + make -C $(HOST_BUILD_DIR) install endef -define Build/Clean - rm -rf $(PKG_BUILD_DIR) +define Host/Clean + rm -rf $(HOST_BUILD_DIR) endef $(eval $(call HostBuild)) diff --git a/tools/ipkg-utils/Makefile b/tools/ipkg-utils/Makefile index 830d38a7c4..48eb7e3795 100644 --- a/tools/ipkg-utils/Makefile +++ b/tools/ipkg-utils/Makefile @@ -16,16 +16,16 @@ PKG_CAT:=zcat include $(INCLUDE_DIR)/host-build.mk -define Build/Install +define Host/Install $(INSTALL_BIN) \ - $(PKG_BUILD_DIR)/ipkg-build \ - $(PKG_BUILD_DIR)/ipkg-buildpackage \ - $(PKG_BUILD_DIR)/ipkg-make-index \ - $(PKG_BUILD_DIR)/ipkg.py \ + $(HOST_BUILD_DIR)/ipkg-build \ + $(HOST_BUILD_DIR)/ipkg-buildpackage \ + $(HOST_BUILD_DIR)/ipkg-make-index \ + $(HOST_BUILD_DIR)/ipkg.py \ $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR)/etc/ipkg.conf rm -f $(STAGING_DIR_HOST)/bin/ipkg* endef diff --git a/tools/lua/Makefile b/tools/lua/Makefile index 1bebe09f96..13d06b107c 100644 --- a/tools/lua/Makefile +++ b/tools/lua/Makefile @@ -20,23 +20,23 @@ PKG_MD5SUM:=d0870f2de55d59c1c8419f36e8fac150 include $(INCLUDE_DIR)/host-build.mk -define Build/Configure +define Host/Configure endef TARGET_CFLAGS += -DLUA_USE_LINUX -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR)/src luac-host +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR)/src luac-host endef -define Build/Install - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/luac-host $(STAGING_DIR_HOST)/bin/luac +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/luac-host $(STAGING_DIR_HOST)/bin/luac endef -define Build/Clean - $(MAKE) -C $(PKG_BUILD_DIR)/src clean - rm -f $(PKG_BUILD_DIR)/src/luac-host - $(call Build/Clean/Default) +define Host/Clean + $(MAKE) -C $(HOST_BUILD_DIR)/src clean + rm -f $(HOST_BUILD_DIR)/src/luac-host + $(call Host/Clean/Default) endef $(eval $(call HostBuild)) diff --git a/tools/lzma/Makefile b/tools/lzma/Makefile index da7a610626..b982415c5a 100644 --- a/tools/lzma/Makefile +++ b/tools/lzma/Makefile @@ -13,24 +13,24 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ PKG_MD5SUM:=5587d6ac230ad1903d504fc3253f0e42 -PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk -LIB_DIR=$(PKG_BUILD_DIR)/C/7zip/Compress/LZMA_Lib -ALONE_DIR=$(PKG_BUILD_DIR)/C/7zip/Compress/LZMA_Alone +LIB_DIR=$(HOST_BUILD_DIR)/C/7zip/Compress/LZMA_Lib +ALONE_DIR=$(HOST_BUILD_DIR)/C/7zip/Compress/LZMA_Alone -define Build/Compile +define Host/Compile $(MAKE) -C $(LIB_DIR) $(MAKE) -f makefile.gcc -C $(ALONE_DIR) endef -define Build/Install +define Host/Install $(INSTALL_DATA) $(LIB_DIR)/liblzma.a $(STAGING_DIR_HOST)/lib/ $(INSTALL_BIN) $(ALONE_DIR)/lzma $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f \ $(STAGING_DIR_HOST)/lib/liblzma.a \ $(STAGING_DIR_HOST)/bin/lzma diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index f2bb08dd39..da13c5b81d 100644 --- a/tools/mkimage/Makefile +++ b/tools/mkimage/Makefile @@ -10,17 +10,17 @@ PKG_NAME:=mkimage include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(HOSTCC) $(HOST_CFLAGS) -O -c src/crc32.c -o $(PKG_BUILD_DIR)/crc32.o - $(HOSTCC) $(HOST_CFLAGS) -O -c src/mkimage.c -o $(PKG_BUILD_DIR)/mkimage.o - $(HOSTCC) $(HOST_CFLAGS) -O -o $(PKG_BUILD_DIR)/mkimage $(PKG_BUILD_DIR)/mkimage.o $(PKG_BUILD_DIR)/crc32.o +define Host/Compile + $(HOSTCC) $(HOST_CFLAGS) -O -c src/crc32.c -o $(HOST_BUILD_DIR)/crc32.o + $(HOSTCC) $(HOST_CFLAGS) -O -c src/mkimage.c -o $(HOST_BUILD_DIR)/mkimage.o + $(HOSTCC) $(HOST_CFLAGS) -O -o $(HOST_BUILD_DIR)/mkimage $(HOST_BUILD_DIR)/mkimage.o $(HOST_BUILD_DIR)/crc32.o endef -define Build/Install - $(CP) $(PKG_BUILD_DIR)/mkimage $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(CP) $(HOST_BUILD_DIR)/mkimage $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/mkimage endef diff --git a/tools/mpfr/Makefile b/tools/mpfr/Makefile index 58a15eb273..5abb2a2c79 100644 --- a/tools/mpfr/Makefile +++ b/tools/mpfr/Makefile @@ -15,8 +15,8 @@ PKG_MD5SUM:=527147c097874340cb9cee0579dacf3b include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - (cd $(PKG_BUILD_DIR); \ +define Host/Configure + (cd $(HOST_BUILD_DIR); \ ./configure \ --prefix=$(STAGING_DIR_HOST) \ --build=$(GNU_HOST_NAME) \ @@ -26,16 +26,16 @@ define Build/Configure ); endef -define Build/Compile - make -C $(PKG_BUILD_DIR) all +define Host/Compile + make -C $(HOST_BUILD_DIR) all endef -define Build/Install - make -C $(PKG_BUILD_DIR) install +define Host/Install + make -C $(HOST_BUILD_DIR) install endef -define Build/Clean - rm -rf $(PKG_BUILD_DIR) +define Host/Clean + rm -rf $(HOST_BUILD_DIR) endef $(eval $(call HostBuild)) diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 98fb59428d..4486578890 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -14,7 +14,7 @@ PKG_SOURCE_URL=http://ftp.debian.org/debian/pool/main/m/mtd PKG_MD5SUM:=1f42c2cae08eb9e7b52d0c188f8d6338 PKG_CAT:=zcat -PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION).orig +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION).orig include $(INCLUDE_DIR)/host-build.mk @@ -23,15 +23,15 @@ ifneq ($(HOST_OS),Linux) CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include getline.h -include endian.h endif -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR)/util CFLAGS="$(CFLAGS)" TARGETS=mkfs.jffs2 +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR)/util CFLAGS="$(CFLAGS)" TARGETS=mkfs.jffs2 endef -define Build/Install - $(CP) $(PKG_BUILD_DIR)/util/mkfs.jffs2 $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(CP) $(HOST_BUILD_DIR)/util/mkfs.jffs2 $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/mkfs.jffs2 endef diff --git a/tools/patch-cmdline/Makefile b/tools/patch-cmdline/Makefile index cc6b9d3819..9a3f971ef7 100644 --- a/tools/patch-cmdline/Makefile +++ b/tools/patch-cmdline/Makefile @@ -10,15 +10,15 @@ PKG_NAME:=patch-cmdline include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(PKG_BUILD_DIR)/$(PKG_NAME) src/$(PKG_NAME).c +define Host/Compile + $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/$(PKG_NAME) src/$(PKG_NAME).c endef -define Build/Install - $(CP) $(PKG_BUILD_DIR)/patch-cmdline $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(CP) $(HOST_BUILD_DIR)/patch-cmdline $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/patch-cmdline endef diff --git a/tools/pkg-config/Makefile b/tools/pkg-config/Makefile index bcae2dfa69..0a68e742a5 100644 --- a/tools/pkg-config/Makefile +++ b/tools/pkg-config/Makefile @@ -15,21 +15,21 @@ PKG_MD5SUM:=fd5c547e9d66ba49bc735ccb8c791f2a include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) endef -define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) \ +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) \ install mv $(STAGING_DIR_HOST)/bin/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config.real $(INSTALL_BIN) ./files/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config endef -define Build/Clean - $(MAKE) -C $(PKG_BUILD_DIR) uninstall - $(MAKE) -C $(PKG_BUILD_DIR) clean - $(call Build/Clean/Default) +define Host/Clean + $(MAKE) -C $(HOST_BUILD_DIR) uninstall + $(MAKE) -C $(HOST_BUILD_DIR) clean + $(call Host/Clean/Default) endef $(eval $(call HostBuild)) diff --git a/tools/quilt/Makefile b/tools/quilt/Makefile index 5294534b01..b87d776c76 100644 --- a/tools/quilt/Makefile +++ b/tools/quilt/Makefile @@ -15,20 +15,20 @@ PKG_MD5SUM:=d33d2442bd34387260b1c1db3e623af0 include $(INCLUDE_DIR)/host-build.mk -define Build/Configure - $(call Build/Configure/Default) - [ -f $(PKG_BUILD_DIR)/Makefile ] +define Host/Configure + $(call Host/Configure/Default) + [ -f $(HOST_BUILD_DIR)/Makefile ] endef -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) SHELL="$(BASH)" +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" endef -define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) SHELL="$(BASH)" install +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" install endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/quilt endef diff --git a/tools/sed/Makefile b/tools/sed/Makefile index 0f2b3dbf22..6b3122d161 100644 --- a/tools/sed/Makefile +++ b/tools/sed/Makefile @@ -17,15 +17,15 @@ export SED:= include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) SHELL="$(BASH)" +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" endef -define Build/Install - $(INSTALL_BIN) $(PKG_BUILD_DIR)/sed/sed $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/sed/sed $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/sed endef diff --git a/tools/squashfs/Makefile b/tools/squashfs/Makefile index 53baa7abfb..473c526510 100644 --- a/tools/squashfs/Makefile +++ b/tools/squashfs/Makefile @@ -14,22 +14,22 @@ PKG_SOURCE_URL:=@SF/squashfs PKG_MD5SUM:=9fd05d0bfbb712f5fb95edafea5bc733 PKG_CAT:=zcat -PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \ +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \ LZMAPATH=$(STAGING_DIR_HOST)/lib \ mksquashfs-lzma unsquashfs-lzma endef -define Build/Install - $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs-lzma $(STAGING_DIR_HOST)/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs-lzma $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/mksquashfs-lzma $(STAGING_DIR_HOST)/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/unsquashfs-lzma $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/mksquashfs-lzma rm -f $(STAGING_DIR_HOST)/bin/unsquashfs-lzma endef diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile index 8d23e36e8b..d93e7618d1 100644 --- a/tools/sstrip/Makefile +++ b/tools/sstrip/Makefile @@ -10,15 +10,15 @@ PKG_NAME:=sstrip include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(CC) $(HOST_CFLAGS) -I./include -include endian.h -o $(PKG_BUILD_DIR)/sstrip src/sstrip.c +define Host/Compile + $(CC) $(HOST_CFLAGS) -I./include -include endian.h -o $(HOST_BUILD_DIR)/sstrip src/sstrip.c endef -define Build/Install - $(CP) $(PKG_BUILD_DIR)/sstrip $(STAGING_DIR_HOST)/bin/ +define Host/Install + $(CP) $(HOST_BUILD_DIR)/sstrip $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/sstrip endef diff --git a/tools/yaffs2/Makefile b/tools/yaffs2/Makefile index 37da033d76..344b61a2c8 100644 --- a/tools/yaffs2/Makefile +++ b/tools/yaffs2/Makefile @@ -15,22 +15,22 @@ PKG_SOURCE_URL:=git://android.git.kernel.org/platform/external/yaffs2.git PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME) PKG_SOURCE_VERSION:=d333fc232d7e5ae3370080d5d6f7d88ea9c6b3a1 -PKG_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME) +HOST_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME) include $(INCLUDE_DIR)/host-build.mk -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR)/yaffs2/utils \ +define Host/Compile + $(MAKE) -C $(HOST_BUILD_DIR)/yaffs2/utils \ CFLAGS="$(HOST_CFLAGS) -include endian.h" \ mkyaffs2image endef -define Build/Install +define Host/Install $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/yaffs2/utils/mkyaffs2image $(STAGING_DIR_HOST)/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/yaffs2/utils/mkyaffs2image $(STAGING_DIR_HOST)/bin/ endef -define Build/Clean +define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/mkyaffs2image endef