dtc: update legal info
[buildroot-gz.git] / package / pkg-generic.mk
blobe726ac5ef14a14e119ebebdb4cfeb038c9451c13
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
11 # infrastructure
13 # In terms of implementation, this generic infrastructure requires the
14 # .mk file to specify:
16 # 1. Metadata information about the package: name, version,
17 # download URL, etc.
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
30 # three arguments:
31 # $1: either 'start' or 'end'
32 # $2: the name of the step
33 # $3: the name of the package
35 # Start step
36 # $1: step name
37 define step_start
38 $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),start,$(1),$($(PKG)_NAME))$(sep))
39 endef
41 # End step
42 # $1: step name
43 define step_end
44 $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),end,$(1),$($(PKG)_NAME))$(sep))
45 endef
47 #######################################
48 # Actual steps hooks
50 # Time steps
51 define step_time
52 printf "%s:%-5.5s:%-20.20s: %s\n" \
53 "$$(date +%s)" "$(1)" "$(2)" "$(3)" \
54 >>"$(BUILD_DIR)/build-time.log"
55 endef
56 GLOBAL_INSTRUMENTATION_HOOKS += step_time
58 # Hooks to collect statistics about installed files
60 # This hook will be called before the target installation of a
61 # package. We store in a file named .br_filelist_before the list of
62 # files currently installed in the target. Note that the MD5 is also
63 # stored, in order to identify if the files are overwritten.
64 define step_pkg_size_start
65 (cd $(TARGET_DIR) ; find . -type f -print0 | xargs -0 md5sum) | sort > \
66 $($(PKG)_DIR)/.br_filelist_before
67 endef
69 # This hook will be called after the target installation of a
70 # package. We store in a file named .br_filelist_after the list of
71 # files (and their MD5) currently installed in the target. We then do
72 # a diff with the .br_filelist_before to compute the list of files
73 # installed by this package.
74 define step_pkg_size_end
75 (cd $(TARGET_DIR); find . -type f -print0 | xargs -0 md5sum) | sort > \
76 $($(PKG)_DIR)/.br_filelist_after
77 comm -13 $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after | \
78 while read hash file ; do \
79 echo "$(1),$${file}" >> $(BUILD_DIR)/packages-file-list.txt ; \
80 done
81 endef
83 define step_pkg_size
84 $(if $(filter install-target,$(2)),\
85 $(if $(filter start,$(1)),$(call step_pkg_size_start,$(3))) \
86 $(if $(filter end,$(1)),$(call step_pkg_size_end,$(3))))
87 endef
88 GLOBAL_INSTRUMENTATION_HOOKS += step_pkg_size
90 # This hook checks that host packages that need libraries that we build
91 # have a proper DT_RPATH or DT_RUNPATH tag
92 define check_host_rpath
93 $(if $(filter install-host,$(2)),\
94 $(if $(filter end,$(1)),support/scripts/check-host-rpath $(3) $(HOST_DIR)))
95 endef
96 GLOBAL_INSTRUMENTATION_HOOKS += check_host_rpath
98 # User-supplied script
99 ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
100 define step_user
101 @$(foreach user_hook, $(BR2_INSTRUMENTATION_SCRIPTS), \
102 $(EXTRA_ENV) $(user_hook) "$(1)" "$(2)" "$(3)"$(sep))
103 endef
104 GLOBAL_INSTRUMENTATION_HOOKS += step_user
105 endif
107 ################################################################################
108 # Implicit targets -- produce a stamp file for each step of a package build
109 ################################################################################
111 # Retrieve the archive
112 $(BUILD_DIR)/%/.stamp_downloaded:
113 $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
114 # Only show the download message if it isn't already downloaded
115 $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \
116 if test ! -e $(DL_DIR)/`basename $$p` ; then \
117 $(call MESSAGE,"Downloading") ; \
118 break ; \
119 fi ; \
120 done
121 $(foreach p,$($(PKG)_ALL_DOWNLOADS),$(call DOWNLOAD,$(p))$(sep))
122 $(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
123 $(Q)mkdir -p $(@D)
124 $(Q)touch $@
126 # Retrieve actual source archive, e.g. for prebuilt external toolchains
127 $(BUILD_DIR)/%/.stamp_actual_downloaded:
128 $(call DOWNLOAD,$($(PKG)_ACTUAL_SOURCE_SITE)/$($(PKG)_ACTUAL_SOURCE_TARBALL)); \
129 $(Q)mkdir -p $(@D)
130 $(Q)touch $@
132 # Unpack the archive
133 $(BUILD_DIR)/%/.stamp_extracted:
134 @$(call step_start,extract)
135 @$(call MESSAGE,"Extracting")
136 $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep))
137 $(Q)mkdir -p $(@D)
138 $($(PKG)_EXTRACT_CMDS)
139 # some packages have messed up permissions inside
140 $(Q)chmod -R +rw $(@D)
141 $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
142 @$(call step_end,extract)
143 $(Q)touch $@
145 # Rsync the source directory if the <pkg>_OVERRIDE_SRCDIR feature is
146 # used.
147 $(BUILD_DIR)/%/.stamp_rsynced:
148 @$(call MESSAGE,"Syncing from source dir $(SRCDIR)")
149 @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1)
150 $(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep))
151 rsync -au --chmod=u=rwX,go=rX $(RSYNC_VCS_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D)
152 $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep))
153 $(Q)touch $@
155 # Patch
157 # The RAWNAME variable is the lowercased package name, which allows to
158 # find the package directory (typically package/<pkgname>) and the
159 # prefix of the patches
161 # For BR2_GLOBAL_PATCH_DIR, only generate if it is defined
162 $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $(PKGDIR)
163 $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))
164 $(BUILD_DIR)/%/.stamp_patched:
165 @$(call step_start,patch)
166 @$(call MESSAGE,"Patching")
167 $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
168 $(foreach p,$($(PKG)_PATCH),$(APPLY_PATCHES) $(@D) $(DL_DIR) $(notdir $(p))$(sep))
169 $(Q)( \
170 for D in $(PATCH_BASE_DIRS); do \
171 if test -d $${D}; then \
172 if test -d $${D}/$($(PKG)_VERSION); then \
173 $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION) \*.patch \*.patch.$(ARCH) || exit 1; \
174 else \
175 $(APPLY_PATCHES) $(@D) $${D} \*.patch \*.patch.$(ARCH) || exit 1; \
176 fi; \
177 fi; \
178 done; \
180 $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
181 @$(call step_end,patch)
182 $(Q)touch $@
184 # Check that all directories specified in BR2_GLOBAL_PATCH_DIR exist.
185 $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\
186 $(if $(wildcard $(dir)),,\
187 $(error BR2_GLOBAL_PATCH_DIR contains nonexistent directory $(dir))))
189 # Configure
190 $(BUILD_DIR)/%/.stamp_configured:
191 @$(call step_start,configure)
192 @$(call MESSAGE,"Configuring")
193 $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
194 $($(PKG)_CONFIGURE_CMDS)
195 $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
196 @$(call step_end,configure)
197 $(Q)touch $@
199 # Build
200 $(BUILD_DIR)/%/.stamp_built::
201 @$(call step_start,build)
202 @$(call MESSAGE,"Building")
203 $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))
204 +$($(PKG)_BUILD_CMDS)
205 $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
206 @$(call step_end,build)
207 $(Q)touch $@
209 # Install to host dir
210 $(BUILD_DIR)/%/.stamp_host_installed:
211 @$(call step_start,install-host)
212 @$(call MESSAGE,"Installing to host directory")
213 $(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
214 +$($(PKG)_INSTALL_CMDS)
215 $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
216 @$(call step_end,install-host)
217 $(Q)touch $@
219 # Install to staging dir
221 # Some packages install libtool .la files alongside any installed
222 # libraries. These .la files sometimes refer to paths relative to the
223 # sysroot, which libtool will interpret as absolute paths to host
224 # libraries instead of the target libraries. Since this is not what we
225 # want, these paths are fixed by prefixing them with $(STAGING_DIR).
226 # As we configure with --prefix=/usr, this fix needs to be applied to
227 # any path that starts with /usr.
229 # To protect against the case that the output or staging directories or
230 # the pre-installed external toolchain themselves are under /usr, we first
231 # substitute away any occurrences of these directories with @BASE_DIR@,
232 # @STAGING_DIR@ and @TOOLCHAIN_EXTERNAL_INSTALL_DIR@ respectively.
234 # Note that STAGING_DIR can be outside BASE_DIR when the user sets
235 # BR2_HOST_DIR to a custom value. Note that TOOLCHAIN_EXTERNAL_INSTALL_DIR
236 # can be under @BASE_DIR@ when it's a downloaded toolchain, and can be
237 # empty when we use an internal toolchain.
239 $(BUILD_DIR)/%/.stamp_staging_installed:
240 @$(call step_start,install-staging)
241 @$(call MESSAGE,"Installing to staging directory")
242 $(foreach hook,$($(PKG)_PRE_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
243 +$($(PKG)_INSTALL_STAGING_CMDS)
244 $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
245 $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
246 $(call MESSAGE,"Fixing package configuration files") ;\
247 $(SED) "s,$(BASE_DIR),@BASE_DIR@,g" \
248 -e "s,$(STAGING_DIR),@STAGING_DIR@,g" \
249 -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \
250 -e "s,-I/usr/,-I@STAGING_DIR@/usr/,g" \
251 -e "s,-L/usr/,-L@STAGING_DIR@/usr/,g" \
252 -e "s,@STAGING_DIR@,$(STAGING_DIR),g" \
253 -e "s,@BASE_DIR@,$(BASE_DIR),g" \
254 $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\
256 @$(call MESSAGE,"Fixing libtool files")
257 $(Q)find $(STAGING_DIR)/usr/lib* -name "*.la" | xargs --no-run-if-empty \
258 $(SED) "s:$(BASE_DIR):@BASE_DIR@:g" \
259 -e "s:$(STAGING_DIR):@STAGING_DIR@:g" \
260 $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\
261 -e "s:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:g") \
262 -e "s:\(['= ]\)/usr:\\1@STAGING_DIR@/usr:g" \
263 $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\
264 -e "s:@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):g") \
265 -e "s:@STAGING_DIR@:$(STAGING_DIR):g" \
266 -e "s:@BASE_DIR@:$(BASE_DIR):g"
267 @$(call step_end,install-staging)
268 $(Q)touch $@
270 # Install to images dir
271 $(BUILD_DIR)/%/.stamp_images_installed:
272 @$(call step_start,install-image)
273 $(foreach hook,$($(PKG)_PRE_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
274 @$(call MESSAGE,"Installing to images directory")
275 +$($(PKG)_INSTALL_IMAGES_CMDS)
276 $(foreach hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
277 @$(call step_end,install-image)
278 $(Q)touch $@
280 # Install to target dir
281 $(BUILD_DIR)/%/.stamp_target_installed:
282 @$(call step_start,install-target)
283 @$(call MESSAGE,"Installing to target")
284 $(foreach hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
285 +$($(PKG)_INSTALL_TARGET_CMDS)
286 $(if $(BR2_INIT_SYSTEMD),\
287 $($(PKG)_INSTALL_INIT_SYSTEMD))
288 $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
289 $($(PKG)_INSTALL_INIT_SYSV))
290 $(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
291 $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
292 $(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
294 @$(call step_end,install-target)
295 $(Q)touch $@
297 # Remove package sources
298 $(BUILD_DIR)/%/.stamp_dircleaned:
299 rm -Rf $(@D)
301 ################################################################################
302 # virt-provides-single -- check that provider-pkg is the declared provider for
303 # the virtual package virt-pkg
305 # argument 1 is the lower-case name of the virtual package
306 # argument 2 is the upper-case name of the virtual package
307 # argument 3 is the lower-case name of the provider
309 # example:
310 # $(call virt-provides-single,libegl,LIBEGL,rpi-userland)
311 ################################################################################
312 define virt-provides-single
313 ifneq ($$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2))),$(3))
314 $$(error Configuration error: both "$(3)" and $$(BR2_PACKAGE_PROVIDES_$(2))\
315 are selected as providers for virtual package "$(1)". Only one provider can\
316 be selected at a time. Please fix your configuration)
317 endif
318 endef
320 ################################################################################
321 # inner-generic-package -- generates the make targets needed to build a
322 # generic package
324 # argument 1 is the lowercase package name
325 # argument 2 is the uppercase package name, including a HOST_ prefix
326 # for host packages
327 # argument 3 is the uppercase package name, without the HOST_ prefix
328 # for host packages
329 # argument 4 is the type (target or host)
331 # Note about variable and function references: inside all blocks that are
332 # evaluated with $(eval), which includes all 'inner-xxx-package' blocks,
333 # specific rules apply with respect to variable and function references.
334 # - Numbered variables (parameters to the block) can be referenced with a single
335 # dollar sign: $(1), $(2), $(3), etc.
336 # - pkgdir and pkgname should be referenced with a single dollar sign too. These
337 # functions rely on 'the most recently parsed makefile' which is supposed to
338 # be the package .mk file. If we defer the evaluation of these functions using
339 # double dollar signs, then they may be evaluated too late, when other
340 # makefiles have already been parsed. One specific case is when $$(pkgdir) is
341 # assigned to a variable using deferred evaluation with '=' and this variable
342 # is used in a target rule outside the eval'ed inner block. In this case, the
343 # pkgdir will be that of the last makefile parsed by buildroot, which is not
344 # the expected value. This mechanism is for example used for the TARGET_PATCH
345 # rule.
346 # - All other variables should be referenced with a double dollar sign:
347 # $$(TARGET_DIR), $$($(2)_VERSION), etc. Also all make functions should be
348 # referenced with a double dollar sign: $$(subst), $$(call), $$(filter-out),
349 # etc. This rule ensures that these variables and functions are only expanded
350 # during the $(eval) step, and not earlier. Otherwise, unintuitive and
351 # undesired behavior occurs with respect to these variables and functions.
353 ################################################################################
355 define inner-generic-package
357 # Ensure the package is only declared once, i.e. do not accept that a
358 # package be re-defined by a br2-external tree
359 ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),)
360 $$(error Package '$(1)' defined a second time in '$(pkgdir)'; \
361 previous definition was in '$$($(2)_PKGDIR)')
362 endif
363 PACKAGES_ALL += $(1)
365 # Define default values for various package-related variables, if not
366 # already defined. For some variables (version, source, site and
367 # subdir), if they are undefined, we try to see if a variable without
368 # the HOST_ prefix is defined. If so, we use such a variable, so that
369 # this information has only to be specified once, for both the
370 # target and host packages of a given .mk file.
372 $(2)_TYPE = $(4)
373 $(2)_NAME = $(1)
374 $(2)_RAWNAME = $$(patsubst host-%,%,$(1))
375 $(2)_PKGDIR = $(pkgdir)
377 # Keep the package version that may contain forward slashes in the _DL_VERSION
378 # variable, then replace all forward slashes ('/') by underscores ('_') to
379 # sanitize the package version that is used in paths, directory and file names.
380 # Forward slashes may appear in the package's version when pointing to a
381 # version control system branch or tag, for example remotes/origin/1_10_stable.
382 # Similar for spaces and colons (:) that may appear in date-based revisions for
383 # CVS.
384 ifndef $(2)_VERSION
385 ifdef $(3)_DL_VERSION
386 $(2)_DL_VERSION := $$($(3)_DL_VERSION)
387 else ifdef $(3)_VERSION
388 $(2)_DL_VERSION := $$($(3)_VERSION)
389 endif
390 else
391 $(2)_DL_VERSION := $$(strip $$($(2)_VERSION))
392 endif
393 $(2)_VERSION := $$(call sanitize,$$($(2)_DL_VERSION))
395 ifdef $(3)_OVERRIDE_SRCDIR
396 $(2)_OVERRIDE_SRCDIR ?= $$($(3)_OVERRIDE_SRCDIR)
397 endif
399 $(2)_BASE_NAME = $$(if $$($(2)_VERSION),$(1)-$$($(2)_VERSION),$(1))
400 $(2)_RAW_BASE_NAME = $$(if $$($(2)_VERSION),$$($(2)_RAWNAME)-$$($(2)_VERSION),$$($(2)_RAWNAME))
401 $(2)_DL_DIR = $$(DL_DIR)/$$($(2)_BASE_NAME)
402 $(2)_DIR = $$(BUILD_DIR)/$$($(2)_BASE_NAME)
404 ifndef $(2)_SUBDIR
405 ifdef $(3)_SUBDIR
406 $(2)_SUBDIR = $$($(3)_SUBDIR)
407 else
408 $(2)_SUBDIR ?=
409 endif
410 endif
412 ifndef $(2)_STRIP_COMPONENTS
413 ifdef $(3)_STRIP_COMPONENTS
414 $(2)_STRIP_COMPONENTS = $$($(3)_STRIP_COMPONENTS)
415 else
416 $(2)_STRIP_COMPONENTS ?= 1
417 endif
418 endif
420 $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR)
421 $(2)_BUILDDIR ?= $$($(2)_SRCDIR)
423 ifneq ($$($(2)_OVERRIDE_SRCDIR),)
424 $(2)_VERSION = custom
425 endif
427 ifndef $(2)_SOURCE
428 ifdef $(3)_SOURCE
429 $(2)_SOURCE = $$($(3)_SOURCE)
430 else ifdef $(2)_VERSION
431 $(2)_SOURCE ?= $$($(2)_RAW_BASE_NAME).tar.gz
432 endif
433 endif
435 # If FOO_ACTUAL_SOURCE_TARBALL is explicitly defined, it means FOO_SOURCE is
436 # indeed a binary (e.g. external toolchain) and FOO_ACTUAL_SOURCE_TARBALL/_SITE
437 # point to the actual sources tarball. Use the actual sources for legal-info.
438 # For most packages the FOO_SITE/FOO_SOURCE pair points to real source code,
439 # so these are the defaults for FOO_ACTUAL_*.
440 $(2)_ACTUAL_SOURCE_TARBALL ?= $$($(2)_SOURCE)
441 $(2)_ACTUAL_SOURCE_SITE ?= $$(call qstrip,$$($(2)_SITE))
443 ifndef $(2)_PATCH
444 ifdef $(3)_PATCH
445 $(2)_PATCH = $$($(3)_PATCH)
446 endif
447 endif
449 $(2)_ALL_DOWNLOADS = \
450 $$(foreach p,$$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\
451 $$(if $$(findstring ://,$$(p)),$$(p),\
452 $$($(2)_SITE)/$$(p)))
454 ifndef $(2)_SITE
455 ifdef $(3)_SITE
456 $(2)_SITE = $$($(3)_SITE)
457 endif
458 endif
460 ifndef $(2)_SITE_METHOD
461 ifdef $(3)_SITE_METHOD
462 $(2)_SITE_METHOD = $$($(3)_SITE_METHOD)
463 else
464 # Try automatic detection using the scheme part of the URI
465 $(2)_SITE_METHOD = $$(call geturischeme,$$($(2)_SITE))
466 endif
467 endif
469 # Do not accept to download git submodule if not using the git method
470 ifneq ($$($(2)_GIT_SUBMODULES),)
471 ifneq ($$($(2)_SITE_METHOD),git)
472 $$(error $(2) declares having git sub-modules, but does not use the \
473 'git' method (uses '$$($(2)_SITE_METHOD)' instead))
474 endif
475 endif
477 ifeq ($$($(2)_SITE_METHOD),local)
478 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
479 $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE)
480 endif
481 endif
483 ifndef $(2)_LICENSE
484 ifdef $(3)_LICENSE
485 $(2)_LICENSE = $$($(3)_LICENSE)
486 endif
487 endif
489 $(2)_LICENSE ?= unknown
491 ifndef $(2)_LICENSE_FILES
492 ifdef $(3)_LICENSE_FILES
493 $(2)_LICENSE_FILES = $$($(3)_LICENSE_FILES)
494 endif
495 endif
497 ifndef $(2)_REDISTRIBUTE
498 ifdef $(3)_REDISTRIBUTE
499 $(2)_REDISTRIBUTE = $$($(3)_REDISTRIBUTE)
500 endif
501 endif
503 $(2)_REDISTRIBUTE ?= YES
505 $(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)_RAW_BASE_NAME)
507 # When a target package is a toolchain dependency set this variable to
508 # 'NO' so the 'toolchain' dependency is not added to prevent a circular
509 # dependency
510 $(2)_ADD_TOOLCHAIN_DEPENDENCY ?= YES
512 ifeq ($(4),target)
513 ifneq ($(1),skeleton)
514 $(2)_DEPENDENCIES += skeleton
515 endif
516 ifeq ($$($(2)_ADD_TOOLCHAIN_DEPENDENCY),YES)
517 $(2)_DEPENDENCIES += toolchain
518 endif
519 endif
521 # Eliminate duplicates in dependencies
522 $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES))
523 $(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES))
524 $(2)_FINAL_ALL_DEPENDENCIES = $$(sort $$($(2)_FINAL_DEPENDENCIES) $$($(2)_FINAL_PATCH_DEPENDENCIES))
526 $(2)_INSTALL_STAGING ?= NO
527 $(2)_INSTALL_IMAGES ?= NO
528 $(2)_INSTALL_TARGET ?= YES
530 # define sub-target stamps
531 $(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed
532 $(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed
533 $(2)_TARGET_INSTALL_IMAGES = $$($(2)_DIR)/.stamp_images_installed
534 $(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed
535 $(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built
536 $(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured
537 $(2)_TARGET_RSYNC = $$($(2)_DIR)/.stamp_rsynced
538 $(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched
539 $(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted
540 $(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded
541 $(2)_TARGET_ACTUAL_SOURCE = $$($(2)_DIR)/.stamp_actual_downloaded
542 $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned
544 # default extract command
545 $(2)_EXTRACT_CMDS ?= \
546 $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \
547 $$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) \
548 -C $$($(2)_DIR) \
549 $$(foreach x,$$($(2)_EXCLUDES),--exclude='$$(x)' ) \
550 $$(TAR_OPTIONS) -)
552 # pre/post-steps hooks
553 $(2)_PRE_DOWNLOAD_HOOKS ?=
554 $(2)_POST_DOWNLOAD_HOOKS ?=
555 $(2)_PRE_EXTRACT_HOOKS ?=
556 $(2)_POST_EXTRACT_HOOKS ?=
557 $(2)_PRE_RSYNC_HOOKS ?=
558 $(2)_POST_RSYNC_HOOKS ?=
559 $(2)_PRE_PATCH_HOOKS ?=
560 $(2)_POST_PATCH_HOOKS ?=
561 $(2)_PRE_CONFIGURE_HOOKS ?=
562 $(2)_POST_CONFIGURE_HOOKS ?=
563 $(2)_PRE_BUILD_HOOKS ?=
564 $(2)_POST_BUILD_HOOKS ?=
565 $(2)_PRE_INSTALL_HOOKS ?=
566 $(2)_POST_INSTALL_HOOKS ?=
567 $(2)_PRE_INSTALL_STAGING_HOOKS ?=
568 $(2)_POST_INSTALL_STAGING_HOOKS ?=
569 $(2)_PRE_INSTALL_TARGET_HOOKS ?=
570 $(2)_POST_INSTALL_TARGET_HOOKS ?=
571 $(2)_PRE_INSTALL_IMAGES_HOOKS ?=
572 $(2)_POST_INSTALL_IMAGES_HOOKS ?=
573 $(2)_PRE_LEGAL_INFO_HOOKS ?=
574 $(2)_POST_LEGAL_INFO_HOOKS ?=
575 $(2)_TARGET_FINALIZE_HOOKS ?=
577 # human-friendly targets and target sequencing
578 $(1): $(1)-install
580 ifeq ($$($(2)_TYPE),host)
581 $(1)-install: $(1)-install-host
582 else
583 $(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images
584 endif
586 ifeq ($$($(2)_INSTALL_TARGET),YES)
587 $(1)-install-target: $$($(2)_TARGET_INSTALL_TARGET)
588 $$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_BUILD)
589 else
590 $(1)-install-target:
591 endif
593 ifeq ($$($(2)_INSTALL_STAGING),YES)
594 $(1)-install-staging: $$($(2)_TARGET_INSTALL_STAGING)
595 $$($(2)_TARGET_INSTALL_STAGING): $$($(2)_TARGET_BUILD)
596 # Some packages use install-staging stuff for install-target
597 $$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_INSTALL_STAGING)
598 else
599 $(1)-install-staging:
600 endif
602 ifeq ($$($(2)_INSTALL_IMAGES),YES)
603 $(1)-install-images: $$($(2)_TARGET_INSTALL_IMAGES)
604 $$($(2)_TARGET_INSTALL_IMAGES): $$($(2)_TARGET_BUILD)
605 else
606 $(1)-install-images:
607 endif
609 $(1)-install-host: $$($(2)_TARGET_INSTALL_HOST)
610 $$($(2)_TARGET_INSTALL_HOST): $$($(2)_TARGET_BUILD)
612 $(1)-build: $$($(2)_TARGET_BUILD)
613 $$($(2)_TARGET_BUILD): $$($(2)_TARGET_CONFIGURE)
615 # Since $(2)_FINAL_DEPENDENCIES are phony targets, they are always "newer"
616 # than $(2)_TARGET_CONFIGURE. This would force the configure step (and
617 # therefore the other steps as well) to be re-executed with every
618 # invocation of make. Therefore, make $(2)_FINAL_DEPENDENCIES an order-only
619 # dependency by using |.
621 $(1)-configure: $$($(2)_TARGET_CONFIGURE)
622 $$($(2)_TARGET_CONFIGURE): | $$($(2)_FINAL_DEPENDENCIES)
624 $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dirs prepare
625 ifeq ($$(filter $(1),$$(DEPENDENCIES_HOST_PREREQ)),)
626 $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dependencies
627 endif
629 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
630 # In the normal case (no package override), the sequence of steps is
631 # source, by downloading
632 # depends
633 # extract
634 # patch
635 # configure
636 $$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_PATCH)
638 $(1)-patch: $$($(2)_TARGET_PATCH)
639 $$($(2)_TARGET_PATCH): $$($(2)_TARGET_EXTRACT)
640 # Order-only dependency
641 $$($(2)_TARGET_PATCH): | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES))
643 $(1)-extract: $$($(2)_TARGET_EXTRACT)
644 $$($(2)_TARGET_EXTRACT): $$($(2)_TARGET_SOURCE)
646 $(1)-depends: $$($(2)_FINAL_DEPENDENCIES)
648 $(1)-source: $$($(2)_TARGET_SOURCE)
650 $(1)-all-source: $(1)-legal-source
651 $(1)-legal-info: $(1)-legal-source
652 $(1)-legal-source: $(1)-source
654 # Only download the actual source if it differs from the 'main' archive
655 ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),)
656 ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
657 $(1)-legal-source: $$($(2)_TARGET_ACTUAL_SOURCE)
658 endif # actual sources != sources
659 endif # actual sources != ""
661 $(1)-source-check:
662 $$(foreach p,$$($(2)_ALL_DOWNLOADS),$$(call SOURCE_CHECK,$$(p))$$(sep))
664 $(1)-external-deps:
665 @for p in $$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS) ; do \
666 echo `basename $$$$p` ; \
667 done
668 else
669 # In the package override case, the sequence of steps
670 # source, by rsyncing
671 # depends
672 # configure
674 # Use an order-only dependency so the "<pkg>-clean-for-rebuild" rule
675 # can remove the stamp file without triggering the configure step.
676 $$($(2)_TARGET_CONFIGURE): | $$($(2)_TARGET_RSYNC)
678 $(1)-depends: $$($(2)_FINAL_DEPENDENCIES)
680 $(1)-patch: $(1)-rsync
681 $(1)-extract: $(1)-rsync
683 $(1)-rsync: $$($(2)_TARGET_RSYNC)
685 $(1)-source:
686 $(1)-legal-source:
688 $(1)-source-check:
689 test -d $$($(2)_OVERRIDE_SRCDIR)
691 $(1)-external-deps:
692 @echo "file://$$($(2)_OVERRIDE_SRCDIR)"
693 endif
695 $(1)-show-version:
696 @echo $$($(2)_VERSION)
698 $(1)-show-depends:
699 @echo $$($(2)_FINAL_ALL_DEPENDENCIES)
701 $(1)-graph-depends: graph-depends-requirements
702 @$$(INSTALL) -d $$(GRAPHS_DIR)
703 @cd "$$(CONFIG_DIR)"; \
704 $$(TOPDIR)/support/scripts/graph-depends $$(BR2_GRAPH_DEPS_OPTS) \
705 -p $(1) -o $$(GRAPHS_DIR)/$$(@).dot
706 dot $$(BR2_GRAPH_DOT_OPTS) -T$$(BR_GRAPH_OUT) \
707 -o $$(GRAPHS_DIR)/$$(@).$$(BR_GRAPH_OUT) \
708 $$(GRAPHS_DIR)/$$(@).dot
710 $(1)-all-source: $(1)-source
711 $(1)-all-source: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source)
713 $(1)-all-source-check: $(1)-source-check
714 $(1)-all-source-check: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source-check)
716 $(1)-all-external-deps: $(1)-external-deps
717 $(1)-all-external-deps: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-external-deps)
719 $(1)-all-legal-info: $(1)-legal-info
720 $(1)-all-legal-info: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-legal-info)
722 $(1)-dirclean: $$($(2)_TARGET_DIRCLEAN)
724 $(1)-clean-for-reinstall:
725 ifneq ($$($(2)_OVERRIDE_SRCDIR),)
726 rm -f $$($(2)_TARGET_RSYNC)
727 endif
728 rm -f $$($(2)_TARGET_INSTALL_STAGING)
729 rm -f $$($(2)_TARGET_INSTALL_TARGET)
730 rm -f $$($(2)_TARGET_INSTALL_IMAGES)
731 rm -f $$($(2)_TARGET_INSTALL_HOST)
733 $(1)-reinstall: $(1)-clean-for-reinstall $(1)
735 $(1)-clean-for-rebuild: $(1)-clean-for-reinstall
736 rm -f $$($(2)_TARGET_BUILD)
738 $(1)-rebuild: $(1)-clean-for-rebuild $(1)
740 $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
741 rm -f $$($(2)_TARGET_CONFIGURE)
743 $(1)-reconfigure: $(1)-clean-for-reconfigure $(1)
745 # define the PKG variable for all targets, containing the
746 # uppercase package variable prefix
747 $$($(2)_TARGET_INSTALL_TARGET): PKG=$(2)
748 $$($(2)_TARGET_INSTALL_STAGING): PKG=$(2)
749 $$($(2)_TARGET_INSTALL_IMAGES): PKG=$(2)
750 $$($(2)_TARGET_INSTALL_HOST): PKG=$(2)
751 $$($(2)_TARGET_BUILD): PKG=$(2)
752 $$($(2)_TARGET_CONFIGURE): PKG=$(2)
753 $$($(2)_TARGET_RSYNC): SRCDIR=$$($(2)_OVERRIDE_SRCDIR)
754 $$($(2)_TARGET_RSYNC): PKG=$(2)
755 $$($(2)_TARGET_PATCH): PKG=$(2)
756 $$($(2)_TARGET_PATCH): RAWNAME=$$(patsubst host-%,%,$(1))
757 $$($(2)_TARGET_PATCH): PKGDIR=$(pkgdir)
758 $$($(2)_TARGET_EXTRACT): PKG=$(2)
759 $$($(2)_TARGET_SOURCE): PKG=$(2)
760 $$($(2)_TARGET_SOURCE): PKGDIR=$(pkgdir)
761 $$($(2)_TARGET_ACTUAL_SOURCE): PKG=$(2)
762 $$($(2)_TARGET_ACTUAL_SOURCE): PKGDIR=$(pkgdir)
763 $$($(2)_TARGET_DIRCLEAN): PKG=$(2)
765 # Compute the name of the Kconfig option that correspond to the
766 # package being enabled. We handle three cases: the special Linux
767 # kernel case, the bootloaders case, and the normal packages case.
768 ifeq ($(1),linux)
769 $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
770 else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
771 $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
772 else ifneq ($$(filter toolchain/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/toolchain/%),$(pkgdir)),)
773 $(2)_KCONFIG_VAR = BR2_$(2)
774 else
775 $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
776 endif
778 # legal-info: declare dependencies and set values used later for the manifest
779 ifneq ($$($(2)_LICENSE_FILES),)
780 $(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES)
781 endif
783 # We need to extract and patch a package to be able to retrieve its
784 # license files (if any) and the list of patches applied to it (if
785 # any).
786 $(1)-legal-info: $(1)-patch
788 # We only save the sources of packages we want to redistribute, that are
789 # non-overriden (local or true override).
790 ifeq ($$($(2)_REDISTRIBUTE),YES)
791 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
792 # Packages that have a tarball need it downloaded beforehand
793 $(1)-legal-info: $(1)-source $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))
794 endif
795 endif
797 # legal-info: produce legally relevant info.
798 $(1)-legal-info:
799 # Packages without a source are assumed to be part of Buildroot, skip them.
800 $$(foreach hook,$$($(2)_PRE_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
801 ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
803 # Save license files if defined
804 # We save the license files for any kind of package: normal, local,
805 # overridden, or non-redistributable alike.
806 # The reason to save license files even for no-redistribute packages
807 # is that the license still applies to the files distributed as part
808 # of the rootfs, even if the sources are not themselves redistributed.
809 ifeq ($$(call qstrip,$$($(2)_LICENSE_FILES)),)
810 @$$(call legal-warning-pkg,$$($(2)_RAW_BASE_NAME),cannot save license ($(2)_LICENSE_FILES not defined))
811 else
812 @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAW_BASE_NAME),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
813 endif # license files
815 ifeq ($$($(2)_SITE_METHOD),local)
816 # Packages without a tarball: don't save and warn
817 @$$(call legal-warning-nosource,$$($(2)_RAWNAME),local)
819 else ifneq ($$($(2)_OVERRIDE_SRCDIR),)
820 @$$(call legal-warning-nosource,$$($(2)_RAWNAME),override)
822 else
823 # Other packages
825 ifeq ($$($(2)_REDISTRIBUTE),YES)
826 # Save the source tarball and any extra downloads, but not
827 # patches, as they are handled specially afterwards.
828 $$(foreach e,$$($(2)_ACTUAL_SOURCE_TARBALL) $$(notdir $$($(2)_EXTRA_DOWNLOADS)),\
829 $$(Q)support/scripts/hardlink-or-copy \
830 $$(DL_DIR)/$$(e) \
831 $$($(2)_REDIST_SOURCES_DIR)$$(sep))
832 # Save patches and generate the series file
833 $$(Q)while read f; do \
834 support/scripts/hardlink-or-copy \
835 $$$${f} \
836 $$($(2)_REDIST_SOURCES_DIR) || exit 1; \
837 printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \
838 done <$$($(2)_DIR)/.applied_patches_list
839 endif # redistribute
841 endif # other packages
842 @$$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call UPPERCASE,$(4)))
843 endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
844 $$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
846 # add package to the general list of targets if requested by the buildroot
847 # configuration
848 ifeq ($$($$($(2)_KCONFIG_VAR)),y)
850 # Ensure the calling package is the declared provider for all the virtual
851 # packages it claims to be an implementation of.
852 ifneq ($$($(2)_PROVIDES),)
853 $$(foreach pkg,$$($(2)_PROVIDES),\
854 $$(eval $$(call virt-provides-single,$$(pkg),$$(call UPPERCASE,$$(pkg)),$(1))$$(sep)))
855 endif
857 # Ensure unified variable name conventions between all packages Some
858 # of the variables are used by more than one infrastructure; so,
859 # rather than duplicating the checks in each infrastructure, we check
860 # all variables here in pkg-generic, even though pkg-generic should
861 # have no knowledge of infra-specific variables.
862 $(eval $(call check-deprecated-variable,$(2)_MAKE_OPT,$(2)_MAKE_OPTS))
863 $(eval $(call check-deprecated-variable,$(2)_INSTALL_OPT,$(2)_INSTALL_OPTS))
864 $(eval $(call check-deprecated-variable,$(2)_INSTALL_TARGET_OPT,$(2)_INSTALL_TARGET_OPTS))
865 $(eval $(call check-deprecated-variable,$(2)_INSTALL_STAGING_OPT,$(2)_INSTALL_STAGING_OPTS))
866 $(eval $(call check-deprecated-variable,$(2)_INSTALL_HOST_OPT,$(2)_INSTALL_HOST_OPTS))
867 $(eval $(call check-deprecated-variable,$(2)_AUTORECONF_OPT,$(2)_AUTORECONF_OPTS))
868 $(eval $(call check-deprecated-variable,$(2)_CONF_OPT,$(2)_CONF_OPTS))
869 $(eval $(call check-deprecated-variable,$(2)_BUILD_OPT,$(2)_BUILD_OPTS))
870 $(eval $(call check-deprecated-variable,$(2)_GETTEXTIZE_OPT,$(2)_GETTEXTIZE_OPTS))
871 $(eval $(call check-deprecated-variable,$(2)_KCONFIG_OPT,$(2)_KCONFIG_OPTS))
873 PACKAGES += $(1)
875 ifneq ($$($(2)_PERMISSIONS),)
876 PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
877 endif
878 ifneq ($$($(2)_DEVICES),)
879 PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep)
880 endif
881 ifneq ($$($(2)_USERS),)
882 PACKAGES_USERS += $$($(2)_USERS)$$(sep)
883 endif
884 TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
886 ifeq ($$($(2)_SITE_METHOD),svn)
887 DL_TOOLS_DEPENDENCIES += svn
888 else ifeq ($$($(2)_SITE_METHOD),git)
889 DL_TOOLS_DEPENDENCIES += git
890 else ifeq ($$($(2)_SITE_METHOD),bzr)
891 DL_TOOLS_DEPENDENCIES += bzr
892 else ifeq ($$($(2)_SITE_METHOD),scp)
893 DL_TOOLS_DEPENDENCIES += scp ssh
894 else ifeq ($$($(2)_SITE_METHOD),hg)
895 DL_TOOLS_DEPENDENCIES += hg
896 else ifeq ($$($(2)_SITE_METHOD),cvs)
897 DL_TOOLS_DEPENDENCIES += cvs
898 endif # SITE_METHOD
900 # $(firstword) is used here because the extractor can have arguments, like
901 # ZCAT="gzip -d -c", and to check for the dependency we only want 'gzip'.
902 # Do not add xzcat to the list of required dependencies, as it gets built
903 # automatically if it isn't found.
904 ifneq ($$(call suitable-extractor,$$($(2)_SOURCE)),$$(XZCAT))
905 DL_TOOLS_DEPENDENCIES += $$(firstword $$(call suitable-extractor,$$($(2)_SOURCE)))
906 endif
908 # Ensure all virtual targets are PHONY. Listed alphabetically.
909 .PHONY: $(1) \
910 $(1)-all-external-deps \
911 $(1)-all-legal-info \
912 $(1)-all-source \
913 $(1)-all-source-check \
914 $(1)-build \
915 $(1)-clean-for-rebuild \
916 $(1)-clean-for-reconfigure \
917 $(1)-clean-for-reinstall \
918 $(1)-configure \
919 $(1)-depends \
920 $(1)-dirclean \
921 $(1)-external-deps \
922 $(1)-extract \
923 $(1)-graph-depends \
924 $(1)-install \
925 $(1)-install-host \
926 $(1)-install-images \
927 $(1)-install-staging \
928 $(1)-install-target \
929 $(1)-legal-info \
930 $(1)-legal-source \
931 $(1)-patch \
932 $(1)-rebuild \
933 $(1)-reconfigure \
934 $(1)-reinstall \
935 $(1)-rsync \
936 $(1)-show-depends \
937 $(1)-show-version \
938 $(1)-source \
939 $(1)-source-check
941 ifneq ($$($(2)_SOURCE),)
942 ifeq ($$($(2)_SITE),)
943 $$(error $(2)_SITE cannot be empty when $(2)_SOURCE is not)
944 endif
945 endif
947 ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR)
948 $$(error $(2)_SITE ($$($(2)_SITE)) cannot have a trailing slash)
949 endif
951 ifneq ($$($(2)_HELP_CMDS),)
952 HELP_PACKAGES += $(2)
953 endif
955 endif # $(2)_KCONFIG_VAR
956 endef # inner-generic-package
958 ################################################################################
959 # generic-package -- the target generator macro for generic packages
960 ################################################################################
962 # In the case of target packages, keep the package name "pkg"
963 generic-package = $(call inner-generic-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
964 # In the case of host packages, turn the package name "pkg" into "host-pkg"
965 host-generic-package = $(call inner-generic-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
967 # :mode=makefile: