Skip to contentSkip to conversation

fixes for top-level parallel make

RFC New Fabio Porcedda 2 participants 7 messages Apr 24, 2013

lore
Share & tools
lore
#0 lore raw

cover fixes for top-level parallel make

This patch set improve support for top-level parallel make, the support for top-level parallel make is not complete, but at least is a improvement.
I will submit a more complete patch set with more fixes.

Best regards
Fabio Porcedda (4):
package: add toolchain dependency to inner-generic-package
package: fix generic configure for top-level parallel make
package: fix generic build for top-level parallel make
package: fix generic install for top-level parallel make

 package/pkg-autotools.mk |  2 +-
 package/pkg-generic.mk   | 33 ++++++++++++++++++---------------
 2 files changed, 19 insertions(+), 16 deletions(-)
Signature · 1 line
1.8.1.4
#1 lore raw

RFC 1/4 package: add toolchain dependency to inner-generic-package

This commit makes the dependency from the target toolchain explicit. This way we can buid from command line a package that use innger-generic-package right after the configuration phase.

This is a step forward top-level parallel make.

---
 package/pkg-autotools.mk | 2 +-
 package/pkg-generic.mk   | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
package/pkg-autotools.mk +1 -1
index d8d7e6d..032f86c 100644
@@ -201,7 +201,7 @@ endef
 # This must be repeated from inner-generic-package, otherwise we get an empty
 # _DEPENDENCIES if _AUTORECONF is YES.  Also filter the result of _AUTORECONF
 # away from the non-host rule
-$(2)_DEPENDENCIES ?= $(filter-out host-automake host-autoconf host-libtool $(1),\
+$(2)_DEPENDENCIES ?= $(filter-out host-automake host-autoconf host-libtool host-toolchain $(1),\
     $(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
 
 
package/pkg-generic.mk +6 -1
index e6bc955..2460384 100644
@@ -304,7 +304,12 @@ endif
 $(2)_REDISTRIBUTE		?= YES
 
 
-$(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
+$(2)_DEPENDENCIES ?= $(filter-out host-toolchain $(1),\
+	$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
+ifeq ($$($(2)_TYPE),target)
+$(2)_DEPENDENCIES += toolchain
+endif
+
 
 $(2)_INSTALL_STAGING		?= NO
 $(2)_INSTALL_IMAGES		?= NO
Signature · 1 line
1.8.1.4
#2 lore raw

RFC 2/4 package: fix generic configure for top-level parallel make

In reply to Fabio Porcedda
---
 package/pkg-generic.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
package/pkg-generic.mk +3 -5
index 2460384..455d0ef 100644
@@ -386,6 +386,8 @@ $(1)-install-host:      $(1)-build $$($(2)_TARGET_INSTALL_HOST)
 $(1)-build:		$(1)-configure \
 			$$($(2)_TARGET_BUILD)
 
+$$($(2)_TARGET_CONFIGURE): $(1)-depends
+$(1)-configure:		$$($(2)_TARGET_CONFIGURE)
 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
 # In the normal case (no package override), the sequence of steps is
 #  source, by downloading
@@ -393,8 +395,7 @@ ifeq ($$($(2)_OVERRIDE_SRCDIR),)
 #  extract
 #  patch
 #  configure
-$(1)-configure:		$(1)-patch $(1)-depends \
-			$$($(2)_TARGET_CONFIGURE)
+$$($(2)_TARGET_CONFIGURE): $(1)-patch
 
 $(1)-patch:		$(1)-extract $$($(2)_TARGET_PATCH)
 
@@ -409,9 +410,6 @@ else
 #  source, by rsyncing
 #  depends
 #  configure
-$(1)-configure:		$(1)-depends \
-			$$($(2)_TARGET_CONFIGURE)
-
 $(1)-depends:		$(1)-rsync $$($(2)_DEPENDENCIES)
 
 $(1)-patch:		$(1)-rsync
Signature · 1 line
1.8.1.4
#3 lore raw

RFC 2/4 package: fix generic configure for top-level parallel make

Dear Fabio Porcedda,

Could you add a detailed commit description for patches 2, 3 and 4 ? Those patches are touching core infrastructure, so they should be explained in detail. Thanks!

Thomas

Quoted 38 lines · Fabio Porcedda
---
 package/pkg-generic.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
package/pkg-generic.mk +3 -5
index 2460384..455d0ef 100644
@@ -386,6 +386,8 @@ $(1)-install-host:      $(1)-build $$($(2)_TARGET_INSTALL_HOST)
 $(1)-build:		$(1)-configure \
 			$$($(2)_TARGET_BUILD)
 
+$$($(2)_TARGET_CONFIGURE): $(1)-depends
+$(1)-configure:		$$($(2)_TARGET_CONFIGURE)
 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
 # In the normal case (no package override), the sequence of steps is
 #  source, by downloading
@@ -393,8 +395,7 @@ ifeq ($$($(2)_OVERRIDE_SRCDIR),)
 #  extract
 #  patch
 #  configure
-$(1)-configure:		$(1)-patch $(1)-depends \
-			$$($(2)_TARGET_CONFIGURE)
+$$($(2)_TARGET_CONFIGURE): $(1)-patch
 
 $(1)-patch:		$(1)-extract $$($(2)_TARGET_PATCH)
 
@@ -409,9 +410,6 @@ else
 #  source, by rsyncing
 #  depends
 #  configure
-$(1)-configure:		$(1)-depends \
-			$$($(2)_TARGET_CONFIGURE)
-
 $(1)-depends:		$(1)-rsync $$($(2)_DEPENDENCIES)
 
 $(1)-patch:		$(1)-rsync
Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

RFC 2/4 package: fix generic configure for top-level parallel make

Quoted 5 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Could you add a detailed commit description for patches 2, 3 and 4 ? Those patches are touching core infrastructure, so they should be explained in detail. Thanks!

Hi Thomas,
Thanks for reviewing.

I will do that in the next iteration.

Something like:

Some rules depends on the left-to-right evaluation order of prerequisites, but that works only in non-parallel makefiles.
To fix that it must use instead a new rule to clarify that dependency.

Best regards
Fabio Porcedda

Quoted 40 lines

Thomas

Quoted 37 lines · Fabio Porcedda
---
 package/pkg-generic.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
package/pkg-generic.mk +3 -5
index 2460384..455d0ef 100644
@@ -386,6 +386,8 @@ $(1)-install-host:      $(1)-build $$($(2)_TARGET_INSTALL_HOST)
 $(1)-build:          $(1)-configure \
                      $$($(2)_TARGET_BUILD)
 
+$$($(2)_TARGET_CONFIGURE): $(1)-depends
+$(1)-configure:              $$($(2)_TARGET_CONFIGURE)
 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
 # In the normal case (no package override), the sequence of steps is
 #  source, by downloading
@@ -393,8 +395,7 @@ ifeq ($$($(2)_OVERRIDE_SRCDIR),)
 #  extract
 #  patch
 #  configure
-$(1)-configure:              $(1)-patch $(1)-depends \
-                     $$($(2)_TARGET_CONFIGURE)
+$$($(2)_TARGET_CONFIGURE): $(1)-patch
 
 $(1)-patch:          $(1)-extract $$($(2)_TARGET_PATCH)
 
@@ -409,9 +410,6 @@ else
 #  source, by rsyncing
 #  depends
 #  configure
-$(1)-configure:              $(1)-depends \
-                     $$($(2)_TARGET_CONFIGURE)
-
 $(1)-depends:                $(1)-rsync $$($(2)_DEPENDENCIES)
 
Quoted 9 lines

package/pkg-generic.mk else · line 415

Quoted 1 line
package/pkg-generic.mk +0 -0
 $(1)-patch:          $(1)-rsync

--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

--
Fabio Porcedda

#5 lore raw

RFC 3/4 package: fix generic build for top-level parallel make

In reply to Fabio Porcedda
---
 package/pkg-generic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/pkg-generic.mk +2 -2
index 455d0ef..09ddd81 100644
@@ -383,8 +383,8 @@ endif
 
 $(1)-install-host:      $(1)-build $$($(2)_TARGET_INSTALL_HOST)
 
-$(1)-build:		$(1)-configure \
-			$$($(2)_TARGET_BUILD)
+$$($(2)_TARGET_BUILD): $(1)-configure
+$(1)-build:		$$($(2)_TARGET_BUILD)
 
 $$($(2)_TARGET_CONFIGURE): $(1)-depends
 $(1)-configure:		$$($(2)_TARGET_CONFIGURE)
Signature · 1 line
1.8.1.4
#6 lore raw

RFC 4/4 package: fix generic install for top-level parallel make

In reply to Fabio Porcedda
---
 package/pkg-generic.mk | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
package/pkg-generic.mk +7 -7
index 09ddd81..c4ef0fb 100644
@@ -360,28 +360,28 @@ else
 $(1)-install:		$(1)-install-staging $(1)-install-target $(1)-install-images
 endif
 
+$$($(2)_TARGET_INSTALL_TARGET) $$($(2)_TARGET_INSTALL_STAGING) \
+	$$($(2)_TARGET_INSTALL_IMAGES) $$($(2)_TARGET_INSTALL_HOST): $(1)-build
+
 ifeq ($$($(2)_INSTALL_TARGET),YES)
-$(1)-install-target:	$(1)-build \
-			$$($(2)_TARGET_INSTALL_TARGET)
+$(1)-install-target:	$$($(2)_TARGET_INSTALL_TARGET)
 else
 $(1)-install-target:
 endif
 
 ifeq ($$($(2)_INSTALL_STAGING),YES)
-$(1)-install-staging:	$(1)-build \
-			$$($(2)_TARGET_INSTALL_STAGING)
+$(1)-install-staging:	$$($(2)_TARGET_INSTALL_STAGING)
 else
 $(1)-install-staging:
 endif
 
 ifeq ($$($(2)_INSTALL_IMAGES),YES)
-$(1)-install-images:	$(1)-build \
-			$$($(2)_TARGET_INSTALL_IMAGES)
+$(1)-install-images:	$$($(2)_TARGET_INSTALL_IMAGES)
 else
 $(1)-install-images:
 endif
 
-$(1)-install-host:      $(1)-build $$($(2)_TARGET_INSTALL_HOST)
+$(1)-install-host:      $$($(2)_TARGET_INSTALL_HOST)
 
 $$($(2)_TARGET_BUILD): $(1)-configure
 $(1)-build:		$$($(2)_TARGET_BUILD)
Signature · 1 line
1.8.1.4