endif
-.PHONY: dirs
-dirs: $(BUILD_DIR) $(STAGING_DIR) $(BASE_TARGET_DIR) \
- $(HOST_DIR) $(HOST_DIR_SYMLINK) $(BINARIES_DIR)
-
$(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
$(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" syncconfig
--transform='s#^\.#$(BR2_SDK_PREFIX)#' \
-C $(HOST_DIR) "."
-# Populating the staging with the base directories is handled by the skeleton package
-$(STAGING_DIR):
- @mkdir -p $(STAGING_DIR)
- @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
-
RSYNC_VCS_EXCLUSIONS = \
--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
--exclude CVS
# Avoid the rootfs name leaking down the dependency chain
target-finalize: ROOTFS=
+host-finalize: $(HOST_DIR_SYMLINK)
+
+.PHONY: staging-finalize
+staging-finalize:
+ @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
+
.PHONY: target-finalize
-target-finalize: $(PACKAGES)
+target-finalize: $(PACKAGES) host-finalize
@$(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
touch $(TARGET_DIR)/usr
.PHONY: target-post-image
-target-post-image: $(TARGETS_ROOTFS) target-finalize
+target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize
@rm -f $(ROOTFS_COMMON_TAR)
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
$(call MESSAGE,"Executing post-image script $(s)"); \
@cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
.PHONY: legal-info
-legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
+legal-info: legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
$(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
@cat support/legal-info/README.header >>$(LEGAL_REPORT)
@if [ -r $(LEGAL_WARNINGS) ]; then \
$(BUILD_DIR)/%/.stamp_rsynced:
@$(call step_start,rsync)
@$(call MESSAGE,"Syncing from source dir $(SRCDIR)")
+ @mkdir -p $(@D)
$(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep))
@test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1)
rsync -au --chmod=u=rwX,go=rX $(RSYNC_VCS_EXCLUSIONS) $($(PKG)_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D)
$(BUILD_DIR)/%/.stamp_host_installed:
@$(call step_start,install-host)
@$(call MESSAGE,"Installing to host directory")
+ @mkdir -p $(HOST_DIR)
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
+$($(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
$(BUILD_DIR)/%/.stamp_staging_installed:
@$(call step_start,install-staging)
@$(call MESSAGE,"Installing to staging directory")
+ @mkdir -p $(STAGING_DIR)
$(foreach hook,$($(PKG)_PRE_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
+$($(PKG)_INSTALL_STAGING_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
# Install to images dir
$(BUILD_DIR)/%/.stamp_images_installed:
@$(call step_start,install-image)
+ @mkdir -p $(BINARIES_DIR)
$(foreach hook,$($(PKG)_PRE_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
@$(call MESSAGE,"Installing to images directory")
+$($(PKG)_INSTALL_IMAGES_CMDS)
$(BUILD_DIR)/%/.stamp_target_installed:
@$(call step_start,install-target)
@$(call MESSAGE,"Installing to target")
+ @mkdir -p $(TARGET_DIR)
$(foreach hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
+$($(PKG)_INSTALL_TARGET_CMDS)
$(if $(BR2_INIT_SYSTEMD),\
$(1)-configure: $$($(2)_TARGET_CONFIGURE)
$$($(2)_TARGET_CONFIGURE): | $$($(2)_FINAL_DEPENDENCIES)
-$$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dirs prepare
+$$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | prepare
$$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dependencies
ifeq ($$($(2)_OVERRIDE_SRCDIR),)