Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Eric Le Bihan" <eric.le.bihan.dev@free.fr>,
	"Jérôme Pouiller" <jezz@sysmic.org>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Gary Bisson" <bisson.gary@gmail.com>,
	"Romain Naour" <romain.naour@gmail.com>,
	"Bernd Kuhls" <bernd@kuhls.net>,
	"Thomas Perale" <thomas.perale@mind.be>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	"Refik Tuzakli" <tuzakli.refik@gmail.com>,
	"Francois Perrad" <francois.perrad.86@gmail.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Arnout Vandecappelle" <arnout@rnout.be>,
	"Petr Vorel" <petr.vorel@gmail.com>,
	"Spenser Gilliland" <spenser@gillilanding.com>,
	"Giulio Benetti" <giulio.benetti@benettiengineering.com>,
	"Pascal de Bruijn" <p.debruijn@unilogic.nl>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Yann E. MORIN" <yann.morin.1998@free.fr>,
	"Mahyar Koshkouei" <mahyar.koshkouei@gmail.com>
Subject: [Buildroot] [PATCH 01/23] package: prepare removal of <pkg>_DIR
Date: Fri, 23 Oct 2026 14:47:45 -0700	[thread overview]
Message-ID: <20261023214807.2151753-2-florian.fainelli@broadcom.com> (raw)
In-Reply-To: <20261023214807.2151753-1-florian.fainelli@broadcom.com>

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

As part of the out-of-tree mechanism introduction, we want to get rid
of the <pkg>_DIR variable, because it isn't clear whether it refers to
the source or build directory.

Therefore, we modify the package infrastructure to no longer use
<pkg>_DIR, but instead use <pkg>_SRCDIR or <pkg>_BUILDDIR where
appropriate.

Since some of the build steps now have their stamp files in the package
source directory, we also adjust the corresponding make rules.

There is one single stamp we take special care of: the dirclean one.
This stamp file is never created; it only serves to have a correct $(@D)
to be able to remove the package directory. What is really important in
fact is to remove the build directory, so that's where we move it into.

Note that at this point, $(BUILD_DIR) and $(SRC_DIR) still point to the
same directory, so this commit is really a no-op.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr:
  - rebase on master
  - change the location of the dirclean stamp
  - expand commit log accordingly
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit a1048c500d134df5ba3d92be463e190ce7768274)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 package/pkg-generic.mk | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 4e2ce2e7a09a..fe5200475504 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -171,7 +171,7 @@ endef
 ################################################################################
 
 # Retrieve the archive
-$(BUILD_DIR)/%/.stamp_downloaded:
+$(SRC_DIR)/%/.stamp_downloaded:
 	@$(call step_start,download)
 	$(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES))
 	$(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
@@ -196,7 +196,7 @@ $(BUILD_DIR)/%/.stamp_downloaded:
 	$(Q)touch $@
 
 # Retrieve actual source archive, e.g. for prebuilt external toolchains
-$(BUILD_DIR)/%/.stamp_actual_downloaded:
+$(SRC_DIR)/%/.stamp_actual_downloaded:
 	@$(call step_start,actual-download)
 	$(call DOWNLOAD,$($(PKG)_ACTUAL_SOURCE_SITE)/$($(PKG)_ACTUAL_SOURCE_TARBALL))
 	$(Q)mkdir -p $(@D)
@@ -204,7 +204,7 @@ $(BUILD_DIR)/%/.stamp_actual_downloaded:
 	$(Q)touch $@
 
 # Unpack the archive
-$(BUILD_DIR)/%/.stamp_extracted:
+$(SRC_DIR)/%/.stamp_extracted:
 	@$(call step_start,extract)
 	@$(call MESSAGE,"Extracting")
 	$(call prepare-per-package-directory,$($(PKG)_FINAL_EXTRACT_DEPENDENCIES))
@@ -219,7 +219,7 @@ $(BUILD_DIR)/%/.stamp_extracted:
 
 # Rsync the source directory if the <pkg>_OVERRIDE_SRCDIR feature is
 # used.
-$(BUILD_DIR)/%/.stamp_rsynced:
+$(SRC_DIR)/%/.stamp_rsynced:
 	@$(call step_start,rsync)
 	@$(call MESSAGE,"Syncing from source dir $(SRCDIR)")
 	@mkdir -p $(@D)
@@ -231,7 +231,7 @@ $(BUILD_DIR)/%/.stamp_rsynced:
 	$(Q)touch $@
 
 # Patch
-$(BUILD_DIR)/%/.stamp_patched:
+$(SRC_DIR)/%/.stamp_patched:
 	@$(call step_start,patch)
 	@$(call MESSAGE,"Patching")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
@@ -836,19 +836,19 @@ $(2)_FINAL_RECURSIVE_RDEPENDENCIES = $$(sort \
 	$$($(2)_FINAL_RECURSIVE_RDEPENDENCIES__X))
 
 # define sub-target stamps
-$(2)_TARGET_INSTALL =           $$($(2)_DIR)/.stamp_installed
-$(2)_TARGET_INSTALL_TARGET =	$$($(2)_DIR)/.stamp_target_installed
-$(2)_TARGET_INSTALL_STAGING =	$$($(2)_DIR)/.stamp_staging_installed
-$(2)_TARGET_INSTALL_IMAGES =	$$($(2)_DIR)/.stamp_images_installed
-$(2)_TARGET_INSTALL_HOST =	$$($(2)_DIR)/.stamp_host_installed
-$(2)_TARGET_BUILD =		$$($(2)_DIR)/.stamp_built
-$(2)_TARGET_CONFIGURE =		$$($(2)_DIR)/.stamp_configured
-$(2)_TARGET_RSYNC =		$$($(2)_DIR)/.stamp_rsynced
-$(2)_TARGET_PATCH =		$$($(2)_DIR)/.stamp_patched
-$(2)_TARGET_EXTRACT =		$$($(2)_DIR)/.stamp_extracted
-$(2)_TARGET_SOURCE =		$$($(2)_DIR)/.stamp_downloaded
-$(2)_TARGET_ACTUAL_SOURCE =	$$($(2)_DIR)/.stamp_actual_downloaded
-$(2)_TARGET_DIRCLEAN =		$$($(2)_DIR)/.stamp_dircleaned
+$(2)_TARGET_INSTALL =           $$($(2)_BUILDDIR)/.stamp_installed
+$(2)_TARGET_INSTALL_TARGET =	$$($(2)_BUILDDIR)/.stamp_target_installed
+$(2)_TARGET_INSTALL_STAGING =	$$($(2)_BUILDDIR)/.stamp_staging_installed
+$(2)_TARGET_INSTALL_IMAGES =	$$($(2)_BUILDDIR)/.stamp_images_installed
+$(2)_TARGET_INSTALL_HOST =	$$($(2)_BUILDDIR)/.stamp_host_installed
+$(2)_TARGET_BUILD =		$$($(2)_BUILDDIR)/.stamp_built
+$(2)_TARGET_CONFIGURE =		$$($(2)_BUILDDIR)/.stamp_configured
+$(2)_TARGET_RSYNC =		$$($(2)_SRCDIR)/.stamp_rsynced
+$(2)_TARGET_PATCH =		$$($(2)_SRCDIR)/.stamp_patched
+$(2)_TARGET_EXTRACT =		$$($(2)_SRCDIR)/.stamp_extracted
+$(2)_TARGET_SOURCE =		$$($(2)_SRCDIR)/.stamp_downloaded
+$(2)_TARGET_ACTUAL_SOURCE =	$$($(2)_SRCDIR)/.stamp_actual_downloaded
+$(2)_TARGET_DIRCLEAN =		$$($(2)_BUILDDIR)/.stamp_dircleaned
 
 # default extract command
 $(2)_EXTRACT_CMDS ?= \
@@ -1176,7 +1176,7 @@ else
 			$$$${f} \
 			$$($(2)_REDIST_SOURCES_DIR) || exit 1; \
 		printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \
-	done <$$($(2)_DIR)/.applied_patches_list
+	done <$$($(2)_SRCDIR)/.applied_patches_list
 endif # other packages
 
 endif # redistribute
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-10-23 21:48 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 21:47 [Buildroot] [PATCH 00/23] Support building the Linux kernel out of tree with LINUX_OVERRIDE_SRCDIR Florian Fainelli via buildroot
2026-10-23 21:47 ` Florian Fainelli via buildroot [this message]
2026-10-23 21:47 ` [Buildroot] [PATCH 02/23] infra: introduce a global SRC_DIR variable Florian Fainelli via buildroot
2026-10-23 21:47 ` [Buildroot] [PATCH 03/23] package: fix <pkg>_SRCDIR and <pkg>_BUILDDIR values Florian Fainelli via buildroot
2026-10-23 21:47 ` [Buildroot] [PATCH 04/23] boot/boot-wrapper-aarch64: needs LINUX_BUILDDIR Florian Fainelli via buildroot
2026-10-23 21:47 ` [Buildroot] [PATCH 05/23] boot/mxs-bootlets: needs (BAREBOX, LINUX, UBOOT)_BUILDDIR Florian Fainelli via buildroot
2026-10-23 21:47 ` [Buildroot] [PATCH 06/23] linux/extensions: point to proper _SRCDIR and @D Florian Fainelli via buildroot
2026-10-23 21:47 ` [Buildroot] [PATCH 07/23] linux/linux: LINUX_VERSION_PROBED should run from build directory Florian Fainelli via buildroot
2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 08/23] package: use <pkg>_SRCSUBDIR where <pkg>_SRCDIR used to include _SUBDIR Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 09/23] linux: build out of tree when LINUX_OVERRIDE_SRCDIR is set Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 10/23] packages: sync host and target patch hooks Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 11/23] omniorb: avoid target-only patch hook Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 12/23] lua: rework post-patch hook usage Florian Fainelli via buildroot
2026-10-24 10:46     ` François PERRAD
2026-10-27 16:43       ` Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 13/23] infra: host packages inherit the target extra downloads Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 14/23] package/libtool: use post-patch hooks Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 15/23] package/libtool: also apply libtool-patch to host libtool Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 16/23] package/{ffmpeg, libvpx}: use $(@D) instead of $(pkg_SRCDIR) when possible Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 17/23] package/perl: apply the perl-cross even for the host variant Florian Fainelli via buildroot
2026-10-24 10:20     ` François PERRAD
2026-10-27 16:44       ` Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 18/23] infra/autotools: warn for package that autoreconf without libtool patch Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 19/23] packages: replace $(PKG)_DIR with @D where possible Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 20/23] linux: support custom logo and devicetree files in out-of-tree builds Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 21/23] package/linux-tools: support an out-of-tree kernel build Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 22/23] package: read kernel headers from LINUX_SRCDIR Florian Fainelli via buildroot
2026-10-23 21:51   ` [Buildroot] [PATCH 23/23] docs/manual: document out-of-tree package builds and the new srcdir variables Florian Fainelli via buildroot
2026-10-24 20:44 ` [Buildroot] [PATCH 00/23] Support building the Linux kernel out of tree with LINUX_OVERRIDE_SRCDIR Thomas Petazzoni via buildroot
2026-10-26 21:49   ` Florian Fainelli via buildroot
2026-10-27  8:14     ` Arnout Vandecappelle via buildroot
2026-10-27  8:26       ` Thomas Petazzoni via buildroot
2026-10-27  8:43         ` Arnout Vandecappelle via buildroot
2026-10-27 12:41           ` Thomas Petazzoni via buildroot
2026-10-27 12:44     ` Thomas Petazzoni via buildroot
2026-10-27 13:53       ` Arnout Vandecappelle via buildroot
2026-10-27 16:53         ` Florian Fainelli via buildroot
2026-10-27 19:22           ` Thomas Petazzoni via buildroot
2026-10-27 19:56             ` Florian Fainelli via buildroot
2026-10-28 18:16               ` Thomas Petazzoni via buildroot
2026-10-28 18:35                 ` Florian Fainelli via buildroot
2026-10-28 19:26                   ` Thomas Petazzoni via buildroot
2026-10-27 20:32             ` Fiona Klute via buildroot
2026-10-28 18:18               ` Thomas Petazzoni via buildroot
2026-10-28 18:34                 ` Florian Fainelli via buildroot
2026-10-28 19:26                   ` Thomas Petazzoni via buildroot

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=20261023214807.2151753-2-florian.fainelli@broadcom.com \
    --to=buildroot@buildroot.org \
    --cc=arnout@rnout.be \
    --cc=bernd@kuhls.net \
    --cc=bisson.gary@gmail.com \
    --cc=eric.le.bihan.dev@free.fr \
    --cc=florian.fainelli@broadcom.com \
    --cc=francois.perrad.86@gmail.com \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=jezz@sysmic.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mahyar.koshkouei@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=p.debruijn@unilogic.nl \
    --cc=petr.vorel@gmail.com \
    --cc=romain.naour@gmail.com \
    --cc=spenser@gillilanding.com \
    --cc=thomas.perale@mind.be \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tuzakli.refik@gmail.com \
    --cc=yann.morin.1998@free.fr \
    /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