@@ -366,8 +366,6 @@ include system/system.mk
include $(BR2_EXTERNAL)/external.mk
-TARGETS+=target-finalize
-
ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
TARGETS+=target-purgelocales
endif
@@ -384,8 +382,6 @@ endif
include fs/common.mk
-TARGETS+=target-post-image
-
TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
@@ -418,11 +414,12 @@ $(BUILD_DIR)/buildroot-config/auto.conf: $(BUILDROOT_CONFIG)
prepare: $(BUILD_DIR)/buildroot-config/auto.conf
-world: $(TARGETS)
+world: target-post-image
.PHONY: all world toolchain dirs clean distclean source outputmakefile \
legal-info legal-info-prepare legal-info-clean printvars \
- $(BASE_TARGETS) $(TARGETS) \
+ target-finalize target-post-image \
+ $(BASE_TARGETS) $(TARGETS) $(TARGETS_ROOTFS) \
$(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
$(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
@@ -482,7 +479,7 @@ endif
STRIP_FIND_CMD += -type f -perm /111
STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print
-target-finalize:
+target-finalize: $(TARGETS)
rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
@@ -588,7 +585,7 @@ target-generatelocales: host-localedef
done
endif
-target-post-image:
+target-post-image: target-finalize $(TARGETS_ROOTFS)
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
$(call MESSAGE,"Executing post-image script $(s)"); \
$(USER_HOOKS_EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
@@ -625,7 +622,7 @@ legal-info: dirs legal-info-clean legal-info-prepare $(TARGETS_LEGAL_INFO) \
@rm -f $(LEGAL_WARNINGS)
show-targets:
- @echo $(TARGETS)
+ @echo $(TARGETS) $(TARGETS_ROOTFS)
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
@@ -63,7 +63,7 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz
ROOTFS_$(2)_COMPRESS_CMD = $$(XZ) -9 -C crc32 -c
endif
-$$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
+$$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES)
@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
$$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),$$(call $$(hook))$$(sep))
rm -f $$(FAKEROOT_SCRIPT)
@@ -94,7 +94,7 @@ rootfs-$(1)-show-depends:
rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(1) $$(ROOTFS_$(2)_POST_TARGETS)
ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y)
-TARGETS += rootfs-$(1)
+TARGETS_ROOTFS += rootfs-$(1)
endif
endef