2006-06-27 00:35:46 +00:00
|
|
|
#
|
2007-03-15 23:57:18 +00:00
|
|
|
# Copyright (C) 2006,2007 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.
|
|
|
|
#
|
2007-03-15 23:57:18 +00:00
|
|
|
|
|
|
|
all: $(if $(DUMP),dumpinfo,compile)
|
2006-04-14 03:03:32 +00:00
|
|
|
|
2007-03-16 19:18:55 +00:00
|
|
|
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
|
|
|
|
|
2006-07-29 11:30:06 +00:00
|
|
|
include $(INCLUDE_DIR)/prereq.mk
|
2006-10-10 21:22:35 +00:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2006-10-14 00:40:27 +00:00
|
|
|
include $(INCLUDE_DIR)/unpack.mk
|
2007-03-15 23:57:18 +00:00
|
|
|
include $(INCLUDE_DIR)/package-defaults.mk
|
|
|
|
include $(INCLUDE_DIR)/package-dumpinfo.mk
|
|
|
|
include $(INCLUDE_DIR)/package-ipkg.mk
|
2006-07-29 11:30:06 +00:00
|
|
|
|
2006-10-19 15:25:58 +00:00
|
|
|
export CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
|
|
|
|
|
2006-04-14 03:03:32 +00:00
|
|
|
define Build/DefaultTargets
|
2007-03-15 23:57:18 +00:00
|
|
|
ifneq ($(strip $(PKG_SOURCE_URL)),)
|
|
|
|
download: $(DL_DIR)/$(PKG_SOURCE)
|
|
|
|
|
|
|
|
$(DL_DIR)/$(PKG_SOURCE):
|
2007-03-16 06:12:53 +00:00
|
|
|
mkdir -p $(DL_DIR)
|
|
|
|
$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
|
2007-03-15 23:57:18 +00:00
|
|
|
|
|
|
|
$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
|
|
|
|
endif
|
|
|
|
|
2006-05-15 20:30:26 +00:00
|
|
|
ifeq ($(DUMP),)
|
2006-07-26 01:01:09 +00:00
|
|
|
ifeq ($(CONFIG_AUTOREBUILD),y)
|
2007-01-12 11:09:05 +00:00
|
|
|
ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) . $(PKG_FILE_DEPEND)),$(PKG_BUILD_DIR))
|
2007-01-20 01:35:13 +00:00
|
|
|
$$(info Forcing package rebuild)
|
2007-03-15 23:57:18 +00:00
|
|
|
$(PKG_BUILD_DIR)/.prepared: clean
|
2006-06-02 16:17:56 +00:00
|
|
|
endif
|
2006-06-04 14:40:47 +00:00
|
|
|
endif
|
2006-05-14 09:30:29 +00:00
|
|
|
endif
|
|
|
|
|
2006-06-20 23:40:02 +00:00
|
|
|
$(PKG_BUILD_DIR)/.prepared:
|
2006-05-11 00:18:12 +00:00
|
|
|
@-rm -rf $(PKG_BUILD_DIR)
|
|
|
|
@mkdir -p $(PKG_BUILD_DIR)
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/Prepare)
|
2006-05-11 23:14:04 +00:00
|
|
|
touch $$@
|
2006-04-14 03:03:32 +00:00
|
|
|
|
2006-05-11 23:14:04 +00:00
|
|
|
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/Configure)
|
2006-04-14 03:03:32 +00:00
|
|
|
touch $$@
|
|
|
|
|
2006-05-14 09:30:29 +00:00
|
|
|
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/Compile)
|
2006-05-14 09:30:29 +00:00
|
|
|
touch $$@
|
2006-05-31 16:20:27 +00:00
|
|
|
|
2006-08-02 12:07:14 +00:00
|
|
|
ifdef Build/InstallDev
|
2006-09-07 12:48:22 +00:00
|
|
|
ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p -x ipkg -x ipkg-install $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed $(PKG_BUILD_DIR)),$(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed)
|
|
|
|
$(PKG_BUILD_DIR)/.built: package-rebuild
|
|
|
|
endif
|
|
|
|
|
2007-03-16 06:12:53 +00:00
|
|
|
compile: $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
|
2006-08-02 12:07:14 +00:00
|
|
|
$(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
|
2006-07-18 20:17:05 +00:00
|
|
|
mkdir -p $(STAGING_DIR)/stampfiles
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/InstallDev)
|
2006-05-24 07:12:59 +00:00
|
|
|
touch $$@
|
2006-06-01 00:06:16 +00:00
|
|
|
endif
|
2006-05-31 16:20:27 +00:00
|
|
|
|
2006-05-14 09:30:29 +00:00
|
|
|
package-rebuild: FORCE
|
2006-06-16 21:39:42 +00:00
|
|
|
@-rm -f $(PKG_BUILD_DIR)/.built
|
2006-05-14 09:30:29 +00:00
|
|
|
|
2006-05-11 22:36:20 +00:00
|
|
|
define Build/DefaultTargets
|
|
|
|
endef
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
2005-07-24 19:58:14 +00:00
|
|
|
|
2006-04-19 23:56:04 +00:00
|
|
|
define BuildPackage
|
2007-03-15 23:57:18 +00:00
|
|
|
$(eval $(Package/Default))
|
|
|
|
$(eval $(Package/$(1)))
|
|
|
|
|
2007-03-16 06:12:53 +00:00
|
|
|
# <HACK> Support obsolete DESCRIPTION field
|
2007-03-15 23:57:18 +00:00
|
|
|
ifndef Package/$(1)/description
|
|
|
|
define Package/$(1)/description
|
|
|
|
$(TITLE)$(subst \,
|
|
|
|
,\ $(DESCRIPTION))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
# </HACK>
|
2006-04-14 01:22:55 +00:00
|
|
|
|
2006-09-24 21:17:17 +00:00
|
|
|
$(foreach FIELD, TITLE CATEGORY PRIORITY SECTION VERSION,
|
2006-05-11 22:36:20 +00:00
|
|
|
ifeq ($($(FIELD)),)
|
|
|
|
$$(error Package/$(1) is missing the $(FIELD) field)
|
|
|
|
endif
|
|
|
|
)
|
2006-05-11 00:18:12 +00:00
|
|
|
|
2007-03-15 23:57:18 +00:00
|
|
|
$(call shexport,Package/$(1)/description)
|
|
|
|
$(call shexport,Package/$(1)/config)
|
2006-10-10 15:45:36 +00:00
|
|
|
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Dumpinfo)
|
|
|
|
$(BuildIPKG)
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
2005-10-22 01:40:50 +00:00
|
|
|
|
2006-04-14 03:03:32 +00:00
|
|
|
define Build/Prepare
|
2006-09-18 21:56:07 +00:00
|
|
|
$(call Build/Prepare/Default,)
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
2006-05-11 22:36:20 +00:00
|
|
|
$(call Build/Configure/Default,)
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
2006-05-15 20:30:26 +00:00
|
|
|
$(call Build/Compile/Default,)
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
2005-04-18 06:17:39 +00:00
|
|
|
|
2007-03-15 23:57:18 +00:00
|
|
|
$(PACKAGE_DIR):
|
2006-05-10 20:32:22 +00:00
|
|
|
mkdir -p $@
|
2006-06-20 23:40:02 +00:00
|
|
|
|
2007-03-15 23:57:18 +00:00
|
|
|
dumpinfo:
|
|
|
|
download:
|
|
|
|
prepare: $(PKG_BUILD_DIR)/.prepared
|
|
|
|
configure: $(PKG_BUILD_DIR)/.configured
|
|
|
|
compile:
|
|
|
|
install:
|
|
|
|
clean: FORCE
|
|
|
|
$(Build/UninstallDev)
|
|
|
|
@rm -f $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
|
|
|
|
@rm -rf $(PKG_BUILD_DIR)
|