2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2010-05-30 22:46:45 +02:00
|
|
|
#
|
2013-06-06 23:54:12 +02:00
|
|
|
# barebox
|
2010-05-30 22:46:45 +02:00
|
|
|
#
|
2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2010-05-30 22:46:45 +02:00
|
|
|
|
2016-04-24 11:18:44 +02:00
|
|
|
################################################################################
|
|
|
|
# inner-barebox-package -- generates the KConfig logic and make targets needed
|
|
|
|
# to support a barebox package. All barebox packages are built from the same
|
2016-04-24 11:18:45 +02:00
|
|
|
# source (origin, version and patches). The remainder of the package
|
|
|
|
# configuration is unique to each barebox package.
|
|
|
|
#
|
|
|
|
# argument 1 is the uppercase package name (used for variable name-space)
|
2016-04-24 11:18:44 +02:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
define inner-barebox-package
|
2011-09-17 22:23:08 +02:00
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
|
2016-04-24 11:18:44 +02:00
|
|
|
|
2022-06-23 16:00:26 +02:00
|
|
|
ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL),y)
|
2011-09-17 22:23:08 +02:00
|
|
|
# Handle custom Barebox tarballs as specified by the configuration
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
|
|
|
|
$(1)_SITE = $$(patsubst %/,%,$$(dir $$($(1)_TARBALL)))
|
|
|
|
$(1)_SOURCE = $$(notdir $$($(1)_TARBALL))
|
2016-04-24 11:18:44 +02:00
|
|
|
else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
|
|
|
|
$(1)_SITE_METHOD = git
|
2020-03-19 22:56:57 +01:00
|
|
|
# Override the default value of _SOURCE to 'barebox-*' so that it is not
|
|
|
|
# downloaded a second time for barebox-aux; also alows avoiding the hash
|
|
|
|
# check:
|
2021-01-18 19:16:12 +01:00
|
|
|
$(1)_SOURCE = barebox-$$($(1)_VERSION)$$(BR_FMT_VERSION_git).tar.gz
|
2011-09-17 22:23:08 +02:00
|
|
|
else
|
|
|
|
# Handle stable official Barebox versions
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_SOURCE = barebox-$$($(1)_VERSION).tar.bz2
|
2019-01-11 22:52:35 +01:00
|
|
|
$(1)_SITE = https://www.barebox.org/download
|
2011-09-17 22:23:08 +02:00
|
|
|
endif
|
|
|
|
|
2020-03-19 22:49:00 +01:00
|
|
|
$(1)_DL_SUBDIR = barebox
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_DEPENDENCIES = host-lzop
|
2017-03-30 15:43:32 +02:00
|
|
|
$(1)_LICENSE = GPL-2.0 with exceptions
|
2020-02-05 15:48:41 +01:00
|
|
|
ifeq ($(BR2_TARGET_BAREBOX_LATEST_VERSION),y)
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_LICENSE_FILES = COPYING
|
2020-02-05 15:48:41 +01:00
|
|
|
endif
|
2012-08-18 11:25:37 +02:00
|
|
|
|
2023-07-24 10:04:09 +02:00
|
|
|
ifeq ($(BR2_TARGET_BAREBOX_NEEDS_OPENSSL),y)
|
|
|
|
BAREBOX_DEPENDENCIES += host-openssl host-pkgconf
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_BAREBOX_NEEDS_LIBUSB),y)
|
|
|
|
BAREBOX_DEPENDENCIES += host-libusb host-pkgconf
|
|
|
|
endif
|
|
|
|
|
2016-05-06 07:46:04 +02:00
|
|
|
$(1)_CUSTOM_EMBEDDED_ENV_PATH = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_EMBEDDED_ENV_PATH))
|
|
|
|
|
2016-04-24 11:18:44 +02:00
|
|
|
ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
|
2016-04-24 11:18:45 +02:00
|
|
|
define $(1)_APPLY_CUSTOM_PATCHES
|
2016-04-24 11:18:44 +02:00
|
|
|
$$(APPLY_PATCHES) $$(@D) \
|
|
|
|
$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
|
2011-09-17 22:23:08 +02:00
|
|
|
endef
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_POST_PATCH_HOOKS += $(1)_APPLY_CUSTOM_PATCHES
|
2011-09-17 22:23:08 +02:00
|
|
|
endif
|
2011-07-05 21:53:59 +02:00
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_INSTALL_IMAGES = YES
|
|
|
|
ifneq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
|
|
|
|
$(1)_INSTALL_TARGET = NO
|
2011-07-05 21:53:59 +02:00
|
|
|
endif
|
|
|
|
|
core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH
The variable 'KERNEL_ARCH' is actually a normalized version of
'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just
as all powerpc variants become 'powerpc'.
It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically
the first place where support for a new architecture is added, and thus is
the entity that defines the normalized name.
However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture
used by the kernel', which need not be exactly the same as 'the normalized
name for a certain arch'. In particular, for cases where a 64-bit
architecture is running a 64-bit kernel but 32-bit userspace. Examples
include:
* aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
* x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace
In such cases, the 'architecture used by the kernel' needs to refer to the
64-bit name (aarch64, x86_64), whereas all userspace applications need to
refer the, potentially normalized, 32-bit name.
This means that there need to be two different variables:
KERNEL_ARCH: the architecture used by the kernel
NORMALIZED_ARCH: the normalized name for the current userspace architecture
At this moment, both will actually have the same content. But a subsequent
patch will add basic support for situations described above, in which
KERNEL_ARCH may become overwritten to the 64-bit architecture, while
NORMALIZED_ARCH needs to remain the same (32-bit) case.
This commit replaces use of KERNEL_ARCH where actually the userspace arch is
needed. Places that use KERNEL_ARCH in combination with building of kernel
modules are not touched.
There may be cases where a package builds both a kernel module as userspace,
in which case it may need to know about both KERNEL_ARCH and
NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on
a per-need basis.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
[Arnout: Also rename BR2_KERNEL_ARCH to BR2_NORMALIZED_ARCH]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-15 21:03:00 +01:00
|
|
|
ifeq ($$(NORMALIZED_ARCH),i386)
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_ARCH = x86
|
core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH
The variable 'KERNEL_ARCH' is actually a normalized version of
'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just
as all powerpc variants become 'powerpc'.
It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically
the first place where support for a new architecture is added, and thus is
the entity that defines the normalized name.
However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture
used by the kernel', which need not be exactly the same as 'the normalized
name for a certain arch'. In particular, for cases where a 64-bit
architecture is running a 64-bit kernel but 32-bit userspace. Examples
include:
* aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
* x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace
In such cases, the 'architecture used by the kernel' needs to refer to the
64-bit name (aarch64, x86_64), whereas all userspace applications need to
refer the, potentially normalized, 32-bit name.
This means that there need to be two different variables:
KERNEL_ARCH: the architecture used by the kernel
NORMALIZED_ARCH: the normalized name for the current userspace architecture
At this moment, both will actually have the same content. But a subsequent
patch will add basic support for situations described above, in which
KERNEL_ARCH may become overwritten to the 64-bit architecture, while
NORMALIZED_ARCH needs to remain the same (32-bit) case.
This commit replaces use of KERNEL_ARCH where actually the userspace arch is
needed. Places that use KERNEL_ARCH in combination with building of kernel
modules are not touched.
There may be cases where a package builds both a kernel module as userspace,
in which case it may need to know about both KERNEL_ARCH and
NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on
a per-need basis.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
[Arnout: Also rename BR2_KERNEL_ARCH to BR2_NORMALIZED_ARCH]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-15 21:03:00 +01:00
|
|
|
else ifeq ($$(NORMALIZED_ARCH),x86_64)
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_ARCH = x86
|
core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH
The variable 'KERNEL_ARCH' is actually a normalized version of
'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just
as all powerpc variants become 'powerpc'.
It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically
the first place where support for a new architecture is added, and thus is
the entity that defines the normalized name.
However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture
used by the kernel', which need not be exactly the same as 'the normalized
name for a certain arch'. In particular, for cases where a 64-bit
architecture is running a 64-bit kernel but 32-bit userspace. Examples
include:
* aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
* x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace
In such cases, the 'architecture used by the kernel' needs to refer to the
64-bit name (aarch64, x86_64), whereas all userspace applications need to
refer the, potentially normalized, 32-bit name.
This means that there need to be two different variables:
KERNEL_ARCH: the architecture used by the kernel
NORMALIZED_ARCH: the normalized name for the current userspace architecture
At this moment, both will actually have the same content. But a subsequent
patch will add basic support for situations described above, in which
KERNEL_ARCH may become overwritten to the 64-bit architecture, while
NORMALIZED_ARCH needs to remain the same (32-bit) case.
This commit replaces use of KERNEL_ARCH where actually the userspace arch is
needed. Places that use KERNEL_ARCH in combination with building of kernel
modules are not touched.
There may be cases where a package builds both a kernel module as userspace,
in which case it may need to know about both KERNEL_ARCH and
NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on
a per-need basis.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
[Arnout: Also rename BR2_KERNEL_ARCH to BR2_NORMALIZED_ARCH]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-15 21:03:00 +01:00
|
|
|
else ifeq ($$(NORMALIZED_ARCH),powerpc)
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_ARCH = ppc
|
core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH
The variable 'KERNEL_ARCH' is actually a normalized version of
'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just
as all powerpc variants become 'powerpc'.
It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically
the first place where support for a new architecture is added, and thus is
the entity that defines the normalized name.
However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture
used by the kernel', which need not be exactly the same as 'the normalized
name for a certain arch'. In particular, for cases where a 64-bit
architecture is running a 64-bit kernel but 32-bit userspace. Examples
include:
* aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
* x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace
In such cases, the 'architecture used by the kernel' needs to refer to the
64-bit name (aarch64, x86_64), whereas all userspace applications need to
refer the, potentially normalized, 32-bit name.
This means that there need to be two different variables:
KERNEL_ARCH: the architecture used by the kernel
NORMALIZED_ARCH: the normalized name for the current userspace architecture
At this moment, both will actually have the same content. But a subsequent
patch will add basic support for situations described above, in which
KERNEL_ARCH may become overwritten to the 64-bit architecture, while
NORMALIZED_ARCH needs to remain the same (32-bit) case.
This commit replaces use of KERNEL_ARCH where actually the userspace arch is
needed. Places that use KERNEL_ARCH in combination with building of kernel
modules are not touched.
There may be cases where a package builds both a kernel module as userspace,
in which case it may need to know about both KERNEL_ARCH and
NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on
a per-need basis.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
[Arnout: Also rename BR2_KERNEL_ARCH to BR2_NORMALIZED_ARCH]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-15 21:03:00 +01:00
|
|
|
else ifeq ($$(NORMALIZED_ARCH),arm64)
|
2016-08-12 16:31:52 +02:00
|
|
|
$(1)_ARCH = arm
|
2010-05-30 22:46:45 +02:00
|
|
|
else
|
core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH
The variable 'KERNEL_ARCH' is actually a normalized version of
'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just
as all powerpc variants become 'powerpc'.
It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically
the first place where support for a new architecture is added, and thus is
the entity that defines the normalized name.
However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture
used by the kernel', which need not be exactly the same as 'the normalized
name for a certain arch'. In particular, for cases where a 64-bit
architecture is running a 64-bit kernel but 32-bit userspace. Examples
include:
* aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
* x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace
In such cases, the 'architecture used by the kernel' needs to refer to the
64-bit name (aarch64, x86_64), whereas all userspace applications need to
refer the, potentially normalized, 32-bit name.
This means that there need to be two different variables:
KERNEL_ARCH: the architecture used by the kernel
NORMALIZED_ARCH: the normalized name for the current userspace architecture
At this moment, both will actually have the same content. But a subsequent
patch will add basic support for situations described above, in which
KERNEL_ARCH may become overwritten to the 64-bit architecture, while
NORMALIZED_ARCH needs to remain the same (32-bit) case.
This commit replaces use of KERNEL_ARCH where actually the userspace arch is
needed. Places that use KERNEL_ARCH in combination with building of kernel
modules are not touched.
There may be cases where a package builds both a kernel module as userspace,
in which case it may need to know about both KERNEL_ARCH and
NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on
a per-need basis.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
[Arnout: Also rename BR2_KERNEL_ARCH to BR2_NORMALIZED_ARCH]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-15 21:03:00 +01:00
|
|
|
$(1)_ARCH = $$(NORMALIZED_ARCH)
|
2010-05-30 22:46:45 +02:00
|
|
|
endif
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_MAKE_FLAGS = ARCH=$$($(1)_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
|
|
|
|
$(1)_MAKE_ENV = $$(TARGET_MAKE_ENV)
|
2023-07-24 10:04:09 +02:00
|
|
|
$(1)_MAKE_ENV += \
|
|
|
|
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
|
|
|
|
PKG_CONFIG_SYSROOT_DIR="/" \
|
|
|
|
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
|
|
|
|
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
|
|
|
|
PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig"
|
2012-11-03 07:05:10 +01:00
|
|
|
|
2023-02-06 11:21:22 +01:00
|
|
|
ifeq ($$(BR2_REPRODUCIBLE),y)
|
2023-01-19 13:10:04 +01:00
|
|
|
$(1)_MAKE_ENV += \
|
|
|
|
KBUILD_BUILD_USER=buildroot \
|
|
|
|
KBUILD_BUILD_HOST=buildroot \
|
2023-02-06 11:48:40 +01:00
|
|
|
KBUILD_BUILD_TIMESTAMP="$$(shell LC_ALL=C TZ='UTC' date -d @$(SOURCE_DATE_EPOCH))"
|
2023-01-19 13:10:04 +01:00
|
|
|
endif
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
ifeq ($$(BR2_TARGET_$(1)_USE_DEFCONFIG),y)
|
|
|
|
$(1)_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))_defconfig
|
|
|
|
else ifeq ($$(BR2_TARGET_$(1)_USE_CUSTOM_CONFIG),y)
|
|
|
|
$(1)_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE))
|
2012-11-03 07:05:10 +01:00
|
|
|
endif
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
$(1)_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_CONFIG_FRAGMENT_FILES))
|
|
|
|
$(1)_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
|
|
|
|
$(1)_KCONFIG_OPTS = $$($(1)_MAKE_FLAGS)
|
2010-05-30 22:46:45 +02:00
|
|
|
|
2019-07-02 22:13:41 +02:00
|
|
|
$(1)_KCONFIG_DEPENDENCIES = \
|
|
|
|
$(BR2_BISON_HOST_DEPENDENCY) \
|
|
|
|
$(BR2_FLEX_HOST_DEPENDENCY)
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
ifeq ($$(BR2_TARGET_$(1)_CUSTOM_ENV),y)
|
|
|
|
$(1)_ENV_NAME = $$(notdir $$(call qstrip,\
|
|
|
|
$$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)))
|
|
|
|
define $(1)_BUILD_CUSTOM_ENV
|
2016-04-24 11:18:44 +02:00
|
|
|
$$(@D)/scripts/bareboxenv -s \
|
2016-04-24 11:18:45 +02:00
|
|
|
$$(call qstrip, $$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)) \
|
|
|
|
$$(@D)/$$($(1)_ENV_NAME)
|
2013-01-28 11:10:34 +01:00
|
|
|
endef
|
2016-04-24 11:18:45 +02:00
|
|
|
define $(1)_INSTALL_CUSTOM_ENV
|
|
|
|
cp $$(@D)/$$($(1)_ENV_NAME) $$(BINARIES_DIR)
|
2013-01-28 11:10:34 +01:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2016-05-06 07:46:04 +02:00
|
|
|
ifneq ($$($(1)_CUSTOM_EMBEDDED_ENV_PATH),)
|
2020-10-03 11:59:02 +02:00
|
|
|
define $(1)_KCONFIG_FIXUP_CUSTOM_EMBEDDED_ENV_PATH
|
2020-04-04 14:10:15 +02:00
|
|
|
$$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_ENVIRONMENT)
|
|
|
|
$$(call KCONFIG_SET_OPT,CONFIG_DEFAULT_ENVIRONMENT_PATH,"$$($(1)_CUSTOM_EMBEDDED_ENV_PATH)")
|
2016-05-06 07:46:04 +02:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2020-10-03 11:59:02 +02:00
|
|
|
define $(1)_KCONFIG_FIXUP_BAREBOXENV
|
|
|
|
$$(if $$(BR2_TARGET_$(1)_BAREBOXENV),\
|
|
|
|
$$(call KCONFIG_ENABLE_OPT,CONFIG_BAREBOXENV_TARGET),\
|
|
|
|
$$(call KCONFIG_DISABLE_OPT,CONFIG_BAREBOXENV_TARGET))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(1)_KCONFIG_FIXUP_CMDS
|
|
|
|
$$($(1)_KCONFIG_FIXUP_CUSTOM_EMBEDDED_ENV_PATH)
|
|
|
|
$$($(1)_KCONFIG_FIXUP_BAREBOXENV)
|
|
|
|
endef
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
define $(1)_BUILD_CMDS
|
|
|
|
$$($(1)_BUILD_BAREBOXENV_CMDS)
|
2023-01-19 13:10:04 +01:00
|
|
|
$$($(1)_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
|
2016-04-24 11:18:45 +02:00
|
|
|
$$($(1)_BUILD_CUSTOM_ENV)
|
2011-07-05 21:53:59 +02:00
|
|
|
endef
|
2010-05-30 22:46:45 +02:00
|
|
|
|
2017-06-21 09:03:53 +02:00
|
|
|
$(1)_IMAGE_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_IMAGE_FILE))
|
2016-04-24 11:18:43 +02:00
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
define $(1)_INSTALL_IMAGES_CMDS
|
2017-06-21 09:03:53 +02:00
|
|
|
if test -n "$$($(1)_IMAGE_FILES)"; then \
|
|
|
|
cp -L $$(foreach image,$$($(1)_IMAGE_FILES),$$(@D)/$$(image)) $$(BINARIES_DIR) ; \
|
2024-02-19 22:06:28 +01:00
|
|
|
elif test -e $$(@D)/barebox-flash-images ; then \
|
|
|
|
cp -L $$(foreach image,$$(shell cat $$(@D)/barebox-flash-images),$$(@D)/$$(image)) $$(BINARIES_DIR) ; \
|
2016-04-24 11:18:44 +02:00
|
|
|
elif test -h $$(@D)/barebox-flash-image ; then \
|
|
|
|
cp -L $$(@D)/barebox-flash-image $$(BINARIES_DIR)/barebox.bin ; \
|
2012-11-22 03:35:11 +01:00
|
|
|
else \
|
2016-04-24 11:18:44 +02:00
|
|
|
cp $$(@D)/barebox.bin $$(BINARIES_DIR);\
|
2012-11-22 03:35:11 +01:00
|
|
|
fi
|
2016-04-24 11:18:45 +02:00
|
|
|
$$($(1)_INSTALL_CUSTOM_ENV)
|
2011-07-05 21:53:59 +02:00
|
|
|
endef
|
2010-05-30 22:46:45 +02:00
|
|
|
|
2020-12-08 11:11:07 +01:00
|
|
|
# Starting with barebox v2020.09.0, the kconfig used calls the
|
|
|
|
# cross-compiler to check its capabilities. So we need the
|
|
|
|
# toolchain before we can call the configurators.
|
|
|
|
$(1)_KCONFIG_DEPENDENCIES += toolchain
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
|
|
|
|
define $(1)_INSTALL_TARGET_CMDS
|
2020-10-03 11:59:02 +02:00
|
|
|
cp $$(@D)/scripts/bareboxenv-target $$(TARGET_DIR)/usr/bin/bareboxenv
|
2011-07-05 21:53:59 +02:00
|
|
|
endef
|
|
|
|
endif
|
2011-02-06 21:40:19 +01:00
|
|
|
|
2015-07-13 12:32:02 +02:00
|
|
|
# Checks to give errors that the user can understand
|
|
|
|
# Must be before we call to kconfig-package
|
2016-04-24 11:18:45 +02:00
|
|
|
ifeq ($$(BR2_TARGET_$(1))$$(BR_BUILDING),yy)
|
2015-12-22 22:22:04 +01:00
|
|
|
# We must use the user-supplied kconfig value, because
|
2016-04-24 11:18:45 +02:00
|
|
|
# $(1)_KCONFIG_DEFCONFIG will at least contain the
|
2015-12-22 22:22:04 +01:00
|
|
|
# trailing _defconfig
|
2016-04-24 11:18:45 +02:00
|
|
|
ifeq ($$(or $$($(1)_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))),)
|
|
|
|
$$(error No Barebox config. Check your BR2_TARGET_$(1)_BOARD_DEFCONFIG or BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE settings)
|
2010-05-30 22:46:45 +02:00
|
|
|
endif
|
2010-09-28 14:43:25 +02:00
|
|
|
endif
|
2015-07-13 12:32:02 +02:00
|
|
|
|
2016-04-24 11:18:44 +02:00
|
|
|
$$(eval $$(kconfig-package))
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# barebox-package -- the target generator macro for barebox packages
|
|
|
|
################################################################################
|
|
|
|
|
2016-04-24 11:18:45 +02:00
|
|
|
barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
|
2016-04-24 11:18:44 +02:00
|
|
|
|
2016-04-24 23:15:23 +02:00
|
|
|
include boot/barebox/barebox/barebox.mk
|
2016-04-24 23:15:24 +02:00
|
|
|
include boot/barebox/barebox-aux/barebox-aux.mk
|
2017-03-21 01:07:08 +01:00
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_BAREBOX)$(BR2_TARGET_BAREBOX_LATEST_VERSION),y)
|
|
|
|
BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
|
|
|
|
endif
|