summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-07-11 22:46:10 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-07-11 23:40:23 +0200
commitb0d446dee427cfdb71c55c2a46472786de7b8ffc (patch)
tree0b59e3494307eceef0e865392f4147d05145faf8 /package
parenta4ca959321da218ebb2e5078831e5ec1f4d8da34 (diff)
downloadbuildroot-novena-b0d446dee427cfdb71c55c2a46472786de7b8ffc.tar.gz
buildroot-novena-b0d446dee427cfdb71c55c2a46472786de7b8ffc.zip
Improve TARGETS handling for bootloaders and kernel
As the kernel and bootloaders do not use the normal BR2_PACKAGE_* Kconfig options, their target name was not automatically added to the global TARGETS variable. Each bootloader .mk and the linux.mk had to add their own target manually to TARGETS, and the package infrastructure was making tests on non-existing Kconfig variables. This commit improves the package infrastructure so that it looks at BR2_PACKAGE_<pkg> for packages, BR2_TARGET_<pkg> for bootloaders and at the special BR2_LINUX_KERNEL for the linux package. This allows to simplify a little bit the bootloaders and linux .mk files. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package')
-rw-r--r--package/Makefile.package.in16
1 files changed, 13 insertions, 3 deletions
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index aa5c0d7e8..faa7ff1f3 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -522,10 +522,20 @@ $$($(2)_TARGET_UNINSTALL): PKG=$(2)
$$($(2)_TARGET_CLEAN): PKG=$(2)
$$($(2)_TARGET_DIRCLEAN): PKG=$(2)
+# Compute the name of the Kconfig option that correspond to the
+# package being enabled. We handle three cases: the special Linux
+# kernel case, the bootloaders case, and the normal packages case.
+ifeq ($(1),linux)
+$(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
+else ifeq ($(4),boot)
+$(2)_KCONFIG_VAR = BR2_TARGET_$(2)
+else
+$(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
+endif
+
# add package to the general list of targets if requested by the buildroot
# configuration
-
-ifeq ($$(BR2_PACKAGE_$(2)),y)
+ifeq ($$($$($(2)_KCONFIG_VAR)),y)
TARGETS += $(1)
@@ -537,7 +547,7 @@ else ifeq ($$($(2)_SITE_METHOD),bzr)
DL_TOOLS_DEPENDENCIES += bzr
endif # SITE_METHOD
-endif # BR2_PACKAGE_$(2)
+endif # $(2)_KCONFIG_VAR
endef # GENTARGETS_INNER
################################################################################