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 v2 19/23] packages: replace $(PKG)_DIR with @D where possible
Date: Wed, 28 Oct 2026 14:37:40 -0700	[thread overview]
Message-ID: <20261028213744.511429-20-florian.fainelli@broadcom.com> (raw)
In-Reply-To: <20261028213744.511429-1-florian.fainelli@broadcom.com>

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Currently, packages that use $(FOO_DIR) (with FOO as the package name)
expect it to be unspecifically either the source or build directory,
with some packages even expecting that it is both. Because it currently
is both.

But when we introduce out-of-tree build and shared host-target source
trees, FOO_DIR will no longer exist, because it can no longer be both.

So, In preparation of that, replace all occurences of $(FOO_DIR) with
@(@D) which is always the dorectory that is the destination of the
current rule.

Note that in some cases, $(@D) is used as the source of a copy or a sed,
and expected to be from the source directory. This will have to be
carefully identified when source and build dirs are separated.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr:
  - reabse on master, convert new packages, drop old ones
  - add a commit log
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit a7e38cf17ada495c3abc1f9bbb377c883a9b4c5a)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 package/linux-backports/linux-backports.mk | 2 +-
 package/ncftp/ncftp.mk                     | 2 +-
 package/pciutils/pciutils.mk               | 2 +-
 package/php/php.mk                         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
index 8513a84487a8..e14cd4a1706b 100644
--- a/package/linux-backports/linux-backports.mk
+++ b/package/linux-backports/linux-backports.mk
@@ -33,7 +33,7 @@ LINUX_BACKPORTS_DEPENDENCIES = \
 	$(BR2_FLEX_HOST_DEPENDENCY)
 
 ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG),y)
-LINUX_BACKPORTS_KCONFIG_FILE = $(LINUX_BACKPORTS_DIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
+LINUX_BACKPORTS_KCONFIG_FILE = $(LINUX_BACKPORTS_SRCDIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
 else ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG),y)
 LINUX_BACKPORTS_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE))
 endif
diff --git a/package/ncftp/ncftp.mk b/package/ncftp/ncftp.mk
index 4075449c53e1..1f33270adb92 100644
--- a/package/ncftp/ncftp.mk
+++ b/package/ncftp/ncftp.mk
@@ -37,7 +37,7 @@ NCFTP_DEPENDENCIES += ncurses
 endif
 
 define NCFTP_INSTALL_TARGET_CMDS
-	$(INSTALL) -m 0755 $(addprefix $(NCFTP_DIR)/bin/, $(NCFTP_TARGET_BINS)) $(TARGET_DIR)/usr/bin
+	$(INSTALL) -m 0755 $(addprefix $(@D)/bin/, $(NCFTP_TARGET_BINS)) $(TARGET_DIR)/usr/bin
 	$(NCFTP_INSTALL_NCFTP_BATCH)
 endef
 
diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk
index ad32713d579f..52f92db78505 100644
--- a/package/pciutils/pciutils.mk
+++ b/package/pciutils/pciutils.mk
@@ -46,7 +46,7 @@ PCIUTILS_MAKE_OPTS += SHARED=yes
 endif
 
 define PCIUTILS_CONFIGURE_CMDS
-	$(SED) 's/wget --no-timestamping/wget/' $(PCIUTILS_DIR)/update-pciids.sh
+	$(SED) 's/wget --no-timestamping/wget/' $(@D)/update-pciids.sh
 endef
 
 define PCIUTILS_BUILD_CMDS
diff --git a/package/php/php.mk b/package/php/php.mk
index 1bb25d086370..1dd979d7a2a4 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -343,7 +343,7 @@ PHP_POST_INSTALL_TARGET_HOOKS += PHP_EXTENSIONS_FIXUP
 define PHP_INSTALL_FIXUP
 	rm -rf $(TARGET_DIR)/usr/lib/php/build
 	rm -f $(TARGET_DIR)/usr/bin/phpize
-	$(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
+	$(INSTALL) -D -m 0755 $(@D)/php.ini-production \
 		$(TARGET_DIR)/etc/php.ini
 	$(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
 		$(TARGET_DIR)/etc/php.ini
-- 
2.34.1

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

  parent reply	other threads:[~2026-10-28 21:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 21:37 [Buildroot] [PATCH v2 00/23] Support building the Linux kernel out of tree Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 01/23] package: prepare removal of <pkg>_DIR Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 02/23] infra: introduce a global SRC_DIR variable Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 03/23] package: fix <pkg>_SRCDIR and <pkg>_BUILDDIR values Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 04/23] boot/boot-wrapper-aarch64: needs LINUX_BUILDDIR Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 05/23] boot/mxs-bootlets: needs (BAREBOX, LINUX, UBOOT)_BUILDDIR Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 06/23] linux/extensions: point to proper _SRCDIR and @D Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 07/23] linux/linux: LINUX_VERSION_PROBED should run from build directory Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 08/23] package: use <pkg>_SRCSUBDIR where <pkg>_SRCDIR used to include _SUBDIR Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 09/23] linux: build out of tree Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 10/23] packages: sync host and target patch hooks Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 11/23] omniorb: avoid target-only patch hook Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 12/23] lua: rework post-patch hook usage Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 13/23] infra: host packages inherit the target extra downloads Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 14/23] package/libtool: use post-patch hooks Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 15/23] package/libtool: also apply libtool-patch to host libtool Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 16/23] package/{ffmpeg, libvpx}: use $(@D) instead of $(pkg_SRCDIR) when possible Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 17/23] package/perl: apply the perl-cross even for the host variant Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 18/23] infra/autotools: warn for package that autoreconf without libtool patch Florian Fainelli via buildroot
2026-10-28 21:37 ` Florian Fainelli via buildroot [this message]
2026-10-28 21:37 ` [Buildroot] [PATCH v2 20/23] linux: support custom logo and devicetree files in out-of-tree builds Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 21/23] package/linux-tools: support an out-of-tree kernel build Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 22/23] package: read kernel headers from LINUX_SRCDIR Florian Fainelli via buildroot
2026-10-28 21:37 ` [Buildroot] [PATCH v2 23/23] docs/manual: document out-of-tree package builds and the new srcdir variables Florian Fainelli 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=20261028213744.511429-20-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