2008-09-11 16:13:14 +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.
|
|
|
|
#
|
2007-03-15 23:57:18 +00:00
|
|
|
|
2012-06-14 20:26:04 +00:00
|
|
|
__package_mk:=1
|
|
|
|
|
2016-12-14 14:36:39 +00:00
|
|
|
all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
|
2006-04-14 03:03:32 +00:00
|
|
|
|
2016-12-21 15:39:56 +00:00
|
|
|
include $(INCLUDE_DIR)/download.mk
|
|
|
|
|
2007-09-03 07:51:56 +00:00
|
|
|
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
2007-03-16 19:18:55 +00:00
|
|
|
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
|
2010-08-18 13:57:58 +00:00
|
|
|
PKG_BUILD_PARALLEL ?=
|
2013-08-14 13:02:29 +00:00
|
|
|
PKG_USE_MIPS16 ?= 1
|
2016-01-25 15:49:31 +00:00
|
|
|
PKG_IREMAP ?= 1
|
2010-10-16 18:42:58 +00:00
|
|
|
|
2017-01-05 23:28:51 +00:00
|
|
|
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j))
|
2012-09-15 10:21:24 +00:00
|
|
|
|
2010-10-16 18:42:58 +00:00
|
|
|
ifeq ($(strip $(PKG_BUILD_PARALLEL)),0)
|
|
|
|
PKG_JOBS?=-j1
|
|
|
|
else
|
2017-01-05 23:28:51 +00:00
|
|
|
PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL),$(MAKE_J),-j1)
|
2010-10-16 18:42:58 +00:00
|
|
|
endif
|
2013-08-14 14:55:49 +00:00
|
|
|
ifdef CONFIG_USE_MIPS16
|
2013-08-14 13:02:29 +00:00
|
|
|
ifeq ($(strip $(PKG_USE_MIPS16)),1)
|
|
|
|
TARGET_ASFLAGS_DEFAULT = $(filter-out -mips16 -minterlink-mips16,$(TARGET_CFLAGS))
|
|
|
|
TARGET_CFLAGS += -mips16 -minterlink-mips16
|
|
|
|
endif
|
|
|
|
endif
|
2016-01-25 15:49:31 +00:00
|
|
|
ifeq ($(strip $(PKG_IREMAP)),1)
|
|
|
|
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
|
|
|
|
TARGET_CFLAGS += $(IREMAP_CFLAGS)
|
|
|
|
endif
|
2007-03-16 19:18:55 +00:00
|
|
|
|
2015-06-20 17:37:18 +00:00
|
|
|
include $(INCLUDE_DIR)/hardening.mk
|
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-04-15 18:28:24 +00:00
|
|
|
include $(INCLUDE_DIR)/depends.mk
|
2006-07-29 11:30:06 +00:00
|
|
|
|
2014-02-23 17:32:04 +00:00
|
|
|
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
|
|
|
|
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \
|
|
|
|
$(filter-out @%, $(patsubst +%,%,$(1))), \
|
|
|
|
$(if $(findstring :,$(dep)), \
|
|
|
|
$(word 2,$(subst :,$(space),$(dep))), \
|
|
|
|
$(dep) \
|
|
|
|
) \
|
|
|
|
))))
|
|
|
|
|
2016-01-04 01:33:32 +00:00
|
|
|
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
|
2011-03-03 00:17:08 +00:00
|
|
|
STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
|
|
|
|
PREV_STAMP_PREPARED:=$(if $(STAMP_NO_AUTOREBUILD),$(wildcard $(PKG_BUILD_DIR)/.prepared*))
|
|
|
|
ifneq ($(PREV_STAMP_PREPARED),)
|
|
|
|
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
|
|
|
|
CONFIG_AUTOREBUILD:=
|
|
|
|
else
|
2012-06-14 20:26:00 +00:00
|
|
|
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))$(call confvar,$(PKG_PREPARED_DEPENDS)))
|
2011-03-03 00:17:08 +00:00
|
|
|
endif
|
2015-03-21 21:47:53 +00:00
|
|
|
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
2016-09-26 13:14:50 +00:00
|
|
|
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
|
2007-03-23 19:13:08 +00:00
|
|
|
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
|
2016-01-04 01:33:32 +00:00
|
|
|
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed
|
2007-06-03 06:16:08 +00:00
|
|
|
|
2016-01-04 01:33:32 +00:00
|
|
|
STAGING_FILES_LIST:=$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list
|
2015-05-26 09:17:13 +00:00
|
|
|
|
|
|
|
define CleanStaging
|
|
|
|
rm -f $(STAMP_INSTALLED)
|
|
|
|
@-(\
|
|
|
|
cd "$(STAGING_DIR)"; \
|
|
|
|
if [ -f packages/$(STAGING_FILES_LIST) ]; then \
|
|
|
|
cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \
|
|
|
|
fi; \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2011-10-09 16:33:59 +00:00
|
|
|
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
|
|
|
|
USE_GIT_TREE:=1
|
|
|
|
QUILT:=1
|
|
|
|
endif
|
2014-04-18 14:58:01 +00:00
|
|
|
ifdef USE_SOURCE_DIR
|
|
|
|
QUILT:=1
|
|
|
|
endif
|
|
|
|
ifneq ($(wildcard $(PKG_BUILD_DIR)/.source_dir),)
|
|
|
|
QUILT:=1
|
|
|
|
endif
|
2010-08-16 09:45:21 +00:00
|
|
|
|
2012-11-07 16:15:22 +00:00
|
|
|
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
|
2012-10-06 16:01:06 +00:00
|
|
|
|
2007-06-03 06:16:08 +00: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-09-29 01:21:56 +00:00
|
|
|
include $(INCLUDE_DIR)/package-bin.mk
|
2007-12-27 02:11:07 +00:00
|
|
|
include $(INCLUDE_DIR)/autotools.mk
|
2007-06-03 06:16:08 +00:00
|
|
|
|
2007-07-30 21:14:08 +00:00
|
|
|
override MAKEFLAGS=
|
2015-03-28 13:38:34 +00:00
|
|
|
CONFIG_SITE:=$(INCLUDE_DIR)/site/$(ARCH)
|
2008-01-03 02:12:46 +00:00
|
|
|
CUR_MAKEFILE:=$(filter-out Makefile,$(firstword $(MAKEFILE_LIST)))
|
|
|
|
SUBMAKE:=$(NO_TRACE_MAKE) $(if $(CUR_MAKEFILE),-f $(CUR_MAKEFILE))
|
2014-03-07 18:18:56 +00:00
|
|
|
PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig
|
2015-01-18 00:37:18 +00:00
|
|
|
unexport QUIET CONFIG_SITE
|
2006-10-19 15:25:58 +00:00
|
|
|
|
2007-07-30 18:39:20 +00:00
|
|
|
ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
|
2007-07-30 23:52:17 +00:00
|
|
|
ifneq ($(if $(QUILT),,$(CONFIG_AUTOREBUILD)),)
|
2007-06-11 17:19:43 +00:00
|
|
|
define Build/Autoclean
|
|
|
|
$(PKG_BUILD_DIR)/.dep_files: $(STAMP_PREPARED)
|
2009-04-27 16:02:21 +00:00
|
|
|
$(call rdep,${CURDIR} $(PKG_FILE_DEPENDS),$(STAMP_PREPARED),$(PKG_BUILD_DIR)/.dep_files,-x "*/.dep_*")
|
2007-09-01 05:20:21 +00:00
|
|
|
$(if $(filter prepare,$(MAKECMDGOALS)),,$(call rdep,$(PKG_BUILD_DIR),$(STAMP_BUILT),,-x "*/.dep_*" -x "*/ipkg*"))
|
2007-06-11 17:19:43 +00:00
|
|
|
endef
|
|
|
|
endif
|
2007-04-15 18:28:24 +00:00
|
|
|
endif
|
|
|
|
|
2011-10-09 16:33:59 +00:00
|
|
|
ifdef USE_GIT_TREE
|
|
|
|
define Build/Prepare/Default
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
|
|
ln -s $(CURDIR)/git-src $(PKG_BUILD_DIR)/.git
|
|
|
|
( cd $(PKG_BUILD_DIR); git checkout .)
|
|
|
|
endef
|
|
|
|
endif
|
2014-04-18 14:58:01 +00:00
|
|
|
ifdef USE_SOURCE_DIR
|
|
|
|
define Build/Prepare/Default
|
|
|
|
rm -rf $(PKG_BUILD_DIR)
|
|
|
|
$(if $(wildcard $(USE_SOURCE_DIR)/*),,@echo "Error: USE_SOURCE_DIR=$(USE_SOURCE_DIR) path not found"; false)
|
|
|
|
ln -snf $(USE_SOURCE_DIR) $(PKG_BUILD_DIR)
|
|
|
|
touch $(PKG_BUILD_DIR)/.source_dir
|
|
|
|
endef
|
|
|
|
endif
|
2011-10-09 16:33:59 +00:00
|
|
|
|
2009-04-22 22:05:55 +00:00
|
|
|
define Build/Exports/Default
|
2017-01-18 18:47:36 +00:00
|
|
|
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
|
2009-04-22 22:05:55 +00:00
|
|
|
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
|
|
|
|
$(1) : export PATH=$$(TARGET_PATH_PKG)
|
|
|
|
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
2011-02-06 16:04:33 +00:00
|
|
|
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
|
|
|
|
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
|
2011-03-15 19:58:32 +00:00
|
|
|
$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache
|
2009-04-22 22:05:55 +00:00
|
|
|
endef
|
|
|
|
Build/Exports=$(Build/Exports/Default)
|
|
|
|
|
2016-12-14 14:36:39 +00:00
|
|
|
define Build/CoreTargets
|
2007-09-29 04:29:11 +00:00
|
|
|
$(if $(QUILT),$(Build/Quilt))
|
2007-04-15 18:28:24 +00:00
|
|
|
$(call Build/Autoclean)
|
2017-01-18 13:00:48 +00:00
|
|
|
$(call DefaultTargets)
|
2006-05-14 09:30:29 +00:00
|
|
|
|
2011-09-30 11:12:13 +00:00
|
|
|
download:
|
|
|
|
$(foreach hook,$(Hooks/Download),
|
|
|
|
$(call $(hook))$(sep)
|
|
|
|
)
|
|
|
|
|
2009-03-13 16:16:54 +00:00
|
|
|
$(STAMP_PREPARED) : export PATH=$$(TARGET_PATH_PKG)
|
2016-05-05 18:37:40 +00:00
|
|
|
$(STAMP_PREPARED): $(STAMP_PREPARED_DEPENDS)
|
2006-05-11 00:18:12 +00:00
|
|
|
@-rm -rf $(PKG_BUILD_DIR)
|
|
|
|
@mkdir -p $(PKG_BUILD_DIR)
|
2007-12-27 02:11:07 +00:00
|
|
|
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/Prepare)
|
2007-12-27 02:11:07 +00:00
|
|
|
$(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
|
2006-05-11 23:14:04 +00:00
|
|
|
touch $$@
|
2006-04-14 03:03:32 +00:00
|
|
|
|
2009-04-22 22:05:55 +00:00
|
|
|
$(call Build/Exports,$(STAMP_CONFIGURED))
|
2016-05-05 18:37:40 +00:00
|
|
|
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(STAMP_CONFIGURED_DEPENDS)
|
2015-05-26 09:17:13 +00:00
|
|
|
$(CleanStaging)
|
2007-12-27 02:11:07 +00:00
|
|
|
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/Configure)
|
2007-12-27 02:11:07 +00:00
|
|
|
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
|
2011-11-05 19:09:40 +00:00
|
|
|
rm -f $(STAMP_CONFIGURED_WILDCARD)
|
2006-04-14 03:03:32 +00:00
|
|
|
touch $$@
|
|
|
|
|
2009-04-22 22:05:55 +00:00
|
|
|
$(call Build/Exports,$(STAMP_BUILT))
|
2016-05-05 18:37:40 +00:00
|
|
|
$(STAMP_BUILT): $(STAMP_CONFIGURED) $(STAMP_BUILT_DEPENDS)
|
2007-12-27 02:11:07 +00:00
|
|
|
$(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
|
2007-03-15 23:57:18 +00:00
|
|
|
$(Build/Compile)
|
2007-12-27 02:11:07 +00:00
|
|
|
$(foreach hook,$(Hooks/Compile/Post),$(call $(hook))$(sep))
|
2008-09-01 11:03:58 +00:00
|
|
|
$(Build/Install)
|
|
|
|
$(foreach hook,$(Hooks/Install/Post),$(call $(hook))$(sep))
|
2007-11-20 22:43:38 +00:00
|
|
|
touch $$@
|
|
|
|
|
2009-03-13 16:16:54 +00:00
|
|
|
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
|
2007-11-20 22:43:38 +00:00
|
|
|
$(STAMP_INSTALLED): $(STAMP_BUILT)
|
2016-01-04 01:33:32 +00:00
|
|
|
rm -rf $(TMP_DIR)/stage-$(PKG_DIR_NAME)
|
|
|
|
mkdir -p $(TMP_DIR)/stage-$(PKG_DIR_NAME)/host $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages
|
2008-09-11 16:13:14 +00:00
|
|
|
$(foreach hook,$(Hooks/InstallDev/Pre),\
|
2016-01-04 01:33:32 +00:00
|
|
|
$(call $(hook),$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)$(sep)\
|
2008-09-11 16:13:14 +00:00
|
|
|
)
|
2016-01-04 01:33:32 +00:00
|
|
|
$(call Build/InstallDev,$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)
|
2008-09-11 16:13:14 +00:00
|
|
|
$(foreach hook,$(Hooks/InstallDev/Post),\
|
2016-01-04 01:33:32 +00:00
|
|
|
$(call $(hook),$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)$(sep)\
|
2008-09-11 16:13:14 +00:00
|
|
|
)
|
2013-05-29 10:31:45 +00:00
|
|
|
if [ -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) ]; then \
|
|
|
|
$(SCRIPT_DIR)/clean-package.sh \
|
|
|
|
"$(STAGING_DIR)/packages/$(STAGING_FILES_LIST)" \
|
|
|
|
"$(STAGING_DIR)"; \
|
|
|
|
fi
|
2016-01-04 01:33:32 +00:00
|
|
|
if [ -d $(TMP_DIR)/stage-$(PKG_DIR_NAME) ]; then \
|
|
|
|
(cd $(TMP_DIR)/stage-$(PKG_DIR_NAME); find ./ > $(TMP_DIR)/stage-$(PKG_DIR_NAME).files); \
|
2010-11-04 12:28:55 +00:00
|
|
|
$(call locked, \
|
2016-01-04 01:33:32 +00:00
|
|
|
mv $(TMP_DIR)/stage-$(PKG_DIR_NAME).files $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) && \
|
|
|
|
$(CP) $(TMP_DIR)/stage-$(PKG_DIR_NAME)/* $(STAGING_DIR)/; \
|
2010-11-04 12:28:55 +00:00
|
|
|
,staging-dir); \
|
2007-12-25 01:39:15 +00:00
|
|
|
fi
|
2016-01-04 01:33:32 +00:00
|
|
|
rm -rf $(TMP_DIR)/stage-$(PKG_DIR_NAME)
|
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
|
2007-11-20 22:43:38 +00:00
|
|
|
compile: $(STAMP_INSTALLED)
|
2006-06-01 00:06:16 +00:00
|
|
|
endif
|
2006-05-31 16:20:27 +00:00
|
|
|
|
2007-11-16 03:48:43 +00:00
|
|
|
prepare: $(STAMP_PREPARED)
|
|
|
|
configure: $(STAMP_CONFIGURED)
|
2009-05-31 12:01:05 +00:00
|
|
|
dist: $(STAMP_CONFIGURED)
|
|
|
|
distcheck: $(STAMP_CONFIGURED)
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
2005-07-24 19:58:14 +00:00
|
|
|
|
2016-12-14 14:36:39 +00:00
|
|
|
define Build/DefaultTargets
|
|
|
|
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
|
|
|
$(if $(DUMP),,$(Build/CoreTargets))
|
|
|
|
|
|
|
|
define Build/DefaultTargets
|
|
|
|
endef
|
|
|
|
endef
|
|
|
|
|
2009-08-31 01:11:25 +00:00
|
|
|
define Build/IncludeOverlay
|
2016-01-04 01:33:32 +00:00
|
|
|
$(eval -include $(wildcard $(TOPDIR)/overlay/*/$(PKG_DIR_NAME).mk))
|
2009-08-31 01:11:25 +00:00
|
|
|
define Build/IncludeOverlay
|
|
|
|
endef
|
|
|
|
endef
|
|
|
|
|
2006-04-19 23:56:04 +00:00
|
|
|
define BuildPackage
|
2009-08-31 01:11:25 +00:00
|
|
|
$(Build/IncludeOverlay)
|
2007-03-15 23:57:18 +00:00
|
|
|
$(eval $(Package/Default))
|
|
|
|
$(eval $(Package/$(1)))
|
|
|
|
|
2007-10-14 04:49:05 +00:00
|
|
|
ifdef DESCRIPTION
|
2009-02-22 04:36:56 +00:00
|
|
|
$$(error DESCRIPTION:= is obsolete, use Package/PKG_NAME/description)
|
2007-10-14 04:49:05 +00:00
|
|
|
endif
|
|
|
|
|
2007-03-15 23:57:18 +00:00
|
|
|
ifndef Package/$(1)/description
|
|
|
|
define Package/$(1)/description
|
2007-10-14 04:49:05 +00:00
|
|
|
$(TITLE)
|
2007-03-15 23:57:18 +00:00
|
|
|
endef
|
|
|
|
endif
|
2006-04-14 01:22:55 +00:00
|
|
|
|
2014-02-23 17:32:04 +00:00
|
|
|
BUILD_PACKAGES += $(1)
|
|
|
|
$(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(DEPENDS)))
|
|
|
|
|
2012-12-22 19:56:21 +00:00
|
|
|
$(foreach FIELD, TITLE CATEGORY 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-09-28 01:23:56 +00:00
|
|
|
$(if $(DUMP), \
|
2016-12-14 14:36:39 +00:00
|
|
|
$(if $(CHECK),,$(Dumpinfo/Package)), \
|
2007-09-28 01:23:56 +00:00
|
|
|
$(foreach target, \
|
|
|
|
$(if $(Package/$(1)/targets),$(Package/$(1)/targets), \
|
2010-02-24 23:43:05 +00:00
|
|
|
$(if $(PKG_TARGETS),$(PKG_TARGETS), ipkg) \
|
2007-09-28 01:23:56 +00:00
|
|
|
), $(BuildTarget/$(target)) \
|
|
|
|
) \
|
|
|
|
)
|
2016-12-14 14:36:39 +00:00
|
|
|
$(if $(PKG_HOST_ONLY),,$(call Build/DefaultTargets,$(1)))
|
2006-04-14 03:03:32 +00:00
|
|
|
endef
|
2005-10-22 01:40:50 +00:00
|
|
|
|
2007-10-07 01:55:03 +00:00
|
|
|
define pkg_install_files
|
2007-10-20 19:13:53 +00:00
|
|
|
$(foreach install_file,$(1),$(INSTALL_DIR) $(3)/`dirname $(install_file)`; $(INSTALL_DATA) $(2)/$(install_file) $(3)/`dirname $(install_file)`;)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define pkg_install_bin
|
2007-12-17 22:24:40 +00:00
|
|
|
$(foreach install_apps,$(1),$(INSTALL_DIR) $(3)/`dirname $(install_apps)`; $(INSTALL_BIN) $(2)/$(install_apps) $(3)/`dirname $(install_apps)`;)
|
2007-10-07 01:55:03 +00:00
|
|
|
endef
|
|
|
|
|
2008-09-03 13:19:50 +00:00
|
|
|
Build/Prepare=$(call Build/Prepare/Default,)
|
|
|
|
Build/Configure=$(call Build/Configure/Default,)
|
|
|
|
Build/Compile=$(call Build/Compile/Default,)
|
|
|
|
Build/Install=$(if $(PKG_INSTALL),$(call Build/Install/Default,))
|
2009-05-31 12:01:05 +00:00
|
|
|
Build/Dist=$(call Build/Dist/Default,)
|
|
|
|
Build/DistCheck=$(call Build/DistCheck/Default,)
|
2005-04-18 06:17:39 +00:00
|
|
|
|
2012-09-17 11:17:26 +00:00
|
|
|
.NOTPARALLEL:
|
|
|
|
|
2012-10-06 16:01:06 +00:00
|
|
|
.PHONY: prepare-package-install
|
|
|
|
prepare-package-install:
|
2012-10-06 22:42:57 +00:00
|
|
|
@mkdir -p $(PKG_INFO_DIR)
|
2012-11-07 16:15:22 +00:00
|
|
|
@touch $(PKG_INSTALL_STAMP).clean
|
2016-04-06 19:55:44 +00:00
|
|
|
@echo "$(filter-out essential nonshared,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
|
2012-10-06 16:01:06 +00:00
|
|
|
|
2007-03-15 23:57:18 +00:00
|
|
|
$(PACKAGE_DIR):
|
2006-05-10 20:32:22 +00:00
|
|
|
mkdir -p $@
|
2016-12-14 14:36:39 +00:00
|
|
|
|
2012-10-06 16:01:06 +00:00
|
|
|
compile: prepare-package-install
|
|
|
|
install: compile
|
2007-12-25 01:39:15 +00:00
|
|
|
|
2015-05-26 09:17:13 +00:00
|
|
|
clean: FORCE
|
|
|
|
$(CleanStaging)
|
2007-12-23 00:41:40 +00:00
|
|
|
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
|
2007-03-31 13:45:50 +00:00
|
|
|
$(Build/Clean)
|
2010-08-16 09:45:21 +00:00
|
|
|
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
|
2007-12-25 01:39:15 +00:00
|
|
|
rm -rf $(PKG_BUILD_DIR)
|
2009-05-31 12:01:05 +00:00
|
|
|
|
|
|
|
dist:
|
|
|
|
$(Build/Dist)
|
2015-03-29 07:29:18 +00:00
|
|
|
|
2009-05-31 12:01:05 +00:00
|
|
|
distcheck:
|
2015-03-29 07:29:18 +00:00
|
|
|
$(Build/DistCheck)
|