From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH next v4 3/6] Makefile: rework main directory creation logic
Date: Fri, 16 Nov 2018 15:08:39 +0100 [thread overview]
Message-ID: <20181116150839.0369b1dd@windsurf> (raw)
In-Reply-To: <20181115210946.GR10271@scaer>
Hello,
On Thu, 15 Nov 2018 22:09:46 +0100, Yann E. MORIN wrote:
> I don't think we do need anything special to create HOST_DIR,
> STAGING_DIR and TARGET_DIR:
>
> - host-skeleton is the first package to run, and that one does ensure
> the existence of $(HOST_DIR) by the mere act of creating it (which
> it cirrently does not do, but should)
>
> - skeleton is the first package to install in target/ and staging, and
> currently the skeleton-custom and skeleton-init-common should both
> create target/ and staging/
So, what you suggest is to remove the following hunks from my patch ?
@@ -238,6 +239,7 @@ $(BUILD_DIR)/%/.stamp_built::
$(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))
@@ -267,6 +269,7 @@ $(BUILD_DIR)/%/.stamp_host_installed:
$(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))
@@ -298,6 +301,7 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
# 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)
@@ -309,6 +313,7 @@ $(BUILD_DIR)/%/.stamp_images_installed:
$(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),\
Is this what you mean ?
> > +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
>
> Shouldn't we ensure that host-finalize be done before staging-finalize
> too?
Why so ?
> We would also need to ensure that packages are all installed before
> running staging-finalize.
>
> So,=maybe we need to add:
>
> staging-finalize: $(PACKAGES) host-finalize
Same, we don't really need all packages to be installed just to create
that dummy symlink.
In fact, maybe I should go one step further: STAGING_DIR is part of
HOST_DIR, so maybe I should simply create this compatibility "staging"
symlink as part of "host-finalize".
I.e:
STAGING_DIR_SYMLINK := $(BASE_DIR)/staging
$(STAGING_DIR_SYMLINK): $(BASE_DIR)
@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
host-finalize: $(HOST_DIR_SYMLINK) $(STAGING_DIR_SYMLINK
What do you think about this idea ?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-11-16 14:08 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 10:55 [Buildroot] [PATCH next v4 0/6] Per-package host/target directory support Thomas Petazzoni
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 1/6] Makefile: evaluate CCACHE and HOST{CC, CXX} at time of use Thomas Petazzoni
2018-11-15 20:49 ` Yann E. MORIN
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 2/6] support/scripts/check-host-rpath: split condition on two statements Thomas Petazzoni
2018-11-15 20:58 ` Yann E. MORIN
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 3/6] Makefile: rework main directory creation logic Thomas Petazzoni
2018-11-15 21:09 ` Yann E. MORIN
2018-11-16 14:08 ` Thomas Petazzoni [this message]
2018-11-16 1:21 ` Matthew Weber
2018-11-16 14:15 ` Thomas Petazzoni
2018-11-16 15:14 ` Thomas Petazzoni
2018-11-20 22:08 ` Matthew Weber
2018-11-27 6:24 ` Christian Stewart
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 4/6] Makefile: move .NOTPARALLEL statement after including .config file Thomas Petazzoni
2018-11-15 21:37 ` Yann E. MORIN
2018-11-16 8:53 ` Thomas Petazzoni
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 5/6] Makefile: define TARGET_DIR_WARNING_FILE relative to TARGET_DIR Thomas Petazzoni
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 6/6] core: implement per-package SDK and target Thomas Petazzoni
2018-11-15 16:41 ` Andreas Naumann
2018-11-16 13:47 ` Thomas Petazzoni
2018-11-16 15:22 ` Thomas De Schampheleire
2018-11-16 19:57 ` Yann E. MORIN
2018-11-18 21:55 ` Arnout Vandecappelle
2018-11-19 10:48 ` Thomas Petazzoni
2018-11-19 14:27 ` Andreas Naumann
2018-11-19 19:49 ` Yann E. MORIN
2018-11-20 10:22 ` Arnout Vandecappelle
2018-11-20 10:29 ` Thomas Petazzoni
2018-11-20 16:18 ` Thomas Petazzoni
2018-11-20 16:19 ` Thomas Petazzoni
2018-11-15 14:37 ` [Buildroot] [PATCH next v4 0/6] Per-package host/target directory support Thomas Petazzoni
2018-11-15 16:41 ` Andreas Naumann
2018-11-16 14:43 ` Thomas Petazzoni
2018-11-19 14:17 ` Andreas Naumann
2018-11-19 13:30 ` Arnout Vandecappelle
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=20181116150839.0369b1dd@windsurf \
--to=thomas.petazzoni@bootlin.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