# # Copyright (C) 2007-2008 OpenWrt.org # Copyright (C) 2016 LEDE Project # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # ifneq ($(__target_inc),1) __target_inc=1 # default device type DEVICE_TYPE?=router # Default packages - the really basic set DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd odhcp6c DEFAULT_PACKAGES.bootloader:= ifneq ($(DUMP),) all: dumpinfo endif target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1)))) ifeq ($(DUMP),) PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD) SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir)))) else PLATFORM_DIR:=${CURDIR} ifeq ($(SUBTARGETS),) SUBTARGETS:=$(strip $(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk))) endif endif TARGETID:=$(BOARD)$(if $(SUBTARGET),/$(SUBTARGET)) PLATFORM_SUBDIR:=$(PLATFORM_DIR)$(if $(SUBTARGET),/$(SUBTARGET)) ifneq ($(TARGET_BUILD),1) ifndef DUMP include $(PLATFORM_DIR)/Makefile ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR)) include $(PLATFORM_SUBDIR)/target.mk endif endif else ifneq ($(SUBTARGET),) -include ./$(SUBTARGET)/target.mk endif endif # Add device specific packages (here below to allow device type set from subtarget) DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE)) filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1)) extra_packages = $(if $(filter wpad-mini wpad nas,$(1)),iwinfo) define ProfileDefault NAME:= PRIORITY:= PACKAGES:= endef ifndef Profile define Profile $(eval $(call ProfileDefault)) $(eval $(call Profile/$(1))) dumpinfo : $(call shexport,Profile/$(1)/Description) DUMPINFO += \ echo "Target-Profile: $(1)"; \ $(if $(PRIORITY), echo "Target-Profile-Priority: $(PRIORITY)"; ) \ echo "Target-Profile-Name: $(NAME)"; \ echo "Target-Profile-Packages: $(PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES) $(PACKAGES))"; \ echo "Target-Profile-Description:"; \ echo "$$$$$$$$$(call shvar,Profile/$(1)/Description)"; \ echo "@@"; \ echo; endef endif ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR)) define IncludeProfiles -include $(sort $(wildcard $(PLATFORM_DIR)/profiles/*.mk)) -include $(sort $(wildcard $(PLATFORM_SUBDIR)/profiles/*.mk)) endef else define IncludeProfiles -include $(sort $(wildcard $(PLATFORM_DIR)/profiles/*.mk)) endef endif PROFILE?=$(call qstrip,$(CONFIG_TARGET_PROFILE)) ifeq ($(TARGET_BUILD),1) ifneq ($(DUMP),) $(eval $(call IncludeProfiles)) endif endif ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),) include $(INCLUDE_DIR)/kernel-version.mk endif GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(if $(wildcard $(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER)) GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)),"$(dir)") __config_name_list = $(1)/config-$(KERNEL_PATCHVER) $(1)/config-default __config_list = $(firstword $(wildcard $(call __config_name_list,$(1)))) find_kernel_config=$(if $(__config_list),$(__config_list),$(lastword $(__config_name_list))) GENERIC_LINUX_CONFIG = $(call find_kernel_config,$(GENERIC_PLATFORM_DIR)) LINUX_TARGET_CONFIG = $(call find_kernel_config,$(PLATFORM_DIR)) ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR)) LINUX_SUBTARGET_CONFIG = $(call find_kernel_config,$(PLATFORM_SUBDIR)) endif # config file list used for compiling LINUX_KCONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(LINUX_SUBTARGET_CONFIG) $(TOPDIR)/env/kernel-config) # default config list for reconfiguring # defaults to subtarget if subtarget exists and target does not # defaults to target otherwise USE_SUBTARGET_CONFIG = $(if $(wildcard $(LINUX_TARGET_CONFIG)),,$(if $(LINUX_SUBTARGET_CONFIG),1)) LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG))) LINUX_RECONFIG_TARGET = $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG),$(LINUX_TARGET_CONFIG)) # select the config file to be changed by kernel_menuconfig/kernel_oldconfig ifeq ($(CONFIG_TARGET),platform) LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG)) LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG) endif ifeq ($(CONFIG_TARGET),subtarget) LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(LINUX_SUBTARGET_CONFIG)) LINUX_RECONFIG_TARGET = $(LINUX_SUBTARGET_CONFIG) endif ifeq ($(CONFIG_TARGET),subtarget_platform) LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_SUBTARGET_CONFIG) $(LINUX_TARGET_CONFIG)) LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG) endif ifeq ($(CONFIG_TARGET),env) LINUX_RECONFIG_LIST = $(LINUX_KCONFIG_LIST) LINUX_RECONFIG_TARGET = $(TOPDIR)/env/kernel-config endif __linux_confcmd = $(SCRIPT_DIR)/kconfig.pl $(2) $(patsubst %,+,$(wordlist 2,9999,$(1))) $(1) LINUX_CONF_CMD = $(call __linux_confcmd,$(LINUX_KCONFIG_LIST),) LINUX_RECONF_CMD = $(call __linux_confcmd,$(LINUX_RECONFIG_LIST),) LINUX_RECONF_DIFF = $(call __linux_confcmd,$(filter-out $(LINUX_RECONFIG_TARGET),$(LINUX_RECONFIG_LIST)),'>') ifeq ($(DUMP),1) BuildTarget=$(BuildTargets/DumpCurrent) CPU_CFLAGS = -Os -pipe ifneq ($(findstring mips,$(ARCH)),) ifneq ($(findstring mips64,$(ARCH)),) CPU_TYPE ?= mips64 else CPU_TYPE ?= mips32 endif CPU_CFLAGS += -mno-branch-likely CPU_CFLAGS_mips32 = -mips32 -mtune=mips32 CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2 CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64 CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc CPU_CFLAGS_octeon = -march=octeon -mabi=64 endif ifeq ($(ARCH),i386) CPU_TYPE ?= i486 CPU_CFLAGS_i486 = -march=i486 CPU_CFLAGS_pentium4 = -march=pentium4 CPU_CFLAGS_geode = -march=geode -mmmx -m3dnow endif ifneq ($(findstring arm,$(ARCH)),) CPU_TYPE ?= xscale CPU_CFLAGS_arm920t = -mcpu=arm920t CPU_CFLAGS_arm926ej-s = -mcpu=arm926ej-s CPU_CFLAGS_arm1136j-s = -mcpu=arm1136j-s CPU_CFLAGS_arm1176jzf-s = -mcpu=arm1176jzf-s CPU_CFLAGS_cortex-a5 = -mcpu=cortex-a5 CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7 CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8 CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9 CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53 CPU_CFLAGS_fa526 = -mcpu=fa526 CPU_CFLAGS_mpcore = -mcpu=mpcore CPU_CFLAGS_xscale = -mcpu=xscale ifeq ($(CONFIG_SOFT_FLOAT),) CPU_CFLAGS_neon = -mfpu=neon CPU_CFLAGS_vfp = -mfpu=vfp CPU_CFLAGS_vfpv3 = -mfpu=vfpv3-d16 CPU_CFLAGS_neon-vfpv4 = -mfpu=neon-vfpv4 endif endif ifeq ($(ARCH),powerpc) CPU_CFLAGS_603e:=-mcpu=603e CPU_CFLAGS_8540:=-mcpu=8540 CPU_CFLAGS_405:=-mcpu=405 CPU_CFLAGS_440:=-mcpu=440 CPU_CFLAGS_464fp:=-mcpu=464fp endif ifeq ($(ARCH),sparc) CPU_TYPE = sparc CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc endif ifeq ($(ARCH),aarch64) CPU_TYPE ?= armv8-a CPU_CFLAGS_armv8-a = -mcpu=armv8-a CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53 endif ifeq ($(ARCH),arc) CPU_TYPE ?= arc700 CPU_CFLAGS += -matomic CPU_CFLAGS_arc700 = -marc700 CPU_CFLAGS_archs = -marchs endif DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE))) ifneq ($(BOARD),) TMP_CONFIG:=$(TMP_DIR)/.kconfig-$(call target_conf,$(TARGETID)) $(TMP_CONFIG): $(LINUX_KCONFIG_LIST) $(LINUX_CONF_CMD) > $@ || rm -f $@ -include $(TMP_CONFIG) .SILENT: $(TMP_CONFIG) .PRECIOUS: $(TMP_CONFIG) ifneq ($(CONFIG_OF),) FEATURES += dt endif ifneq ($(CONFIG_GENERIC_GPIO)$(CONFIG_GPIOLIB),) FEATURES += gpio endif ifneq ($(CONFIG_PCI),) FEATURES += pci endif ifneq ($(CONFIG_PCIEPORTBUS),) FEATURES += pcie endif ifneq ($(CONFIG_USB)$(CONFIG_USB_SUPPORT),) ifneq ($(CONFIG_USB_ARCH_HAS_HCD)$(CONFIG_USB_EHCI_HCD),) FEATURES += usb endif endif ifneq ($(CONFIG_PCMCIA)$(CONFIG_PCCARD),) FEATURES += pcmcia endif ifneq ($(CONFIG_VGA_CONSOLE)$(CONFIG_FB),) FEATURES += display endif ifneq ($(CONFIG_RTC_CLASS),) FEATURES += rtc endif ifneq ($(CONFIG_VIRTIO),) FEATURES += virtio endif FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v))) # remove duplicates FEATURES:=$(sort $(FEATURES)) endif endif CUR_SUBTARGET:=$(SUBTARGET) ifeq ($(SUBTARGETS),) CUR_SUBTARGET := default endif define BuildTargets/DumpCurrent .PHONY: dumpinfo dumpinfo : export DESCRIPTION=$$(Target/Description) dumpinfo: @echo 'Target: $(TARGETID)'; \ echo 'Target-Board: $(BOARD)'; \ echo 'Target-Name: $(BOARDNAME)$(if $(SUBTARGETS),$(if $(SUBTARGET),))'; \ echo 'Target-Arch: $(ARCH)'; \ echo 'Target-Arch-Packages: $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(ARCH)$(if $(CPU_TYPE),_$(CPU_TYPE))$(if $(CPU_SUBTYPE),_$(CPU_SUBTYPE)))'; \ echo 'Target-Features: $(FEATURES)'; \ echo 'Target-Depends: $(DEPENDS)'; \ echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \ echo 'CPU-Type: $(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))'; \ echo 'Linux-Version: $(LINUX_VERSION)'; \ echo 'Linux-Release: $(LINUX_RELEASE)'; \ echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \ $(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; )) \ echo 'Target-Description:'; \ echo "$$$$DESCRIPTION"; \ echo '@@'; \ echo 'Default-Packages: $(DEFAULT_PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES))'; \ $(DUMPINFO) $(if $(CUR_SUBTARGET),$(SUBMAKE) -r --no-print-directory -C image -s DUMP=1 SUBTARGET=$(CUR_SUBTARGET)) $(if $(SUBTARGET),,@$(foreach SUBTARGET,$(SUBTARGETS),$(SUBMAKE) -s DUMP=1 SUBTARGET=$(SUBTARGET); )) endef include $(INCLUDE_DIR)/kernel.mk ifeq ($(TARGET_BUILD),1) include $(INCLUDE_DIR)/kernel-build.mk BuildTarget?=$(BuildKernel) endif endif #__target_inc ='n210' href='#n210'>210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
__package_mk:=1
all: $(if $(DUMP),dumpinfo,compile)
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_MD5SUM ?= unknown
PKG_BUILD_PARALLEL ?=
ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),)
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j)
else
MAKE_J:=-j$(CONFIG_PKG_BUILD_JOBS)
endif
ifeq ($(strip $(PKG_BUILD_PARALLEL)),0)
PKG_JOBS?=-j1
else
PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),\
$(if $(CONFIG_PKG_BUILD_PARALLEL),$(MAKE_J),-j1),-j1)
endif
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
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
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))$(call confvar,$(PKG_PREPARED_DEPENDS)))
endif
STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
STAMP_CONFIGURED_WILDCARD=$(patsubst %_$(call confvar,$(PKG_CONFIG_DEPENDS)),%_*,$(STAMP_CONFIGURED))
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_NAME)_installed
STAGING_FILES_LIST:=$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
USE_GIT_TREE:=1
QUILT:=1
endif
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
include $(INCLUDE_DIR)/download.mk
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/package-defaults.mk
include $(INCLUDE_DIR)/package-dumpinfo.mk
include $(INCLUDE_DIR)/package-ipkg.mk
include $(INCLUDE_DIR)/package-bin.mk
include $(INCLUDE_DIR)/autotools.mk
override MAKEFLAGS=
CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
CUR_MAKEFILE:=$(filter-out Makefile,$(firstword $(MAKEFILE_LIST)))
SUBMAKE:=$(NO_TRACE_MAKE) $(if $(CUR_MAKEFILE),-f $(CUR_MAKEFILE))
PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
unexport QUIET
ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
ifneq ($(if $(QUILT),,$(CONFIG_AUTOREBUILD)),)
define Build/Autoclean
$(PKG_BUILD_DIR)/.dep_files: $(STAMP_PREPARED)
$(call rdep,${CURDIR} $(PKG_FILE_DEPENDS),$(STAMP_PREPARED),$(PKG_BUILD_DIR)/.dep_files,-x "*/.dep_*")
$(if $(filter prepare,$(MAKECMDGOALS)),,$(call rdep,$(PKG_BUILD_DIR),$(STAMP_BUILT),,-x "*/.dep_*" -x "*/ipkg*"))
endef
endif
endif
ifeq ($(CONFIG_$(PKG_NAME)_USE_CUSTOM_SOURCE_DIR),y)
# disable load stage
PKG_SOURCE_URL:=
# add hook to install a link to customer source path of dedicated package
Hooks/Prepare/Pre += prepare_custom_source_directory
ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
Hooks/Configure/Pre += autoreconf_target
endif
# define empty default action
define Build/Prepare/Default
@:
endef
endif
define Download/default
FILE:=$(PKG_SOURCE)
URL:=$(PKG_SOURCE_URL)
SUBDIR:=$(PKG_SOURCE_SUBDIR)
PROTO:=$(PKG_SOURCE_PROTO)
$(if $(PKG_SOURCE_MIRROR),MIRROR:=$(filter 1,$(PKG_MIRROR)))
$(if $(PKG_MIRROR_MD5SUM),MIRROR_MD5SUM:=$(PKG_MIRROR_MD5SUM))
VERSION:=$(PKG_SOURCE_VERSION)
MD5SUM:=$(PKG_MD5SUM)
endef
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
define Build/Exports/Default
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
$(1) : export PATH=$$(TARGET_PATH_PKG)
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache
endef
Build/Exports=$(Build/Exports/Default)
define Build/DefaultTargets
$(if $(QUILT),$(Build/Quilt))
$(if $(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(call Build/Autoclean)
download:
$(foreach hook,$(Hooks/Download),
$(call $(hook))$(sep)
)
$(STAMP_PREPARED) : export PATH=$$(TARGET_PATH_PKG)
$(STAMP_PREPARED):
@-rm -rf $(PKG_BUILD_DIR)
@mkdir -p $(PKG_BUILD_DIR)
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
$(Build/Prepare)
$(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
touch $$@
$(call Build/Exports,$(STAMP_CONFIGURED))
$(STAMP_CONFIGURED): $(STAMP_PREPARED)
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
$(Build/Configure)
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
rm -f $(STAMP_CONFIGURED_WILDCARD)
touch $$@
$(call Build/Exports,$(STAMP_BUILT))
$(STAMP_BUILT): $(STAMP_CONFIGURED)
$(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
$(Build/Compile)
$(foreach hook,$(Hooks/Compile/Post),$(call $(hook))$(sep))
$(Build/Install)
$(foreach hook,$(Hooks/Install/Post),$(call $(hook))$(sep))
touch $$@
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
$(STAMP_INSTALLED): $(STAMP_BUILT)
$(SUBMAKE) -j1 clean-staging
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
mkdir -p $(TMP_DIR)/stage-$(PKG_NAME)/host $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages
$(foreach hook,$(Hooks/InstallDev/Pre),\
$(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
)
$(call Build/InstallDev,$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)
$(foreach hook,$(Hooks/InstallDev/Post),\
$(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
)
if [ -d $(TMP_DIR)/stage-$(PKG_NAME) ]; then \
(cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(TMP_DIR)/stage-$(PKG_NAME).files); \
$(call locked, \
mv $(TMP_DIR)/stage-$(PKG_NAME).files $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) && \
$(CP) $(TMP_DIR)/stage-$(PKG_NAME)/* $(STAGING_DIR)/; \
,staging-dir); \
fi
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
touch $$@
ifdef Build/InstallDev
compile: $(STAMP_INSTALLED)
endif
define Build/DefaultTargets
endef
prepare: $(STAMP_PREPARED)
configure: $(STAMP_CONFIGURED)
dist: $(STAMP_CONFIGURED)
distcheck: $(STAMP_CONFIGURED)
endef
define Build/IncludeOverlay
$(eval -include $(wildcard $(TOPDIR)/overlay/*/$(PKG_NAME).mk))
define Build/IncludeOverlay
endef
endef
define BuildPackage
$(Build/IncludeOverlay)
$(eval $(Package/Default))
$(eval $(Package/$(1)))
ifdef DESCRIPTION
$$(error DESCRIPTION:= is obsolete, use Package/PKG_NAME/description)
endif
ifndef Package/$(1)/description
define Package/$(1)/description
$(TITLE)
endef
endif
$(foreach FIELD, TITLE CATEGORY SECTION VERSION,
ifeq ($($(FIELD)),)
$$(error Package/$(1) is missing the $(FIELD) field)
endif
)
$(call shexport,Package/$(1)/description)
$(call shexport,Package/$(1)/config)
$(if $(DUMP), \
$(Dumpinfo/Package), \
$(foreach target, \
$(if $(Package/$(1)/targets),$(Package/$(1)/targets), \
$(if $(PKG_TARGETS),$(PKG_TARGETS), ipkg) \
), $(BuildTarget/$(target)) \
) \
)
$(if $(PKG_HOST_ONLY)$(DUMP),,$(call Build/DefaultTargets,$(1)))
endef
define pkg_install_files
$(foreach install_file,$(1),$(INSTALL_DIR) $(3)/`dirname $(install_file)`; $(INSTALL_DATA) $(2)/$(install_file) $(3)/`dirname $(install_file)`;)
endef
define pkg_install_bin
$(foreach install_apps,$(1),$(INSTALL_DIR) $(3)/`dirname $(install_apps)`; $(INSTALL_BIN) $(2)/$(install_apps) $(3)/`dirname $(install_apps)`;)
endef
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,))
Build/Dist=$(call Build/Dist/Default,)
Build/DistCheck=$(call Build/DistCheck/Default,)
.NOTPARALLEL:
.PHONY: prepare-package-install
prepare-package-install:
@mkdir -p $(PKG_INFO_DIR)
@touch $(PKG_INSTALL_STAMP).clean
@echo "$(filter-out essential,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
$(PACKAGE_DIR):
mkdir -p $@
dumpinfo:
download:
prepare:
configure:
compile: prepare-package-install
install: compile
clean-staging: FORCE
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; \
)
clean: clean-staging FORCE
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
$(Build/Clean)
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
rm -rf $(PKG_BUILD_DIR)
dist:
$(Build/Dist)
distcheck:
$(Build/DistCheck)