Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brent Generous <bgenerous@impinj.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Makefile: add $BINARIES_DIR dependency to target-post-image target
Date: Fri, 12 Jul 2019 16:10:02 +0000	[thread overview]
Message-ID: <20190712160925.6027-1-bgenerous@impinj.com> (raw)

Without this dependency, there is no guarantee that the $BINARIES_DIR
has been created before this point. This can cause commands that intend
to copy a file into $BINARIES_DIR to instead copy to a file named
$BINARIES_DIR, causing later commands to create this directory to fail.

A comment above the target for $BINARIES_DIR mentions "do NOT list these
as dependencies anywhere else". It wasn't clear from the git history why
that should be the case. This seems like the correct way to handle the
dependency on this directory.

Signed-off-by: Brent Generous <bgenerous@impinj.com>
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index c98a0ed87e..2ea7220484 100644
--- a/Makefile
+++ b/Makefile
@@ -606,7 +606,6 @@ BR2_SDK_PREFIX ?= $(GNU_TARGET_NAME)_sdk-buildroot
 sdk: prepare-sdk $(BR2_TAR_HOST_DEPENDENCY)
 	@$(call MESSAGE,"Generating SDK tarball")
 	$(if $(BR2_SDK_PREFIX),,$(error BR2_SDK_PREFIX can not be empty))
-	$(Q)mkdir -p $(BINARIES_DIR)
 	$(TAR) czf "$(BINARIES_DIR)/$(BR2_SDK_PREFIX).tar.gz" \
 		--owner=0 --group=0 --numeric-owner \
 		--transform='s#^$(patsubst /%,%,$(HOST_DIR))#$(BR2_SDK_PREFIX)#' \
@@ -810,7 +809,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) target-finalize staging-finalize | $(BINARIES_DIR)
 	@rm -f $(ROOTFS_COMMON_TAR)
 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
 		$(call MESSAGE,"Executing post-image script $(s)"); \
-- 
2.17.2

             reply	other threads:[~2019-07-12 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 16:10 Brent Generous [this message]
2019-08-04 14:42 ` [Buildroot] [PATCH 1/1] Makefile: add $BINARIES_DIR dependency to target-post-image target Yann E. MORIN
2019-08-05 18:07   ` Brent Generous

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190712160925.6027-1-bgenerous@impinj.com \
    --to=bgenerous@impinj.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox