diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-08-27 13:02:09 +1000 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2019-03-05 13:30:28 +1030 |
commit | be24e9e7aa684569ccfd0435678477db37a33d99 (patch) | |
tree | 8293cefae5b4e4a09664c782c8f5bf9a23ffad2f | |
parent | b9674056fbe8d37c1b11ad524075f21dc5deaa15 (diff) | |
download | buildroot-be24e9e7aa684569ccfd0435678477db37a33d99.tar.gz buildroot-be24e9e7aa684569ccfd0435678477db37a33d99.zip |
Separate target-building make targets from image-building make targets
Currently, it's not possible to have dependencies from an image-building
target to a rootfs-building target.
For example, the boot-wrapper-aarch64 package uses the kernel build as
an input file. It supplies a dependency on 'linux', but this will break
if we're using BR2_TARGET_ROOTFS_INITRAMFS - the wrapper will include
the first kernel build, not the rebuild (which contains the embedded
initramfs).
This means we'd need to express a dependency from the target build to
the image build. However, if we do something like:
-BOOT_WRAPPER_AARCH64_DEPENDENCIES = linux
+BOOT_WRAPPER_AARCH64_DEPENDENCIES = linux26-rebuild-with-initramfs
- then we get a circular dependency, because boot-wrapper-aarch64 is in
the TARGETS list, which linux26-rebuild-with-initramfs depends on.
This change splits the possible targets into two separate lists,
TARGET_TARGETS (dependencies for building the target dir) and
IMAGE_TARGETS (dependencies for building images). We keep TARGETS as a
list of everything, and use TARGET_TARGETS for the rootfs-finalize
target.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
[fix for PACKAGES variable rename 8a58e0238ef3]
Signed-off-by: Joel Stanley <joel@jms.id.au>
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | package/pkg-generic.mk | 8 |
2 files changed, 13 insertions, 2 deletions
@@ -427,6 +427,9 @@ GNU_HOST_NAME := $(shell support/gnuconfig/config.guess) PACKAGES := PACKAGES_ALL := +PACKAGE_TARGETS := +IMAGE_TARGETS := + # silent mode requested? QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q) @@ -735,7 +738,7 @@ staging-finalize: @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging .PHONY: target-finalize -target-finalize: $(PACKAGES) host-finalize +target-finalize: $(PACKAGE_TARGETS) host-localedef @$(call MESSAGE,"Finalizing target directory") # Check files that are touched by more than one package ./support/scripts/check-uniq-files -t target $(BUILD_DIR)/packages-file-list.txt @@ -809,7 +812,7 @@ endif # merged /usr touch $(TARGET_DIR)/usr .PHONY: target-post-image -target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize +target-post-image: $(TARGETS_ROOTFS) $(IMAGE_TARGETS) target-finalize @rm -f $(ROOTFS_COMMON_TAR) @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ $(call MESSAGE,"Executing post-image script $(s)"); \ diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 4353bd3868..3a99df13d4 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -1014,6 +1014,14 @@ $(eval $(call check-deprecated-variable,$(2)_KCONFIG_OPT,$(2)_KCONFIG_OPTS)) PACKAGES += $(1) +ifneq ($$($(2)_INSTALL_STAGING)$$($(2)_INSTALL_TARGET),NONO) +PACKAGE_TARGETS += $(1) +endif + +ifeq ($$($(2)_INSTALL_IMAGES),YES) +IMAGE_TARGETS += $(1) +endif + ifneq ($$($(2)_PERMISSIONS),) PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep) endif |