2006-06-27 03:35:46 +03:00
|
|
|
#
|
2007-07-31 00:14:08 +03:00
|
|
|
# Copyright (C) 2006-2007 OpenWrt.org
|
2006-06-27 03:35:46 +03:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2007-03-16 01:57:18 +02:00
|
|
|
|
|
|
|
all: $(if $(DUMP),dumpinfo,compile)
|
2006-04-14 06:03:32 +03:00
|
|
|
|
2007-03-16 21:18:55 +02:00
|
|
|
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
|
|
|
|
|
2006-07-29 14:30:06 +03:00
|
|
|
include $(INCLUDE_DIR)/prereq.mk
|
2006-10-11 00:22:35 +03:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2006-10-14 03:40:27 +03:00
|
|
|
include $(INCLUDE_DIR)/unpack.mk
|
2007-04-15 21:28:24 +03:00
|
|
|
include $(INCLUDE_DIR)/depends.mk
|
2006-07-29 14:30:06 +03:00
|
|
|
|
2007-05-10 03:23:48 +03:00
|
|
|
STAMP_PREPARED:=$(PKG_BUILD_DIR)/.prepared$(if $(DUMP),,_$(shell find ${CURDIR} $(PKG_FILE_DEPEND) $(DEP_FINDPARAMS) | md5s))
|
2007-03-23 21:13:08 +02:00
|
|
|
STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured
|
|
|
|
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
|
2007-06-03 09:16:08 +03:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/quilt.mk
|
|
|
|
include $(INCLUDE_DIR)/package-defaults.mk
|
|
|
|
include $(INCLUDE_DIR)/package-dumpinfo.mk
|
|
|
|
include $(INCLUDE_DIR)/package-ipkg.mk
|
|
|
|
|
2007-07-31 00:14:08 +03:00
|
|
|
override MAKEFLAGS=
|
2006-10-19 18:25:58 +03:00
|
|
|
export CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
|
|
|
|
|
2007-07-30 21:39:20 +03:00
|
|
|
ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
|
2007-06-11 20:19:43 +03:00
|
|
|
ifneq ($(CONFIG_AUTOREBUILD),)
|
|
|
|
define Build/Autoclean
|
|
|
|
$(PKG_BUILD_DIR)/.dep_files: $(STAMP_PREPARED)
|
|
|
|
$(call rdep,${CURDIR} $(PKG_FILE_DEPEND),$(STAMP_PREPARED))
|
2007-07-31 00:47:26 +03:00
|
|
|
$(if $(filter prepare,$(MAKECMDGOALS)),,$(call rdep,$(PKG_BUILD_DIR),$(STAMP_BUILT),$(PKG_BUILD_DIR)/.dep_files, -and -not -path "/.*" -and -not -path "*/ipkg*"))
|
2007-06-11 20:19:43 +03:00
|
|
|
endef
|
|
|
|
endif
|
2007-04-15 21:28:24 +03:00
|
|
|
endif
|
|
|
|
|
2006-04-14 06:03:32 +03:00
|
|
|
define Build/DefaultTargets
|
2007-03-16 01:57:18 +02:00
|
|
|
ifneq ($(strip $(PKG_SOURCE_URL)),)
|
|
|
|
download: $(DL_DIR)/$(PKG_SOURCE)
|
|
|
|
|
|
|
|
$(DL_DIR)/$(PKG_SOURCE):
|
2007-03-16 08:12:53 +02:00
|
|
|
mkdir -p $(DL_DIR)
|
|
|
|
$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
|
2007-03-16 01:57:18 +02:00
|
|
|
|
2007-03-23 21:13:08 +02:00
|
|
|
$(STAMP_PREPARED): $(DL_DIR)/$(PKG_SOURCE)
|
2007-03-16 01:57:18 +02:00
|
|
|
endif
|
|
|
|
|
2007-04-15 21:28:24 +03:00
|
|
|
$(call Build/Autoclean)
|
2006-05-14 12:30:29 +03:00
|
|
|
|
2007-03-23 21:13:08 +02:00
|
|
|
$(STAMP_PREPARED):
|
2006-05-11 03:18:12 +03:00
|
|
|
@-rm -rf $(PKG_BUILD_DIR)
|
|
|
|
@mkdir -p $(PKG_BUILD_DIR)
|
2007-03-16 01:57:18 +02:00
|
|
|
$(Build/Prepare)
|
2006-05-12 02:14:04 +03:00
|
|
|
touch $$@
|
2006-04-14 06:03:32 +03:00
|
|
|
|
2007-03-23 21:13:08 +02:00
|
|
|
$(STAMP_CONFIGURED): $(STAMP_PREPARED)
|
2007-03-16 01:57:18 +02:00
|
|
|
$(Build/Configure)
|
2006-04-14 06:03:32 +03:00
|
|
|
touch $$@
|
|
|
|
|
2007-03-23 21:13:08 +02:00
|
|
|
$(STAMP_BUILT): $(STAMP_CONFIGURED)
|
2007-03-16 01:57:18 +02:00
|
|
|
$(Build/Compile)
|
2007-04-17 02:51:22 +03:00
|
|
|
@$(NO_TRACE_MAKE) $(PKG_BUILD_DIR)/.dep_files
|
2006-05-14 12:30:29 +03:00
|
|
|
touch $$@
|
2006-05-31 19:20:27 +03:00
|
|
|
|
2006-08-02 15:07:14 +03:00
|
|
|
ifdef Build/InstallDev
|
2007-03-16 08:12:53 +02:00
|
|
|
compile: $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
|
2007-03-23 21:13:08 +02:00
|
|
|
$(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed: $(STAMP_BUILT)
|
2006-07-18 23:17:05 +03:00
|
|
|
mkdir -p $(STAGING_DIR)/stampfiles
|
2007-03-16 01:57:18 +02:00
|
|
|
$(Build/InstallDev)
|
2006-05-24 10:12:59 +03:00
|
|
|
touch $$@
|
2006-06-01 03:06:16 +03:00
|
|
|
endif
|
2006-05-31 19:20:27 +03:00
|
|
|
|
2006-05-12 01:36:20 +03:00
|
|
|
define Build/DefaultTargets
|
|
|
|
endef
|
2006-04-14 06:03:32 +03:00
|
|
|
endef
|
2005-07-24 22:58:14 +03:00
|
|
|
|
2006-04-20 02:56:04 +03:00
|
|
|
define BuildPackage
|
2007-03-16 01:57:18 +02:00
|
|
|
$(eval $(Package/Default))
|
|
|
|
$(eval $(Package/$(1)))
|
|
|
|
|
2007-03-16 08:12:53 +02:00
|
|
|
# <HACK> Support obsolete DESCRIPTION field
|
2007-03-16 01:57:18 +02:00
|
|
|
ifndef Package/$(1)/description
|
|
|
|
define Package/$(1)/description
|
|
|
|
$(TITLE)$(subst \,
|
|
|
|
,\ $(DESCRIPTION))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
# </HACK>
|
2006-04-14 04:22:55 +03:00
|
|
|
|
2006-09-25 00:17:17 +03:00
|
|
|
$(foreach FIELD, TITLE CATEGORY PRIORITY SECTION VERSION,
|
2006-05-12 01:36:20 +03:00
|
|
|
ifeq ($($(FIELD)),)
|
|
|
|
$$(error Package/$(1) is missing the $(FIELD) field)
|
|
|
|
endif
|
|
|
|
)
|
2006-05-11 03:18:12 +03:00
|
|
|
|
2007-03-16 01:57:18 +02:00
|
|
|
$(call shexport,Package/$(1)/description)
|
|
|
|
$(call shexport,Package/$(1)/config)
|
2006-10-10 18:45:36 +03:00
|
|
|
|
2007-03-16 01:57:18 +02:00
|
|
|
$(Dumpinfo)
|
|
|
|
$(BuildIPKG)
|
2006-04-14 06:03:32 +03:00
|
|
|
endef
|
2005-10-22 04:40:50 +03:00
|
|
|
|
2006-04-14 06:03:32 +03:00
|
|
|
define Build/Prepare
|
2006-09-19 00:56:07 +03:00
|
|
|
$(call Build/Prepare/Default,)
|
2006-04-14 06:03:32 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
2006-05-12 01:36:20 +03:00
|
|
|
$(call Build/Configure/Default,)
|
2006-04-14 06:03:32 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
2006-05-15 23:30:26 +03:00
|
|
|
$(call Build/Compile/Default,)
|
2006-04-14 06:03:32 +03:00
|
|
|
endef
|
2005-04-18 09:17:39 +03:00
|
|
|
|
2007-03-16 01:57:18 +02:00
|
|
|
$(PACKAGE_DIR):
|
2006-05-10 23:32:22 +03:00
|
|
|
mkdir -p $@
|
2006-06-21 02:40:02 +03:00
|
|
|
|
2007-03-16 01:57:18 +02:00
|
|
|
dumpinfo:
|
|
|
|
download:
|
2007-03-23 21:13:08 +02:00
|
|
|
prepare: $(STAMP_PREPARED)
|
|
|
|
configure: $(STAMP_CONFIGURED)
|
2007-03-16 01:57:18 +02:00
|
|
|
compile:
|
|
|
|
install:
|
|
|
|
clean: FORCE
|
|
|
|
$(Build/UninstallDev)
|
2007-03-31 16:45:50 +03:00
|
|
|
$(Build/Clean)
|
2007-03-16 01:57:18 +02:00
|
|
|
@rm -f $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
|
|
|
|
@rm -rf $(PKG_BUILD_DIR)
|