1 ################################################################################
2 # Generic package infrastructure
4 # This file implements an infrastructure that eases development of
5 # package .mk files. It should be used for packages that do not rely
6 # on a well-known build system for which Buildroot has a dedicated
7 # infrastructure (so far, Buildroot has special support for
8 # autotools-based and CMake-based packages).
10 # See the Buildroot documentation for details on the usage of this
13 # In terms of implementation, this generic infrastructure requires the
14 # .mk file to specify:
16 # 1. Metadata information about the package: name, version,
19 # 2. Description of the commands to be executed to configure, build
20 # and install the package
21 ################################################################################
23 ################################################################################
24 # Helper functions to catch start/end of each step
25 ################################################################################
27 # Those two functions are called by each step below.
28 # They are responsible for calling all hooks defined in
29 # $(GLOBAL_INSTRUMENTATION_HOOKS) and pass each of them
31 # $1: either 'start' or 'end'
32 # $2: the name of the step
33 # $3: the name of the package
38 $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),start,$(1),$($(PKG)_NAME))$(sep))
44 $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),end,$(1),$($(PKG)_NAME))$(sep))
47 #######################################
52 printf "%s:%-5.5s:%-20.20s: %s\n" \
53 "$$(date +%s)" "$(1)" "$(2)" "$(3)" \
54 >>"$(BUILD_DIR)/build-time.log"
56 GLOBAL_INSTRUMENTATION_HOOKS += step_time
58 # Hooks to collect statistics about installed files
60 # The suffix is typically empty for the target variant, for legacy backward
63 # $(2): base directory to search in
64 # $(3): suffix of file (optional)
65 define step_pkg_size_inner
67 find . \( -type f -o -type l \) \
68 -newer $($(PKG)_DIR)/.stamp_built \
69 -exec printf '$(1),%s\n' {} + \
70 >> $(BUILD_DIR)/packages-file-list$(3).txt
74 $(if $(filter install-target,$(2)),\
75 $(if $(filter end,$(1)),$(call step_pkg_size_inner,$(3),$(TARGET_DIR))))
76 $(if $(filter install-staging,$(2)),\
77 $(if $(filter end,$(1)),$(call step_pkg_size_inner,$(3),$(STAGING_DIR),-staging)))
78 $(if $(filter install-host,$(2)),\
79 $(if $(filter end,$(1)),$(call step_pkg_size_inner,$(3),$(HOST_DIR),-host)))
81 GLOBAL_INSTRUMENTATION_HOOKS += step_pkg_size
83 # Relies on step_pkg_size, so must be after
85 $(if $(filter end-install-target,$(1)-$(2)),\
86 support/scripts/check-bin-arch -p $(3) \
87 -l $(BUILD_DIR)/packages-file-list.txt \
88 $(foreach i,$($(PKG)_BIN_ARCH_EXCLUDE),-i "$(i)") \
89 -r $(TARGET_READELF) \
90 -a $(BR2_READELF_ARCH_NAME))
93 GLOBAL_INSTRUMENTATION_HOOKS += check_bin_arch
95 # This hook checks that host packages that need libraries that we build
96 # have a proper DT_RPATH or DT_RUNPATH tag
97 define check_host_rpath
98 $(if $(filter install-host,$(2)),\
99 $(if $(filter end,$(1)),support/scripts/check-host-rpath $(3) $(HOST_DIR)))
101 GLOBAL_INSTRUMENTATION_HOOKS += check_host_rpath
103 define step_check_build_dir_one
104 if [ -d $(2) ]; then \
105 printf "%s: installs files in %s\n" $(1) $(2) >&2; \
110 define step_check_build_dir
111 $(if $(filter install-staging,$(2)),\
112 $(if $(filter end,$(1)),$(call step_check_build_dir_one,$(3),$(STAGING_DIR)/$(O))))
113 $(if $(filter install-target,$(2)),\
114 $(if $(filter end,$(1)),$(call step_check_build_dir_one,$(3),$(TARGET_DIR)/$(O))))
116 GLOBAL_INSTRUMENTATION_HOOKS += step_check_build_dir
118 # User-supplied script
119 ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
121 @$(foreach user_hook, $(BR2_INSTRUMENTATION_SCRIPTS), \
122 $(EXTRA_ENV) $(user_hook) "$(1)" "$(2)" "$(3)"$(sep))
124 GLOBAL_INSTRUMENTATION_HOOKS += step_user
127 ################################################################################
128 # Implicit targets -- produce a stamp file for each step of a package build
129 ################################################################################
131 # Retrieve the archive
132 $(BUILD_DIR)/%/.stamp_downloaded:
133 $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
134 # Only show the download message if it isn't already downloaded
135 $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \
136 if test ! -e $($(PKG)_DL_DIR)/`basename $$p` ; then \
137 $(call MESSAGE,"Downloading") ; \
141 $(foreach p,$($(PKG)_ALL_DOWNLOADS),$(call DOWNLOAD,$(p))$(sep))
142 $(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
146 # Retrieve actual source archive, e.g. for prebuilt external toolchains
147 $(BUILD_DIR)/%/.stamp_actual_downloaded:
148 $(call DOWNLOAD,$($(PKG)_ACTUAL_SOURCE_SITE)/$($(PKG)_ACTUAL_SOURCE_TARBALL)); \
153 $(BUILD_DIR)/%/.stamp_extracted:
154 @$(call step_start,extract)
155 @$(call MESSAGE,"Extracting")
156 $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep))
158 $($(PKG)_EXTRACT_CMDS)
159 # some packages have messed up permissions inside
160 $(Q)chmod -R +rw $(@D)
161 $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
162 @$(call step_end,extract)
165 # Rsync the source directory if the <pkg>_OVERRIDE_SRCDIR feature is
167 $(BUILD_DIR)/%/.stamp_rsynced:
168 @$(call MESSAGE,"Syncing from source dir $(SRCDIR)")
169 $(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep))
170 @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1)
171 rsync -au --chmod=u=rwX,go=rX $(RSYNC_VCS_EXCLUSIONS) $($(PKG)_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D)
172 $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep))
177 # The RAWNAME variable is the lowercased package name, which allows to
178 # find the package directory (typically package/<pkgname>) and the
179 # prefix of the patches
181 # For BR2_GLOBAL_PATCH_DIR, only generate if it is defined
182 $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $(PKGDIR)
183 $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))
184 $(BUILD_DIR)/%/.stamp_patched:
185 @$(call step_start,patch)
186 @$(call MESSAGE,"Patching")
187 $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
188 $(foreach p,$($(PKG)_PATCH),$(APPLY_PATCHES) $(@D) $($(PKG)_DL_DIR) $(notdir $(p))$(sep))
190 for D in $(PATCH_BASE_DIRS); do \
191 if test -d $${D}; then \
192 if test -d $${D}/$($(PKG)_VERSION); then \
193 $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION) \*.patch \*.patch.$(ARCH) || exit 1; \
195 $(APPLY_PATCHES) $(@D) $${D} \*.patch \*.patch.$(ARCH) || exit 1; \
200 $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
201 @$(call step_end,patch)
204 # Check that all directories specified in BR2_GLOBAL_PATCH_DIR exist.
205 $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\
206 $(if $(wildcard $(dir)),,\
207 $(error BR2_GLOBAL_PATCH_DIR contains nonexistent directory $(dir))))
210 $(BUILD_DIR)/%/.stamp_configured:
211 @$(call step_start,configure)
212 @$(call MESSAGE,"Configuring")
213 $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
214 $($(PKG)_CONFIGURE_CMDS)
215 $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
216 @$(call step_end,configure)
220 $(BUILD_DIR)/%/.stamp_built::
221 @$(call step_start,build)
222 @$(call MESSAGE,"Building")
223 $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))
224 +$($(PKG)_BUILD_CMDS)
225 $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
226 @$(call step_end,build)
229 # Install to host dir
230 $(BUILD_DIR)/%/.stamp_host_installed:
231 @$(call step_start,install-host)
232 @$(call MESSAGE,"Installing to host directory")
233 $(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
234 +$($(PKG)_INSTALL_CMDS)
235 $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
236 @$(call step_end,install-host)
239 # Install to staging dir
241 # Some packages install libtool .la files alongside any installed
242 # libraries. These .la files sometimes refer to paths relative to the
243 # sysroot, which libtool will interpret as absolute paths to host
244 # libraries instead of the target libraries. Since this is not what we
245 # want, these paths are fixed by prefixing them with $(STAGING_DIR).
246 # As we configure with --prefix=/usr, this fix needs to be applied to
247 # any path that starts with /usr.
249 # To protect against the case that the output or staging directories or
250 # the pre-installed external toolchain themselves are under /usr, we first
251 # substitute away any occurrences of these directories with @BASE_DIR@,
252 # @STAGING_DIR@ and @TOOLCHAIN_EXTERNAL_INSTALL_DIR@ respectively.
254 # Note that STAGING_DIR can be outside BASE_DIR when the user sets
255 # BR2_HOST_DIR to a custom value. Note that TOOLCHAIN_EXTERNAL_INSTALL_DIR
256 # can be under @BASE_DIR@ when it's a downloaded toolchain, and can be
257 # empty when we use an internal toolchain.
259 $(BUILD_DIR)/%/.stamp_staging_installed:
260 @$(call step_start,install-staging)
261 @$(call MESSAGE,"Installing to staging directory")
262 $(foreach hook,$($(PKG)_PRE_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
263 +$($(PKG)_INSTALL_STAGING_CMDS)
264 $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
265 $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
266 $(call MESSAGE,"Fixing package configuration files") ;\
267 $(SED) "s,$(BASE_DIR),@BASE_DIR@,g" \
268 -e "s,$(STAGING_DIR),@STAGING_DIR@,g" \
269 -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \
270 -e "s,-I/usr/,-I@STAGING_DIR@/usr/,g" \
271 -e "s,-L/usr/,-L@STAGING_DIR@/usr/,g" \
272 -e "s,@STAGING_DIR@,$(STAGING_DIR),g" \
273 -e "s,@BASE_DIR@,$(BASE_DIR),g" \
274 $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\
276 @$(call MESSAGE,"Fixing libtool files")
277 $(Q)find $(STAGING_DIR)/usr/lib* -name "*.la" | xargs --no-run-if-empty \
278 $(SED) "s:$(BASE_DIR):@BASE_DIR@:g" \
279 -e "s:$(STAGING_DIR):@STAGING_DIR@:g" \
280 $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\
281 -e "s:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:g") \
282 -e "s:\(['= ]\)/usr:\\1@STAGING_DIR@/usr:g" \
283 $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\
284 -e "s:@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):g") \
285 -e "s:@STAGING_DIR@:$(STAGING_DIR):g" \
286 -e "s:@BASE_DIR@:$(BASE_DIR):g"
287 @$(call step_end,install-staging)
290 # Install to images dir
291 $(BUILD_DIR)/%/.stamp_images_installed:
292 @$(call step_start,install-image)
293 $(foreach hook,$($(PKG)_PRE_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
294 @$(call MESSAGE,"Installing to images directory")
295 +$($(PKG)_INSTALL_IMAGES_CMDS)
296 $(foreach hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
297 @$(call step_end,install-image)
300 # Install to target dir
301 $(BUILD_DIR)/%/.stamp_target_installed:
302 @$(call step_start,install-target)
303 @$(call MESSAGE,"Installing to target")
304 $(foreach hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
305 +$($(PKG)_INSTALL_TARGET_CMDS)
306 $(if $(BR2_INIT_SYSTEMD),\
307 $($(PKG)_INSTALL_INIT_SYSTEMD))
308 $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
309 $($(PKG)_INSTALL_INIT_SYSV))
310 $(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
311 $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
312 $(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
314 @$(call step_end,install-target)
317 # Remove package sources
318 $(BUILD_DIR)/%/.stamp_dircleaned:
321 ################################################################################
322 # virt-provides-single -- check that provider-pkg is the declared provider for
323 # the virtual package virt-pkg
325 # argument 1 is the lower-case name of the virtual package
326 # argument 2 is the upper-case name of the virtual package
327 # argument 3 is the lower-case name of the provider
330 # $(call virt-provides-single,libegl,LIBEGL,rpi-userland)
331 ################################################################################
332 define virt-provides-single
333 ifneq ($$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2))),$(3))
334 $$(error Configuration error: both "$(3)" and $$(BR2_PACKAGE_PROVIDES_$(2))\
335 are selected as providers for virtual package "$(1)". Only one provider can\
336 be selected at a time. Please fix your configuration)
340 define pkg-graph-depends
341 @$$(INSTALL) -d $$(GRAPHS_DIR)
342 @cd "$$(CONFIG_DIR)"; \
343 $$(TOPDIR)/support/scripts/graph-depends $$(BR2_GRAPH_DEPS_OPTS) \
344 -p $(1) $(2) -o $$(GRAPHS_DIR)/$$(@).dot
345 dot $$(BR2_GRAPH_DOT_OPTS) -T$$(BR_GRAPH_OUT) \
346 -o $$(GRAPHS_DIR)/$$(@).$$(BR_GRAPH_OUT) \
347 $$(GRAPHS_DIR)/$$(@).dot
350 ################################################################################
351 # inner-generic-package -- generates the make targets needed to build a
354 # argument 1 is the lowercase package name
355 # argument 2 is the uppercase package name, including a HOST_ prefix
357 # argument 3 is the uppercase package name, without the HOST_ prefix
359 # argument 4 is the type (target or host)
361 # Note about variable and function references: inside all blocks that are
362 # evaluated with $(eval), which includes all 'inner-xxx-package' blocks,
363 # specific rules apply with respect to variable and function references.
364 # - Numbered variables (parameters to the block) can be referenced with a single
365 # dollar sign: $(1), $(2), $(3), etc.
366 # - pkgdir and pkgname should be referenced with a single dollar sign too. These
367 # functions rely on 'the most recently parsed makefile' which is supposed to
368 # be the package .mk file. If we defer the evaluation of these functions using
369 # double dollar signs, then they may be evaluated too late, when other
370 # makefiles have already been parsed. One specific case is when $$(pkgdir) is
371 # assigned to a variable using deferred evaluation with '=' and this variable
372 # is used in a target rule outside the eval'ed inner block. In this case, the
373 # pkgdir will be that of the last makefile parsed by buildroot, which is not
374 # the expected value. This mechanism is for example used for the TARGET_PATCH
376 # - All other variables should be referenced with a double dollar sign:
377 # $$(TARGET_DIR), $$($(2)_VERSION), etc. Also all make functions should be
378 # referenced with a double dollar sign: $$(subst), $$(call), $$(filter-out),
379 # etc. This rule ensures that these variables and functions are only expanded
380 # during the $(eval) step, and not earlier. Otherwise, unintuitive and
381 # undesired behavior occurs with respect to these variables and functions.
383 ################################################################################
385 define inner-generic-package
387 # When doing a package, we're definitely not doing a rootfs, but we
388 # may inherit it via the dependency chain, so we reset it.
391 # Ensure the package is only declared once, i.e. do not accept that a
392 # package be re-defined by a br2-external tree
393 ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),)
394 $$(error Package '$(1)' defined a second time in '$(pkgdir)'; \
395 previous definition was in '$$($(2)_PKGDIR)')
399 # Define default values for various package-related variables, if not
400 # already defined. For some variables (version, source, site and
401 # subdir), if they are undefined, we try to see if a variable without
402 # the HOST_ prefix is defined. If so, we use such a variable, so that
403 # this information has only to be specified once, for both the
404 # target and host packages of a given .mk file.
408 $(2)_RAWNAME = $$(patsubst host-%,%,$(1))
409 $(2)_PKGDIR = $(pkgdir)
411 # Keep the package version that may contain forward slashes in the _DL_VERSION
412 # variable, then replace all forward slashes ('/') by underscores ('_') to
413 # sanitize the package version that is used in paths, directory and file names.
414 # Forward slashes may appear in the package's version when pointing to a
415 # version control system branch or tag, for example remotes/origin/1_10_stable.
416 # Similar for spaces and colons (:) that may appear in date-based revisions for
419 ifdef $(3)_DL_VERSION
420 $(2)_DL_VERSION := $$($(3)_DL_VERSION)
421 else ifdef $(3)_VERSION
422 $(2)_DL_VERSION := $$($(3)_VERSION)
425 $(2)_DL_VERSION := $$(strip $$($(2)_VERSION))
427 $(2)_VERSION := $$(call sanitize,$$($(2)_DL_VERSION))
429 ifdef $(3)_OVERRIDE_SRCDIR
430 $(2)_OVERRIDE_SRCDIR ?= $$($(3)_OVERRIDE_SRCDIR)
433 $(2)_BASENAME = $$(if $$($(2)_VERSION),$(1)-$$($(2)_VERSION),$(1))
434 $(2)_BASENAME_RAW = $$(if $$($(2)_VERSION),$$($(2)_RAWNAME)-$$($(2)_VERSION),$$($(2)_RAWNAME))
435 $(2)_DL_SUBDIR ?= $$($(2)_RAWNAME)
436 $(2)_DL_DIR = $$(DL_DIR)/$$($(2)_DL_SUBDIR)
437 $(2)_DIR = $$(BUILD_DIR)/$$($(2)_BASENAME)
441 $(2)_SUBDIR = $$($(3)_SUBDIR)
447 ifndef $(2)_STRIP_COMPONENTS
448 ifdef $(3)_STRIP_COMPONENTS
449 $(2)_STRIP_COMPONENTS = $$($(3)_STRIP_COMPONENTS)
451 $(2)_STRIP_COMPONENTS ?= 1
455 $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR)
456 $(2)_BUILDDIR ?= $$($(2)_SRCDIR)
458 ifneq ($$($(2)_OVERRIDE_SRCDIR),)
459 $(2)_VERSION = custom
464 $(2)_SOURCE = $$($(3)_SOURCE)
465 else ifdef $(2)_VERSION
466 $(2)_SOURCE ?= $$($(2)_BASENAME_RAW).tar.gz
470 # If FOO_ACTUAL_SOURCE_TARBALL is explicitly defined, it means FOO_SOURCE is
471 # indeed a binary (e.g. external toolchain) and FOO_ACTUAL_SOURCE_TARBALL/_SITE
472 # point to the actual sources tarball. Use the actual sources for legal-info.
473 # For most packages the FOO_SITE/FOO_SOURCE pair points to real source code,
474 # so these are the defaults for FOO_ACTUAL_*.
475 $(2)_ACTUAL_SOURCE_TARBALL ?= $$($(2)_SOURCE)
476 $(2)_ACTUAL_SOURCE_SITE ?= $$(call qstrip,$$($(2)_SITE))
480 $(2)_PATCH = $$($(3)_PATCH)
484 $(2)_ALL_DOWNLOADS = \
485 $$(foreach p,$$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\
486 $$(if $$(findstring ://,$$(p)),$$(p),\
487 $$($(2)_SITE)/$$(p)))
491 $(2)_SITE = $$($(3)_SITE)
495 ifndef $(2)_SITE_METHOD
496 ifdef $(3)_SITE_METHOD
497 $(2)_SITE_METHOD = $$($(3)_SITE_METHOD)
499 # Try automatic detection using the scheme part of the URI
500 $(2)_SITE_METHOD = $$(call geturischeme,$$($(2)_SITE))
504 # Do not accept to download git submodule if not using the git method
505 ifneq ($$($(2)_GIT_SUBMODULES),)
506 ifneq ($$($(2)_SITE_METHOD),git)
507 $$(error $(2) declares having git sub-modules, but does not use the \
508 'git' method (uses '$$($(2)_SITE_METHOD)' instead))
512 ifeq ($$($(2)_SITE_METHOD),local)
513 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
514 $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE)
520 $(2)_LICENSE = $$($(3)_LICENSE)
524 $(2)_LICENSE ?= unknown
526 ifndef $(2)_LICENSE_FILES
527 ifdef $(3)_LICENSE_FILES
528 $(2)_LICENSE_FILES = $$($(3)_LICENSE_FILES)
532 ifndef $(2)_REDISTRIBUTE
533 ifdef $(3)_REDISTRIBUTE
534 $(2)_REDISTRIBUTE = $$($(3)_REDISTRIBUTE)
538 $(2)_REDISTRIBUTE ?= YES
540 $(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)_BASENAME_RAW)
542 # When a target package is a toolchain dependency set this variable to
543 # 'NO' so the 'toolchain' dependency is not added to prevent a circular
545 # Similarly for the skeleton.
546 $(2)_ADD_TOOLCHAIN_DEPENDENCY ?= YES
547 $(2)_ADD_SKELETON_DEPENDENCY ?= YES
551 ifeq ($$($(2)_ADD_SKELETON_DEPENDENCY),YES)
552 $(2)_DEPENDENCIES += skeleton
554 ifeq ($$($(2)_ADD_TOOLCHAIN_DEPENDENCY),YES)
555 $(2)_DEPENDENCIES += toolchain
559 ifneq ($(1),host-skeleton)
560 $(2)_DEPENDENCIES += host-skeleton
563 ifeq ($(filter host-tar host-skeleton host-fakedate,$(1)),)
564 $(2)_EXTRACT_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY)
567 ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-fakedate,$(1)),)
568 $(2)_EXTRACT_DEPENDENCIES += $(BR2_XZCAT_HOST_DEPENDENCY)
571 ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-fakedate,$(1)),)
572 $(2)_EXTRACT_DEPENDENCIES += $(BR2_LZIP_HOST_DEPENDENCY)
575 ifeq ($(BR2_CCACHE),y)
576 ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-fakedate host-ccache,$(1)),)
577 $(2)_DEPENDENCIES += host-ccache
581 ifeq ($(BR2_REPRODUCIBLE),y)
582 ifeq ($(filter host-skeleton host-fakedate,$(1)),)
583 $(2)_DEPENDENCIES += host-fakedate
587 # Eliminate duplicates in dependencies
588 $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES))
589 $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES))
590 $(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES))
591 $(2)_FINAL_ALL_DEPENDENCIES = \
593 $$($(2)_FINAL_DEPENDENCIES) \
594 $$($(2)_FINAL_EXTRACT_DEPENDENCIES) \
595 $$($(2)_FINAL_PATCH_DEPENDENCIES))
597 $(2)_INSTALL_STAGING ?= NO
598 $(2)_INSTALL_IMAGES ?= NO
599 $(2)_INSTALL_TARGET ?= YES
601 # define sub-target stamps
602 $(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed
603 $(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed
604 $(2)_TARGET_INSTALL_IMAGES = $$($(2)_DIR)/.stamp_images_installed
605 $(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed
606 $(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built
607 $(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured
608 $(2)_TARGET_RSYNC = $$($(2)_DIR)/.stamp_rsynced
609 $(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched
610 $(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted
611 $(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded
612 $(2)_TARGET_ACTUAL_SOURCE = $$($(2)_DIR)/.stamp_actual_downloaded
613 $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned
615 # default extract command
616 $(2)_EXTRACT_CMDS ?= \
617 $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$($(2)_DL_DIR)/$$($(2)_SOURCE) | \
618 $$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) \
620 $$(foreach x,$$($(2)_EXCLUDES),--exclude='$$(x)' ) \
623 # pre/post-steps hooks
624 $(2)_PRE_DOWNLOAD_HOOKS ?=
625 $(2)_POST_DOWNLOAD_HOOKS ?=
626 $(2)_PRE_EXTRACT_HOOKS ?=
627 $(2)_POST_EXTRACT_HOOKS ?=
628 $(2)_PRE_RSYNC_HOOKS ?=
629 $(2)_POST_RSYNC_HOOKS ?=
630 $(2)_PRE_PATCH_HOOKS ?=
631 $(2)_POST_PATCH_HOOKS ?=
632 $(2)_PRE_CONFIGURE_HOOKS ?=
633 $(2)_POST_CONFIGURE_HOOKS ?=
634 $(2)_PRE_BUILD_HOOKS ?=
635 $(2)_POST_BUILD_HOOKS ?=
636 $(2)_PRE_INSTALL_HOOKS ?=
637 $(2)_POST_INSTALL_HOOKS ?=
638 $(2)_PRE_INSTALL_STAGING_HOOKS ?=
639 $(2)_POST_INSTALL_STAGING_HOOKS ?=
640 $(2)_PRE_INSTALL_TARGET_HOOKS ?=
641 $(2)_POST_INSTALL_TARGET_HOOKS ?=
642 $(2)_PRE_INSTALL_IMAGES_HOOKS ?=
643 $(2)_POST_INSTALL_IMAGES_HOOKS ?=
644 $(2)_PRE_LEGAL_INFO_HOOKS ?=
645 $(2)_POST_LEGAL_INFO_HOOKS ?=
646 $(2)_TARGET_FINALIZE_HOOKS ?=
647 $(2)_ROOTFS_PRE_CMD_HOOKS ?=
649 # human-friendly targets and target sequencing
652 ifeq ($$($(2)_TYPE),host)
653 $(1)-install: $(1)-install-host
655 $(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images
658 ifeq ($$($(2)_INSTALL_TARGET),YES)
659 $(1)-install-target: $$($(2)_TARGET_INSTALL_TARGET)
660 $$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_BUILD)
665 ifeq ($$($(2)_INSTALL_STAGING),YES)
666 $(1)-install-staging: $$($(2)_TARGET_INSTALL_STAGING)
667 $$($(2)_TARGET_INSTALL_STAGING): $$($(2)_TARGET_BUILD)
668 # Some packages use install-staging stuff for install-target
669 $$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_INSTALL_STAGING)
671 $(1)-install-staging:
674 ifeq ($$($(2)_INSTALL_IMAGES),YES)
675 $(1)-install-images: $$($(2)_TARGET_INSTALL_IMAGES)
676 $$($(2)_TARGET_INSTALL_IMAGES): $$($(2)_TARGET_BUILD)
681 $(1)-install-host: $$($(2)_TARGET_INSTALL_HOST)
682 $$($(2)_TARGET_INSTALL_HOST): $$($(2)_TARGET_BUILD)
684 $(1)-build: $$($(2)_TARGET_BUILD)
685 $$($(2)_TARGET_BUILD): $$($(2)_TARGET_CONFIGURE)
687 # Since $(2)_FINAL_DEPENDENCIES are phony targets, they are always "newer"
688 # than $(2)_TARGET_CONFIGURE. This would force the configure step (and
689 # therefore the other steps as well) to be re-executed with every
690 # invocation of make. Therefore, make $(2)_FINAL_DEPENDENCIES an order-only
691 # dependency by using |.
693 $(1)-configure: $$($(2)_TARGET_CONFIGURE)
694 $$($(2)_TARGET_CONFIGURE): | $$($(2)_FINAL_DEPENDENCIES)
696 $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dirs prepare
697 $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dependencies
699 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
700 # In the normal case (no package override), the sequence of steps is
701 # source, by downloading
706 $$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_PATCH)
708 $(1)-patch: $$($(2)_TARGET_PATCH)
709 $$($(2)_TARGET_PATCH): $$($(2)_TARGET_EXTRACT)
710 # Order-only dependency
711 $$($(2)_TARGET_PATCH): | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES))
713 $(1)-extract: $$($(2)_TARGET_EXTRACT)
714 $$($(2)_TARGET_EXTRACT): $$($(2)_TARGET_SOURCE)
715 $$($(2)_TARGET_EXTRACT): | $$($(2)_FINAL_EXTRACT_DEPENDENCIES)
717 $(1)-depends: $$($(2)_FINAL_DEPENDENCIES)
719 $(1)-source: $$($(2)_TARGET_SOURCE)
721 $(1)-all-source: $(1)-legal-source
722 $(1)-legal-info: $(1)-legal-source
723 $(1)-legal-source: $(1)-source
725 # Only download the actual source if it differs from the 'main' archive
726 ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),)
727 ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
728 $(1)-legal-source: $$($(2)_TARGET_ACTUAL_SOURCE)
729 endif # actual sources != sources
730 endif # actual sources != ""
733 @for p in $$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS) ; do \
734 echo `basename $$$$p` ; \
737 # In the package override case, the sequence of steps
738 # source, by rsyncing
742 # Use an order-only dependency so the "<pkg>-clean-for-rebuild" rule
743 # can remove the stamp file without triggering the configure step.
744 $$($(2)_TARGET_CONFIGURE): | $$($(2)_TARGET_RSYNC)
746 $(1)-depends: $$($(2)_FINAL_DEPENDENCIES)
748 $(1)-patch: $(1)-rsync
749 $(1)-extract: $(1)-rsync
751 $(1)-rsync: $$($(2)_TARGET_RSYNC)
757 @echo "file://$$($(2)_OVERRIDE_SRCDIR)"
761 @echo $$($(2)_VERSION)
764 @echo $$($(2)_FINAL_ALL_DEPENDENCIES)
766 $(1)-show-recursive-depends:
767 @cd "$$(CONFIG_DIR)" && \
768 $$(TOPDIR)/support/scripts/graph-depends -p $(1) -f -q
771 @echo $$($(2)_RDEPENDENCIES)
773 $(1)-show-recursive-rdepends:
774 @cd "$$(CONFIG_DIR)" && \
775 $$(TOPDIR)/support/scripts/graph-depends -p $(1) --reverse -f -q
777 $(1)-show-build-order: $$(patsubst %,%-show-build-order,$$($(2)_FINAL_ALL_DEPENDENCIES))
780 $(1)-graph-depends: graph-depends-requirements
781 $(call pkg-graph-depends,$(1),--direct)
783 $(1)-graph-rdepends: graph-depends-requirements
784 $(call pkg-graph-depends,$(1),--reverse)
786 $(1)-all-source: $(1)-source
787 $(1)-all-source: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source)
789 $(1)-all-external-deps: $(1)-external-deps
790 $(1)-all-external-deps: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-external-deps)
792 $(1)-all-legal-info: $(1)-legal-info
793 $(1)-all-legal-info: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-legal-info)
795 $(1)-dirclean: $$($(2)_TARGET_DIRCLEAN)
797 $(1)-clean-for-reinstall:
798 ifneq ($$($(2)_OVERRIDE_SRCDIR),)
799 rm -f $$($(2)_TARGET_RSYNC)
801 rm -f $$($(2)_TARGET_INSTALL_STAGING)
802 rm -f $$($(2)_TARGET_INSTALL_TARGET)
803 rm -f $$($(2)_TARGET_INSTALL_IMAGES)
804 rm -f $$($(2)_TARGET_INSTALL_HOST)
806 $(1)-reinstall: $(1)-clean-for-reinstall $(1)
808 $(1)-clean-for-rebuild: $(1)-clean-for-reinstall
809 rm -f $$($(2)_TARGET_BUILD)
811 $(1)-rebuild: $(1)-clean-for-rebuild $(1)
813 $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
814 rm -f $$($(2)_TARGET_CONFIGURE)
816 $(1)-reconfigure: $(1)-clean-for-reconfigure $(1)
818 # define the PKG variable for all targets, containing the
819 # uppercase package variable prefix
820 $$($(2)_TARGET_INSTALL_TARGET): PKG=$(2)
821 $$($(2)_TARGET_INSTALL_STAGING): PKG=$(2)
822 $$($(2)_TARGET_INSTALL_IMAGES): PKG=$(2)
823 $$($(2)_TARGET_INSTALL_HOST): PKG=$(2)
824 $$($(2)_TARGET_BUILD): PKG=$(2)
825 $$($(2)_TARGET_CONFIGURE): PKG=$(2)
826 $$($(2)_TARGET_RSYNC): SRCDIR=$$($(2)_OVERRIDE_SRCDIR)
827 $$($(2)_TARGET_RSYNC): PKG=$(2)
828 $$($(2)_TARGET_PATCH): PKG=$(2)
829 $$($(2)_TARGET_PATCH): RAWNAME=$$(patsubst host-%,%,$(1))
830 $$($(2)_TARGET_PATCH): PKGDIR=$(pkgdir)
831 $$($(2)_TARGET_EXTRACT): PKG=$(2)
832 $$($(2)_TARGET_SOURCE): PKG=$(2)
833 $$($(2)_TARGET_SOURCE): PKGDIR=$(pkgdir)
834 $$($(2)_TARGET_ACTUAL_SOURCE): PKG=$(2)
835 $$($(2)_TARGET_ACTUAL_SOURCE): PKGDIR=$(pkgdir)
836 $$($(2)_TARGET_DIRCLEAN): PKG=$(2)
838 # Compute the name of the Kconfig option that correspond to the
839 # package being enabled. We handle three cases: the special Linux
840 # kernel case, the bootloaders case, and the normal packages case.
842 $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
843 else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
844 $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
845 else ifneq ($$(filter toolchain/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/toolchain/%),$(pkgdir)),)
846 $(2)_KCONFIG_VAR = BR2_$(2)
848 $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
851 # legal-info: declare dependencies and set values used later for the manifest
852 ifneq ($$($(2)_LICENSE_FILES),)
853 $(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES)
856 # We need to extract and patch a package to be able to retrieve its
857 # license files (if any) and the list of patches applied to it (if
859 $(1)-legal-info: $(1)-patch
861 # We only save the sources of packages we want to redistribute, that are
862 # non-overriden (local or true override).
863 ifeq ($$($(2)_REDISTRIBUTE),YES)
864 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
865 # Packages that have a tarball need it downloaded beforehand
866 $(1)-legal-info: $(1)-source $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))
870 # legal-info: produce legally relevant info.
871 $(1)-legal-info: PKG=$(2)
873 @$$(call MESSAGE,"Collecting legal info")
874 # Packages without a source are assumed to be part of Buildroot, skip them.
875 $$(foreach hook,$$($(2)_PRE_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
876 ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
878 # Save license files if defined
879 # We save the license files for any kind of package: normal, local,
880 # overridden, or non-redistributable alike.
881 # The reason to save license files even for no-redistribute packages
882 # is that the license still applies to the files distributed as part
883 # of the rootfs, even if the sources are not themselves redistributed.
884 ifeq ($$(call qstrip,$$($(2)_LICENSE_FILES)),)
885 $(Q)$$(call legal-warning-pkg,$$($(2)_BASENAME_RAW),cannot save license ($(2)_LICENSE_FILES not defined))
887 $(Q)$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$($(2)_BASENAME_RAW),$$($(2)_PKGDIR),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
888 endif # license files
890 ifeq ($$($(2)_SITE_METHOD),local)
891 # Packages without a tarball: don't save and warn
892 @$$(call legal-warning-nosource,$$($(2)_RAWNAME),local)
894 else ifneq ($$($(2)_OVERRIDE_SRCDIR),)
895 @$$(call legal-warning-nosource,$$($(2)_RAWNAME),override)
900 ifeq ($$($(2)_REDISTRIBUTE),YES)
901 # Save the source tarball and any extra downloads, but not
902 # patches, as they are handled specially afterwards.
903 $$(foreach e,$$($(2)_ACTUAL_SOURCE_TARBALL) $$(notdir $$($(2)_EXTRA_DOWNLOADS)),\
904 $$(Q)support/scripts/hardlink-or-copy \
905 $$($(2)_DL_DIR)/$$(e) \
906 $$($(2)_REDIST_SOURCES_DIR)$$(sep))
907 # Save patches and generate the series file
908 $$(Q)while read f; do \
909 support/scripts/hardlink-or-copy \
911 $$($(2)_REDIST_SOURCES_DIR) || exit 1; \
912 printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \
913 done <$$($(2)_DIR)/.applied_patches_list
916 endif # other packages
917 @$$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call UPPERCASE,$(4)))
918 endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
919 $$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
921 # add package to the general list of targets if requested by the buildroot
923 ifeq ($$($$($(2)_KCONFIG_VAR)),y)
925 # Ensure the calling package is the declared provider for all the virtual
926 # packages it claims to be an implementation of.
927 ifneq ($$($(2)_PROVIDES),)
928 $$(foreach pkg,$$($(2)_PROVIDES),\
929 $$(eval $$(call virt-provides-single,$$(pkg),$$(call UPPERCASE,$$(pkg)),$(1))$$(sep)))
932 # Register package as a reverse-dependencies of all its dependencies
933 $$(eval $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),\
934 $$(call UPPERCASE,$$(p))_RDEPENDENCIES += $(1)$$(sep)))
936 # Ensure unified variable name conventions between all packages Some
937 # of the variables are used by more than one infrastructure; so,
938 # rather than duplicating the checks in each infrastructure, we check
939 # all variables here in pkg-generic, even though pkg-generic should
940 # have no knowledge of infra-specific variables.
941 $(eval $(call check-deprecated-variable,$(2)_MAKE_OPT,$(2)_MAKE_OPTS))
942 $(eval $(call check-deprecated-variable,$(2)_INSTALL_OPT,$(2)_INSTALL_OPTS))
943 $(eval $(call check-deprecated-variable,$(2)_INSTALL_TARGET_OPT,$(2)_INSTALL_TARGET_OPTS))
944 $(eval $(call check-deprecated-variable,$(2)_INSTALL_STAGING_OPT,$(2)_INSTALL_STAGING_OPTS))
945 $(eval $(call check-deprecated-variable,$(2)_INSTALL_HOST_OPT,$(2)_INSTALL_HOST_OPTS))
946 $(eval $(call check-deprecated-variable,$(2)_AUTORECONF_OPT,$(2)_AUTORECONF_OPTS))
947 $(eval $(call check-deprecated-variable,$(2)_CONF_OPT,$(2)_CONF_OPTS))
948 $(eval $(call check-deprecated-variable,$(2)_BUILD_OPT,$(2)_BUILD_OPTS))
949 $(eval $(call check-deprecated-variable,$(2)_GETTEXTIZE_OPT,$(2)_GETTEXTIZE_OPTS))
950 $(eval $(call check-deprecated-variable,$(2)_KCONFIG_OPT,$(2)_KCONFIG_OPTS))
954 ifneq ($$($(2)_PERMISSIONS),)
955 PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
957 ifneq ($$($(2)_DEVICES),)
958 PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep)
960 ifneq ($$($(2)_USERS),)
961 PACKAGES_USERS += $$($(2)_USERS)$$(sep)
963 TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
964 ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS)
966 ifeq ($$($(2)_SITE_METHOD),svn)
967 DL_TOOLS_DEPENDENCIES += svn
968 else ifeq ($$($(2)_SITE_METHOD),git)
969 DL_TOOLS_DEPENDENCIES += git
970 else ifeq ($$($(2)_SITE_METHOD),bzr)
971 DL_TOOLS_DEPENDENCIES += bzr
972 else ifeq ($$($(2)_SITE_METHOD),scp)
973 DL_TOOLS_DEPENDENCIES += scp ssh
974 else ifeq ($$($(2)_SITE_METHOD),hg)
975 DL_TOOLS_DEPENDENCIES += hg
976 else ifeq ($$($(2)_SITE_METHOD),cvs)
977 DL_TOOLS_DEPENDENCIES += cvs
980 DL_TOOLS_DEPENDENCIES += $$(call extractor-dependency,$$($(2)_SOURCE))
982 # Ensure all virtual targets are PHONY. Listed alphabetically.
984 $(1)-all-external-deps \
985 $(1)-all-legal-info \
988 $(1)-clean-for-rebuild \
989 $(1)-clean-for-reconfigure \
990 $(1)-clean-for-reinstall \
999 $(1)-install-images \
1000 $(1)-install-staging \
1001 $(1)-install-target \
1013 ifneq ($$($(2)_SOURCE),)
1014 ifeq ($$($(2)_SITE),)
1015 $$(error $(2)_SITE cannot be empty when $(2)_SOURCE is not)
1019 ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR)
1020 $$(error $(2)_SITE ($$($(2)_SITE)) cannot have a trailing slash)
1023 ifneq ($$($(2)_HELP_CMDS),)
1024 HELP_PACKAGES += $(2)
1027 endif # $(2)_KCONFIG_VAR
1028 endef # inner-generic-package
1030 ################################################################################
1031 # generic-package -- the target generator macro for generic packages
1032 ################################################################################
1034 # In the case of target packages, keep the package name "pkg"
1035 generic-package = $(call inner-generic-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
1036 # In the case of host packages, turn the package name "pkg" into "host-pkg"
1037 host-generic-package = $(call inner-generic-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)