Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/7] Makefile: properly create $(HOST_DIR)/usr compatibility symlink
Date: Mon, 10 Jul 2017 01:21:17 +0200	[thread overview]
Message-ID: <20170709232123.30120-2-arnout@mind.be> (raw)
In-Reply-To: <20170709232123.30120-1-arnout@mind.be>

Up to now we created the $(HOST_DIR)/usr compatibility symlink as part
of the creation of $(HOST_DIR) itself. However, when the user specifies
a custom BR2_HOST_DIR, it is possible that the directory already exists
so this rule will never trigger.

Therefore, add an explicit rule for creating $(HOST_DIR)/usr and add
this rule to the dependencies of the dirs target. HOST_DIR itself goes
back to the standard rule for directories. The order-only dependency of
STAGING_DIR isn't needed any more either: HOST_DIR is implicitly
created if needed by mkdir -p, and we don't need to trigger the
HOST_DIR rule any more if the directory already exists.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Makefile | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index a22e87f29e..188ce9adc7 100644
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,7 @@ LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
 # dependencies anywhere else
 #
 ################################################################################
-$(BUILD_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
+$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
 	@mkdir -p $@
 
 BR2_CONFIG = $(CONFIG_DIR)/.config
@@ -541,7 +541,7 @@ endif
 
 .PHONY: dirs
 dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
-	$(HOST_DIR) $(BINARIES_DIR)
+	$(HOST_DIR) $(HOST_DIR)/usr $(BINARIES_DIR)
 
 $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
 	$(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
@@ -552,13 +552,12 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
 .PHONY: world
 world: target-post-image
 
-# When creating HOST_DIR, also symlink usr -> .
-$(HOST_DIR):
-	@mkdir -p $@
-	@ln -snf . $@/usr
+# Compatibility symlink in case a post-build script still uses $(HOST_DIR)/usr
+$(HOST_DIR)/usr: $(HOST_DIR)
+	@ln -snf . $@
 
 # Populating the staging with the base directories is handled by the skeleton package
-$(STAGING_DIR): | $(HOST_DIR)
+$(STAGING_DIR):
 	@mkdir -p $(STAGING_DIR)
 	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
 
-- 
2.13.2

  reply	other threads:[~2017-07-09 23:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 23:21 [Buildroot] [PATCH 0/7] More HOST_DIR/usr fixes Arnout Vandecappelle
2017-07-09 23:21 ` Arnout Vandecappelle [this message]
2017-07-10 15:59   ` [Buildroot] [PATCH 1/7] Makefile: properly create $(HOST_DIR)/usr compatibility symlink Thomas Petazzoni
2017-07-09 23:21 ` [Buildroot] [PATCH 2/7] toolchain-wrapper: remove remaining references to HOST_DIR/usr Arnout Vandecappelle
2017-07-10 15:59   ` Thomas Petazzoni
2017-07-09 23:21 ` [Buildroot] [PATCH 3/7] support/testing: strip /usr/ part from HOST_DIR Arnout Vandecappelle
2017-07-10 15:59   ` Thomas Petazzoni
2017-07-09 23:21 ` [Buildroot] [PATCH 4/7] support/testing: move BRTest initialisation to __init__ Arnout Vandecappelle
2017-07-10 15:59   ` Thomas Petazzoni
2017-07-09 23:21 ` [Buildroot] [PATCH 5/7] support/testing: add test of BR2_CCACHE with an external toolchain Arnout Vandecappelle
2017-07-10 16:01   ` Thomas Petazzoni
2017-07-10 20:10     ` Arnout Vandecappelle
2017-07-09 23:21 ` [Buildroot] [PATCH 6/7] Makefile: add check that $(HOST_DIR)/usr is not a directory Arnout Vandecappelle
2017-07-10 16:02   ` Thomas Petazzoni
2017-07-10 16:12     ` Yann E. MORIN
2017-07-10 19:51       ` Arnout Vandecappelle
2017-07-10 20:09         ` Arnout Vandecappelle
2017-07-10 21:27         ` Thomas Petazzoni
2017-07-10 21:36           ` Arnout Vandecappelle
2017-07-10 21:43             ` Yann E. MORIN
2017-07-09 23:21 ` [Buildroot] [PATCH 7/7] toolchain-external: default BR2_TOOLCHAIN_EXTERNAL_PATH to empty Arnout Vandecappelle
2017-07-10 16:03   ` Thomas Petazzoni

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=20170709232123.30120-2-arnout@mind.be \
    --to=arnout@mind.be \
    --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