Skip to content

Commit 584193c

Browse files
committed
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 <[email protected]>
1 parent a46aae5 commit 584193c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Diff for: Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ unexport TERMINFO
294294
GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
295295

296296
TARGETS :=
297+
TARGET_TARGETS :=
298+
IMAGE_TARGETS :=
297299

298300
# silent mode requested?
299301
QUIET := $(if $(findstring s,$(MAKEFLAGS)),-q)
@@ -531,7 +533,7 @@ endif
531533

532534
$(TARGETS_ROOTFS): target-finalize
533535

534-
target-finalize: $(TARGETS)
536+
target-finalize: $(TARGET_TARGETS)
535537
@$(call MESSAGE,"Finalizing target directory")
536538
$(TARGET_PURGE_LOCALES)
537539
rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
@@ -624,7 +626,7 @@ target-generatelocales: host-localedef toolchain
624626
done
625627
endif
626628

627-
target-post-image: $(TARGETS_ROOTFS) target-finalize
629+
target-post-image: $(TARGETS_ROOTFS) $(IMAGE_TARGETS) target-finalize
628630
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
629631
$(call MESSAGE,"Executing post-image script $(s)"); \
630632
$(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))

Diff for: package/pkg-generic.mk

+8
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,14 @@ endif
681681

682682
TARGETS += $(1)
683683

684+
ifneq ($$($(2)_INSTALL_STAGING)$$($(2)_INSTALL_TARGET),NONO)
685+
TARGET_TARGETS += $(1)
686+
endif
687+
688+
ifeq ($$($(2)_INSTALL_IMAGES),YES)
689+
IMAGE_TARGETS += $(1)
690+
endif
691+
684692
ifneq ($$($(2)_PERMISSIONS),)
685693
PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
686694
endif

0 commit comments

Comments
 (0)