2006-06-27 00:35:46 +00:00
|
|
|
#
|
2008-11-22 04:38:20 +00:00
|
|
|
# Copyright (C) 2006-2008 OpenWrt.org
|
2006-06-27 00:35:46 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-10-10 13:25:18 +00:00
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
|
|
|
PKG_INSTALL_DIR ?= $(HOST_BUILD_DIR)/host-install
|
2007-08-07 00:04:25 +00:00
|
|
|
|
2006-10-10 16:58:47 +00:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2006-10-14 00:40:27 +00:00
|
|
|
include $(INCLUDE_DIR)/unpack.mk
|
2007-04-15 18:28:24 +00:00
|
|
|
include $(INCLUDE_DIR)/depends.mk
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
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
|
2007-08-07 00:04:25 +00:00
|
|
|
|
2007-07-30 21:14:08 +00:00
|
|
|
override MAKEFLAGS=
|
2006-10-10 13:25:18 +00:00
|
|
|
|
2007-09-29 00:05:48 +00:00
|
|
|
include $(INCLUDE_DIR)/download.mk
|
2007-06-03 07:33:00 +00:00
|
|
|
include $(INCLUDE_DIR)/quilt.mk
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
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)
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/Prepare/Default)
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Configure/Default
|
|
|
|
@(cd $(HOST_BUILD_DIR)/$(3); \
|
2006-06-21 06:19:43 +00:00
|
|
|
[ -x configure ] && \
|
2009-02-22 04:37:20 +00:00
|
|
|
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/$(3)/ && \
|
2006-06-21 06:19:43 +00:00
|
|
|
$(2) \
|
2007-08-07 00:04:25 +00:00
|
|
|
CPPFLAGS="$(HOST_CFLAGS)" \
|
|
|
|
LDFLAGS="$(HOST_LDFLAGS)" \
|
|
|
|
SHELL="$(BASH)" \
|
2006-06-21 06:19:43 +00:00
|
|
|
./configure \
|
2007-08-07 00:04:25 +00:00
|
|
|
--target=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
2006-06-21 06:19:43 +00:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--program-prefix="" \
|
|
|
|
--program-suffix="" \
|
2007-08-07 00:04:25 +00:00
|
|
|
--prefix=$(STAGING_DIR_HOST) \
|
|
|
|
--exec-prefix=$(STAGING_DIR_HOST) \
|
|
|
|
--sysconfdir=$(STAGING_DIR_HOST)/etc \
|
|
|
|
--localstatedir=$(STAGING_DIR_HOST)/var \
|
2006-06-21 06:19:43 +00:00
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(1); \
|
|
|
|
true; \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Configure
|
|
|
|
$(call Host/Configure/Default)
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Compile/Default
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) $(1)
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Compile
|
|
|
|
$(call Host/Compile/Default)
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
2007-07-30 23:52:17 +00:00
|
|
|
ifneq ($(if $(QUILT),,$(CONFIG_AUTOREBUILD)),)
|
2009-02-22 04:37:20 +00:00
|
|
|
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)))
|
2007-04-15 18:28:24 +00:00
|
|
|
endef
|
2006-06-21 06:19:43 +00:00
|
|
|
endif
|
|
|
|
|
2007-09-29 00:05:48 +00:00
|
|
|
define Download/default
|
|
|
|
FILE:=$(PKG_SOURCE)
|
|
|
|
URL:=$(PKG_SOURCE_URL)
|
|
|
|
PROTO:=$(PKG_SOURCE_PROTO)
|
2008-11-22 04:38:20 +00:00
|
|
|
SUBDIR:=$(PKG_SOURCE_SUBDIR)
|
2007-09-29 00:05:48 +00:00
|
|
|
VERSION:=$(PKG_SOURCE_VERSION)
|
|
|
|
MD5SUM:=$(PKG_MD5SUM)
|
|
|
|
endef
|
|
|
|
|
2006-06-21 06:19:43 +00:00
|
|
|
define HostBuild
|
2009-02-22 04:37:20 +00:00
|
|
|
$(if $(QUILT),$(Host/Quilt))
|
2007-09-29 00:05:48 +00:00
|
|
|
$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
|
2009-02-22 04:37:20 +00:00
|
|
|
$(if $(DUMP),,$(call HostHost/Autoclean))
|
2007-02-25 18:28:25 +00:00
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
$(HOST_STAMP_PREPARED):
|
|
|
|
@-rm -rf $(HOST_BUILD_DIR)
|
|
|
|
@mkdir -p $(HOST_BUILD_DIR)
|
|
|
|
$(call Host/Prepare)
|
2006-06-21 06:19:43 +00:00
|
|
|
touch $$@
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
$(HOST_STAMP_CONFIGURED): $(HOST_STAMP_PREPARED)
|
|
|
|
$(call Host/Configure)
|
2006-06-21 06:19:43 +00:00
|
|
|
touch $$@
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
$(HOST_STAMP_BUILT): $(HOST_STAMP_CONFIGURED)
|
|
|
|
$(call Host/Compile)
|
2006-06-21 06:19:43 +00:00
|
|
|
touch $$@
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
$(HOST_STAMP_INSTALLED): $(HOST_STAMP_BUILT)
|
|
|
|
$(call Host/Install)
|
2007-02-25 21:01:21 +00:00
|
|
|
mkdir -p $$(shell dirname $$@)
|
2006-06-21 06:19:43 +00:00
|
|
|
touch $$@
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
ifdef Host/Install
|
|
|
|
install: $(HOST_STAMP_INSTALLED)
|
2006-06-21 06:19:43 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
package-clean: FORCE
|
2009-02-22 04:37:20 +00:00
|
|
|
$(call Host/Clean)
|
|
|
|
$(call Host/Uninstall)
|
|
|
|
rm -f $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
|
2006-06-21 06:19:43 +00:00
|
|
|
|
2006-07-21 17:00:14 +00:00
|
|
|
download:
|
2009-02-22 04:37:20 +00:00
|
|
|
prepare: $(HOST_STAMP_PREPARED)
|
|
|
|
configure: $(HOST_STAMP_CONFIGURED)
|
|
|
|
compile: $(HOST_STAMP_BUILT)
|
2007-02-25 18:28:25 +00:00
|
|
|
install:
|
2006-06-21 06:19:43 +00:00
|
|
|
clean: FORCE
|
2009-02-22 04:37:20 +00:00
|
|
|
$(call Host/Clean)
|
|
|
|
rm -rf $(HOST_BUILD_DIR)
|
2006-06-21 06:19:43 +00:00
|
|
|
|
|
|
|
endef
|