* [Buildroot] [PATCH 0 of 4 v2] infra: remove FOO_DIR_PREFIX, 4th param of pkg infras, pkgparentdir
@ 2014-02-04 16:21 Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX Thomas De Schampheleire
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-02-04 16:21 UTC (permalink / raw)
To: buildroot
This patch series removes a number of unused variables and helper functions.
It is a v2 of patch http://patchwork.ozlabs.org/patch/290254/
('infra: remove usage of pkgparentdir in favor of pkgdir') but simplifies
the code even more, after discussion on the Buildroot Developer Days at
FOSDEM 2014.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
package/pkg-autotools.mk | 13 ++++++-------
package/pkg-cmake.mk | 13 ++++++-------
package/pkg-generic.mk | 29 ++++++++++++++---------------
package/pkg-luarocks.mk | 7 +++----
package/pkg-python.mk | 17 ++++++++---------
package/pkg-utils.mk | 1 -
6 files changed, 37 insertions(+), 43 deletions(-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX
2014-02-04 16:21 [Buildroot] [PATCH 0 of 4 v2] infra: remove FOO_DIR_PREFIX, 4th param of pkg infras, pkgparentdir Thomas De Schampheleire
@ 2014-02-04 16:21 ` Thomas De Schampheleire
2014-02-04 17:55 ` Arnout Vandecappelle
2014-02-04 20:02 ` Yann E. MORIN
2014-02-04 16:21 ` [Buildroot] [PATCH 2 of 4 v2] infra: remove usage of 4th parameter to inner-generic-package Thomas De Schampheleire
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-02-04 16:21 UTC (permalink / raw)
To: buildroot
Variable FOO_DIR_PREFIX in inner-generic-package isn't really needed. The
contents of this variable are 'package' for normal packages, 'boot' for
bootloaders, and 'linux' for the linux kernel.
When patching a package, all you need to know is the directory where
patches can reside, which is already returned by $(pkgdir). In order to be
able to use this variable outside of inner-generic-package, we introduce a
target-specific variable PKGDIR that equals to this $(pkgdir).
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
package/pkg-generic.mk | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -137,7 +137,7 @@ endif
#
# For BR2_GLOBAL_PATCH_DIR, only generate if it is defined
$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
-$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME)
+$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $(PKGDIR)
$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))
$(BUILD_DIR)/%/.stamp_patched:
@$(call step_start,patch)
@@ -358,7 +358,6 @@ endif
$(2)_INSTALL_STAGING ?= NO
$(2)_INSTALL_IMAGES ?= NO
$(2)_INSTALL_TARGET ?= YES
-$(2)_DIR_PREFIX = $(4)
# define sub-target stamps
$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed
@@ -507,6 +506,7 @@ endif
$$($(2)_TARGET_RSYNC_SOURCE): PKG=$(2)
$$($(2)_TARGET_PATCH): PKG=$(2)
$$($(2)_TARGET_PATCH): RAWNAME=$(patsubst host-%,%,$(1))
+$$($(2)_TARGET_PATCH): PKGDIR=$(call pkgdir)
$$($(2)_TARGET_EXTRACT): PKG=$(2)
$$($(2)_TARGET_SOURCE): PKG=$(2)
$$($(2)_TARGET_DIRCLEAN): PKG=$(2)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2 of 4 v2] infra: remove usage of 4th parameter to inner-generic-package
2014-02-04 16:21 [Buildroot] [PATCH 0 of 4 v2] infra: remove FOO_DIR_PREFIX, 4th param of pkg infras, pkgparentdir Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX Thomas De Schampheleire
@ 2014-02-04 16:21 ` Thomas De Schampheleire
2014-02-04 17:46 ` Arnout Vandecappelle
2014-02-04 16:21 ` [Buildroot] [PATCH 3 of 4 v2] infra: remove unused 4th parameter to package infrastructures (pkgparentdir) Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 4 of 4 v2] infra: remove unused helper function pkgparentdir Thomas De Schampheleire
3 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-02-04 16:21 UTC (permalink / raw)
To: buildroot
In preparation of the removal of the 4th parameter to inner-generic-package
and the pkgparentdir helper function, this patch removes the direct usage of
this 4th parameter. The remaining usage
ifeq ($(4),boot/)
can become
$(filter boot/%,$(call pkgdir))
instead (and similar for toolchain).
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
package/pkg-generic.mk | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -516,9 +516,9 @@ endif
# kernel case, the bootloaders case, and the normal packages case.
ifeq ($(1),linux)
$(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
-else ifeq ($(4),boot/)
+else ifneq ($(filter boot/%,$(call pkgdir)),)
$(2)_KCONFIG_VAR = BR2_TARGET_$(2)
-else ifeq ($(4),toolchain/)
+else ifneq ($(filter toolchain/%,$(call pkgdir)),)
$(2)_KCONFIG_VAR = BR2_$(2)
else
$(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 3 of 4 v2] infra: remove unused 4th parameter to package infrastructures (pkgparentdir)
2014-02-04 16:21 [Buildroot] [PATCH 0 of 4 v2] infra: remove FOO_DIR_PREFIX, 4th param of pkg infras, pkgparentdir Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 2 of 4 v2] infra: remove usage of 4th parameter to inner-generic-package Thomas De Schampheleire
@ 2014-02-04 16:21 ` Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 4 of 4 v2] infra: remove unused helper function pkgparentdir Thomas De Schampheleire
3 siblings, 0 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-02-04 16:21 UTC (permalink / raw)
To: buildroot
The fourth parameter to inner-generic-package is no longer used. Removing
this parameters requires renaming all usages of $(5) to $(4), and updating
the calls to inner-generic-package (and equivalent for the other package
infrastructures).
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
package/pkg-autotools.mk | 13 ++++++-------
package/pkg-cmake.mk | 13 ++++++-------
package/pkg-generic.mk | 21 ++++++++++-----------
package/pkg-luarocks.mk | 7 +++----
package/pkg-python.mk | 17 ++++++++---------
5 files changed, 33 insertions(+), 38 deletions(-)
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -48,8 +48,7 @@ endef
# for host packages
# argument 3 is the uppercase package name, without the HOST_ prefix
# for host packages
-# argument 4 is the package directory prefix
-# argument 5 is the type (target or host)
+# argument 4 is the type (target or host)
################################################################################
define inner-autotools-package
@@ -94,7 +93,7 @@ endif
# packages.
#
ifndef $(2)_CONFIGURE_CMDS
-ifeq ($(5),target)
+ifeq ($(4),target)
# Configure package for target
define $(2)_CONFIGURE_CMDS
@@ -220,7 +219,7 @@ endif
# file.
#
ifndef $(2)_BUILD_CMDS
-ifeq ($(5),target)
+ifeq ($(4),target)
define $(2)_BUILD_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPT) -C $$($$(PKG)_SRCDIR)
endef
@@ -267,7 +266,7 @@ endif
# Call the generic package infrastructure to generate the necessary
# make targets
-$(call inner-generic-package,$(1),$(2),$(3),$(4),$(5))
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
endef
@@ -275,5 +274,5 @@ endef
# autotools-package -- the target generator macro for autotools packages
################################################################################
-autotools-package = $(call inner-autotools-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
-host-autotools-package = $(call inner-autotools-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
+autotools-package = $(call inner-autotools-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),target)
+host-autotools-package = $(call inner-autotools-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),host)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -31,8 +31,7 @@
# for host packages
# argument 3 is the uppercase package name, without the HOST_ prefix
# for host packages
-# argument 4 is the package directory prefix
-# argument 5 is the type (target or host)
+# argument 4 is the type (target or host)
################################################################################
define inner-cmake-package
@@ -55,7 +54,7 @@ define inner-cmake-package
# packages.
#
ifndef $(2)_CONFIGURE_CMDS
-ifeq ($(5),target)
+ifeq ($(4),target)
# Configure package for target
define $(2)_CONFIGURE_CMDS
@@ -99,7 +98,7 @@ endif
# file.
#
ifndef $(2)_BUILD_CMDS
-ifeq ($(5),target)
+ifeq ($(4),target)
define $(2)_BUILD_CMDS
$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPT) -C $$($$(PKG)_BUILDDIR)
endef
@@ -142,7 +141,7 @@ endif
# Call the generic package infrastructure to generate the necessary
# make targets
-$(call inner-generic-package,$(1),$(2),$(3),$(4),$(5))
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
endef
@@ -150,8 +149,8 @@ endef
# cmake-package -- the target generator macro for CMake packages
################################################################################
-cmake-package = $(call inner-cmake-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
-host-cmake-package = $(call inner-cmake-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
+cmake-package = $(call inner-cmake-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),target)
+host-cmake-package = $(call inner-cmake-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),host)
################################################################################
# Generation of the CMake toolchain file
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -241,8 +241,7 @@ endif
# for host packages
# argument 3 is the uppercase package name, without the HOST_ prefix
# for host packages
-# argument 4 is the package directory prefix
-# argument 5 is the type (target or host)
+# argument 4 is the type (target or host)
################################################################################
define inner-generic-package
@@ -254,7 +253,7 @@ define inner-generic-package
# these informations have only to be specified once, for both the
# target and host packages of a given .mk file.
-$(2)_TYPE = $(5)
+$(2)_TYPE = $(4)
$(2)_NAME = $(1)
$(2)_RAWNAME = $(patsubst host-%,%,$(1))
@@ -534,7 +533,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
ifneq ($$($(2)_SITE_METHOD),local)
ifneq ($$($(2)_SITE_METHOD),override)
# Packages that have a tarball need it downloaded and extracted beforehand
-$(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5)))
+$(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(4)))
$(2)_MANIFEST_TARBALL = $$($(2)_SOURCE)
endif
endif
@@ -558,23 +557,23 @@ else
# Save license files if defined
ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),)
- @$(call legal-license-nofiles,$$($(2)_RAWNAME),$(call UPPERCASE,$(5)))
+ @$(call legal-license-nofiles,$$($(2)_RAWNAME),$(call UPPERCASE,$(4)))
@$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
else
# Double dollar signs are really needed here, to catch host packages
# without explicit HOST_FOO_LICENSE_FILES assignment, also in case they
# have multiple license files.
- @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F),$(call UPPERCASE,$(5)))$$(sep))
+ @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F),$(call UPPERCASE,$(4)))$$(sep))
endif # license files
ifeq ($$($(2)_REDISTRIBUTE),YES)
# Copy the source tarball (just hardlink if possible)
- @cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5))) 2>/dev/null || \
- cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5)))
+ @cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(4))) 2>/dev/null || \
+ cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(4)))
endif # redistribute
endif # other packages
- @$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL),$(call UPPERCASE,$(5)))
+ @$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL),$(call UPPERCASE,$(4)))
endif # ifneq ($(call qstrip,$$($(2)_SOURCE)),)
$(foreach hook,$($(2)_POST_LEGAL_INFO_HOOKS),$(call $(hook))$(sep))
@@ -617,8 +616,8 @@ endef # inner-generic-package
################################################################################
# In the case of target packages, keep the package name "pkg"
-generic-package = $(call inner-generic-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
+generic-package = $(call inner-generic-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),target)
# In the case of host packages, turn the package name "pkg" into "host-pkg"
-host-generic-package = $(call inner-generic-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
+host-generic-package = $(call inner-generic-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),host)
# :mode=makefile:
diff --git a/package/pkg-luarocks.mk b/package/pkg-luarocks.mk
--- a/package/pkg-luarocks.mk
+++ b/package/pkg-luarocks.mk
@@ -28,8 +28,7 @@
# for host packages
# argument 3 is the uppercase package name, without the HOST_ prefix
# for host packages
-# argument 4 is the package directory prefix
-# argument 5 is the type (target or host)
+# argument 4 is the type (target or host)
################################################################################
define inner-luarocks-package
@@ -70,7 +69,7 @@ endif
# Call the generic package infrastructure to generate the necessary
# make targets
-$(call inner-generic-package,$(1),$(2),$(3),$(4),$(5))
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
endef
@@ -78,5 +77,5 @@ endef
# luarocks-package -- the target generator macro for LuaRocks packages
################################################################################
-luarocks-package = $(call inner-luarocks-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
+luarocks-package = $(call inner-luarocks-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),target)
# host-luarocks-package not supported
diff --git a/package/pkg-python.mk b/package/pkg-python.mk
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -80,8 +80,7 @@ HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT =
# for host packages
# argument 3 is the uppercase package name, without the HOST_ prefix
# for host packages
-# argument 4 is the package directory prefix
-# argument 5 is the type (target or host)
+# argument 4 is the type (target or host)
################################################################################
define inner-python-package
@@ -103,7 +102,7 @@ endif
# Distutils
ifeq ($$($(2)_SETUP_TYPE),distutils)
-ifeq ($(5),target)
+ifeq ($(4),target)
$(2)_BASE_ENV = $$(PKG_PYTHON_DISTUTILS_ENV)
$(2)_BASE_BUILD_TGT = build
$(2)_BASE_BUILD_OPT = $$(PKG_PYTHON_DISTUTILS_BUILD_OPT)
@@ -116,7 +115,7 @@ else
endif
# Setuptools
else ifeq ($$($(2)_SETUP_TYPE),setuptools)
-ifeq ($(5),target)
+ifeq ($(4),target)
$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
$(2)_BASE_BUILD_TGT = build -x
$(2)_BASE_BUILD_OPT =
@@ -149,7 +148,7 @@ endif
# runtime) and the python interpreter on the host (for
# compilation). However, host packages only need the python
# interpreter on the host.
-ifeq ($(5),target)
+ifeq ($(4),target)
$(2)_DEPENDENCIES += host-python python
else
$(2)_DEPENDENCIES += host-python
@@ -164,7 +163,7 @@ endif
ifeq ($$($(2)_SETUP_TYPE),setuptools)
ifneq ($(2),HOST_PYTHON_SETUPTOOLS)
$(2)_DEPENDENCIES += host-python-setuptools
-ifeq ($(5),target)
+ifeq ($(4),target)
$(2)_DEPENDENCIES += host-python-distutilscross
endif
endif
@@ -212,7 +211,7 @@ endif
# Call the generic package infrastructure to generate the necessary
# make targets
-$(call inner-generic-package,$(1),$(2),$(3),$(4),$(5))
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
endef
@@ -220,5 +219,5 @@ endef
# python-package -- the target generator macro for Python packages
################################################################################
-python-package = $(call inner-python-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
-host-python-package = $(call inner-python-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
+python-package = $(call inner-python-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),target)
+host-python-package = $(call inner-python-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),host)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 4 of 4 v2] infra: remove unused helper function pkgparentdir
2014-02-04 16:21 [Buildroot] [PATCH 0 of 4 v2] infra: remove FOO_DIR_PREFIX, 4th param of pkg infras, pkgparentdir Thomas De Schampheleire
` (2 preceding siblings ...)
2014-02-04 16:21 ` [Buildroot] [PATCH 3 of 4 v2] infra: remove unused 4th parameter to package infrastructures (pkgparentdir) Thomas De Schampheleire
@ 2014-02-04 16:21 ` Thomas De Schampheleire
2014-02-04 17:55 ` Arnout Vandecappelle
3 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-02-04 16:21 UTC (permalink / raw)
To: buildroot
Thanks to the previous patches, no-one is using pkgparentdir anymore, so
remove it.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
package/pkg-utils.mk | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -60,7 +60,6 @@ endef
# package, for which the package directory is an empty string.
pkgdir = $(dir $(lastword $(MAKEFILE_LIST)))
pkgname = $(lastword $(subst /, ,$(call pkgdir)))
-pkgparentdir = $(patsubst %$(call pkgname)/,%,$(call pkgdir))
# Define extractors for different archive suffixes
INFLATE.bz2 = $(BZCAT)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2 of 4 v2] infra: remove usage of 4th parameter to inner-generic-package
2014-02-04 16:21 ` [Buildroot] [PATCH 2 of 4 v2] infra: remove usage of 4th parameter to inner-generic-package Thomas De Schampheleire
@ 2014-02-04 17:46 ` Arnout Vandecappelle
0 siblings, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2014-02-04 17:46 UTC (permalink / raw)
To: buildroot
On 04/02/14 17:21, Thomas De Schampheleire wrote:
> In preparation of the removal of the 4th parameter to inner-generic-package
> and the pkgparentdir helper function, this patch removes the direct usage of
> this 4th parameter. The remaining usage
> ifeq ($(4),boot/)
> can become
> $(filter boot/%,$(call pkgdir))
> instead (and similar for toolchain).
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
> package/pkg-generic.mk | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -516,9 +516,9 @@ endif
> # kernel case, the bootloaders case, and the normal packages case.
> ifeq ($(1),linux)
> $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
> -else ifeq ($(4),boot/)
> +else ifneq ($(filter boot/%,$(call pkgdir)),)
AFAICS the call is redundant here.
Yes, I know it's there in the pkgname definition, but there's no need to
repeate past mistakes :-)
(The call construct is only needed for macros that take arguments. It's
another example of make insanity...)
Regards,
Arnout
> $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
> -else ifeq ($(4),toolchain/)
> +else ifneq ($(filter toolchain/%,$(call pkgdir)),)
> $(2)_KCONFIG_VAR = BR2_$(2)
> else
> $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 4 of 4 v2] infra: remove unused helper function pkgparentdir
2014-02-04 16:21 ` [Buildroot] [PATCH 4 of 4 v2] infra: remove unused helper function pkgparentdir Thomas De Schampheleire
@ 2014-02-04 17:55 ` Arnout Vandecappelle
0 siblings, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2014-02-04 17:55 UTC (permalink / raw)
To: buildroot
On 04/02/14 17:21, Thomas De Schampheleire wrote:
> Thanks to the previous patches, no-one is using pkgparentdir anymore, so
> remove it.
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
> package/pkg-utils.mk | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -60,7 +60,6 @@ endef
> # package, for which the package directory is an empty string.
> pkgdir = $(dir $(lastword $(MAKEFILE_LIST)))
> pkgname = $(lastword $(subst /, ,$(call pkgdir)))
> -pkgparentdir = $(patsubst %$(call pkgname)/,%,$(call pkgdir))
The comment above mentions pkgdir but that should actually have been
pkgparentdir (it's the reason that pkgparentdir uses patsubst instead of
the usual $(dir ...)). Basically, the last sentence of the comment can be
removed.
Regards,
Arnout
>
> # Define extractors for different archive suffixes
> INFLATE.bz2 = $(BZCAT)
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX
2014-02-04 16:21 ` [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX Thomas De Schampheleire
@ 2014-02-04 17:55 ` Arnout Vandecappelle
2014-02-04 20:02 ` Yann E. MORIN
1 sibling, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2014-02-04 17:55 UTC (permalink / raw)
To: buildroot
On 04/02/14 17:21, Thomas De Schampheleire wrote:
> Variable FOO_DIR_PREFIX in inner-generic-package isn't really needed. The
> contents of this variable are 'package' for normal packages, 'boot' for
> bootloaders, and 'linux' for the linux kernel.
> When patching a package, all you need to know is the directory where
> patches can reside, which is already returned by $(pkgdir). In order to be
> able to use this variable outside of inner-generic-package, we introduce a
> target-specific variable PKGDIR that equals to this $(pkgdir).
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(untested)
>
> ---
> package/pkg-generic.mk | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -137,7 +137,7 @@ endif
> #
> # For BR2_GLOBAL_PATCH_DIR, only generate if it is defined
> $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
> -$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME)
> +$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $(PKGDIR)
> $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))
> $(BUILD_DIR)/%/.stamp_patched:
> @$(call step_start,patch)
> @@ -358,7 +358,6 @@ endif
> $(2)_INSTALL_STAGING ?= NO
> $(2)_INSTALL_IMAGES ?= NO
> $(2)_INSTALL_TARGET ?= YES
> -$(2)_DIR_PREFIX = $(4)
>
> # define sub-target stamps
> $(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed
> @@ -507,6 +506,7 @@ endif
> $$($(2)_TARGET_RSYNC_SOURCE): PKG=$(2)
> $$($(2)_TARGET_PATCH): PKG=$(2)
> $$($(2)_TARGET_PATCH): RAWNAME=$(patsubst host-%,%,$(1))
> +$$($(2)_TARGET_PATCH): PKGDIR=$(call pkgdir)
> $$($(2)_TARGET_EXTRACT): PKG=$(2)
> $$($(2)_TARGET_SOURCE): PKG=$(2)
> $$($(2)_TARGET_DIRCLEAN): PKG=$(2)
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX
2014-02-04 16:21 ` [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX Thomas De Schampheleire
2014-02-04 17:55 ` Arnout Vandecappelle
@ 2014-02-04 20:02 ` Yann E. MORIN
1 sibling, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2014-02-04 20:02 UTC (permalink / raw)
To: buildroot
Maxime, All,
On 2014-02-04 17:21 +0100, Thomas De Schampheleire spake thusly:
> Variable FOO_DIR_PREFIX in inner-generic-package isn't really needed. The
> contents of this variable are 'package' for normal packages, 'boot' for
> bootloaders, and 'linux' for the linux kernel.
> When patching a package, all you need to know is the directory where
> patches can reside, which is already returned by $(pkgdir). In order to be
> able to use this variable outside of inner-generic-package, we introduce a
> target-specific variable PKGDIR that equals to this $(pkgdir).
Maxime, I guess that's the variable we needed, and were desparately
looking for in the tree, when hacking spidermonkey during our wayback
trip from Brussels! :-)
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-02-04 20:02 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-04 16:21 [Buildroot] [PATCH 0 of 4 v2] infra: remove FOO_DIR_PREFIX, 4th param of pkg infras, pkgparentdir Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 1 of 4 v2] infra: remove variable FOO_DIR_PREFIX Thomas De Schampheleire
2014-02-04 17:55 ` Arnout Vandecappelle
2014-02-04 20:02 ` Yann E. MORIN
2014-02-04 16:21 ` [Buildroot] [PATCH 2 of 4 v2] infra: remove usage of 4th parameter to inner-generic-package Thomas De Schampheleire
2014-02-04 17:46 ` Arnout Vandecappelle
2014-02-04 16:21 ` [Buildroot] [PATCH 3 of 4 v2] infra: remove unused 4th parameter to package infrastructures (pkgparentdir) Thomas De Schampheleire
2014-02-04 16:21 ` [Buildroot] [PATCH 4 of 4 v2] infra: remove unused helper function pkgparentdir Thomas De Schampheleire
2014-02-04 17:55 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox