* [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make
@ 2013-10-03 12:10 Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 1/6] package: add toolchain dependency to inner-generic-package Fabio Porcedda
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
Hi all,
this is a patch set for fixing top-level parallel make in buildroot,
the common problem scattered in buildroot's top-level makefile is that
in the rules it relies on the order of evaluation of the
prerequisites, to be able to use top-level parallel make instead of
reling on the left to right ordering of evaluation of the
prerequisites we must add an explicit rule to describe the
dependencies.
With this patch set the top-level parallel make seems to work fine,
example:
make clean
make BR2_JLEVEL= -j$((`getconf _NPROCESSORS_ONLN` + 1))
On my quad core system the building time for
qemu_arm_versatile_defconfig is 13m versus 10m.
Best regards
Fabio Porcedda
v7:
- add the latest patch
- add to the first patch the <pkgname>_TOOLCHAIN variable
- improve the fifth patch
v6:
- added the fifth patch
- updated the fourth patch adding the install targets
- updated the second patch to remove TARGETS_ALL
v5:
- added the fourth patch
- fixed some typos
- rewrited the second patch to use only $$($(2)_TARGET_*) in the rules
- add support for top-level parallel make for the glibc package
v4:
- rebased over master
- add Acked-by: Thomas Petazzoni on the third patch
- changed the orderd of the patches
v3:
- add back the patch "package: add toolchain dependency to
inner-generic-package" because now is working fine.
- add Acked-by: Arnout Vandecappelle to the third patch.
- reworked the second patch following Arnout suggestions.
v2:
- remove patch "package: add toolchain dependency to inner-generic-package"
because was not working fine against recent toolchain changes.
Fabio Porcedda (6):
package: add toolchain dependency to inner-generic-package
pkg-generic: fix rules for top-level parallel make
package/Makefile.in: don't force jobs when BR2_JLEVEL is empty
pkg-generic: enable jobserver for recursive make
Makefile: fix rules for top-level parallel make
Makefile: enable top-level parallel make
Makefile | 21 +++----------
fs/common.mk | 4 +--
package/Makefile.in | 2 +-
package/glibc/glibc.mk | 3 +-
package/linux-headers/linux-headers.mk | 1 +
package/pkg-autotools.mk | 3 +-
package/pkg-generic.mk | 56 +++++++++++++++++++---------------
package/uclibc/uclibc.mk | 4 ++-
8 files changed, 48 insertions(+), 46 deletions(-)
--
1.8.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 1/6] package: add toolchain dependency to inner-generic-package
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
@ 2013-10-03 12:10 ` Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 2/6] pkg-generic: fix rules for top-level parallel make Fabio Porcedda
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
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, example:
make clean <package-name>
Also remove TARGETS_ALL because the only purpose was to add toolchain
dependency so it's superseded by this commit.
To prevent circular dependency add the new variable <pkgname>_TOOLCHAIN
for not adding the toolchain dependency for toolchain packages.
This is a step forward top-level parallel make.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
f
---
Makefile | 8 ++------
| 1 +
package/pkg-autotools.mk | 3 ++-
package/pkg-generic.mk | 8 ++++++--
package/uclibc/uclibc.mk | 1 +
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index c170ca2..44dc584 100644
--- a/Makefile
+++ b/Makefile
@@ -363,7 +363,6 @@ TARGETS+=target-post-image
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
-TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
# host-* dependencies have to be handled specially, as those aren't
# visible in Kconfig and hence not added to a variable like TARGETS.
@@ -386,9 +385,6 @@ HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS)))
TARGETS_LEGAL_INFO:=$(patsubst %,%-legal-info,\
$(TARGETS) $(BASE_TARGETS) $(TARGETS_HOST_DEPS) $(HOST_DEPS))))
-# all targets depend on the crosscompiler and it's prerequisites
-$(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
-
dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
@@ -401,11 +397,11 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
toolchain: prepare dirs dependencies $(BASE_TARGETS)
-world: toolchain $(TARGETS_ALL)
+world: $(TARGETS)
.PHONY: all world toolchain dirs clean distclean source outputmakefile \
legal-info legal-info-prepare legal-info-clean printvars \
- $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
+ $(BASE_TARGETS) $(TARGETS) \
$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
$(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
--git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk
index 30d3076..865b36d 100644
--- a/package/linux-headers/linux-headers.mk
+++ b/package/linux-headers/linux-headers.mk
@@ -16,6 +16,7 @@ endif
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz
LINUX_HEADERS_INSTALL_STAGING = YES
+LINUX_HEADERS_TOOLCHAIN = YES
define LINUX_HEADERS_INSTALL_STAGING_CMDS
(cd $(@D); \
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 9523529..f58570d 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -209,7 +209,8 @@ 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))))
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index bfc4dc1..2dc743b 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -305,9 +305,13 @@ ifndef $(2)_REDISTRIBUTE
endif
$(2)_REDISTRIBUTE ?= YES
+$(2)_TOOLCHAIN ?= NO
-
-$(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)$$($(2)_TOOLCHAIN),targetNO)
+$(2)_DEPENDENCIES += toolchain
+endif
$(2)_INSTALL_STAGING ?= NO
$(2)_INSTALL_IMAGES ?= NO
diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index 3993d9b..8efebc6 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -17,6 +17,7 @@ UCLIBC_SOURCE = uClibc-$(UCLIBC_VERSION).tar.xz
endif
UCLIBC_INSTALL_STAGING = YES
+UCLIBC_TOOLCHAIN = YES
# Before uClibc is configured, we must have the first stage
# cross-compiler and the kernel headers
--
1.8.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 2/6] pkg-generic: fix rules for top-level parallel make
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 1/6] package: add toolchain dependency to inner-generic-package Fabio Porcedda
@ 2013-10-03 12:10 ` Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty Fabio Porcedda
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
To be able to use top-level parallel make we must not depend in a rule
on the order of evaluation of the prerequisites, so instead of relyng on
the left to right ordering of evaluation of the prerequisites add
an explicit rule to describe the dependencies.
So add explicit dependencies for the following stamp files:
%/.stamp_extracted
%/.stamp_patched
%/.stamp_configured
%/.stamp_built
%/.stamp_host_installed
%/.stamp_staging_installed
%/.stamp_images_installed
%/.stamp_target_installed
Because the %-build target is not anymore part of the dependency chain,
add a new variable <pkgname>_BUILD_DEPENDENCIES to be used instead.
This new variable is used only by the uclibc package for building
the toolchain.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
package/glibc/glibc.mk | 3 ++-
package/pkg-generic.mk | 38 +++++++++++++++++++++-----------------
package/uclibc/uclibc.mk | 3 ++-
3 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk
index 68c4636..cbeb4d4 100644
--- a/package/glibc/glibc.mk
+++ b/package/glibc/glibc.mk
@@ -30,7 +30,8 @@ endif
# Before (e)glibc is built, we must have the second stage
# cross-compiler, for some gcc versions
-glibc-build: $(if $(BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD),host-gcc-intermediate)
+GLIBC_BUILD_DEPENDENCIES = \
+ $(if $(BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD),host-gcc-intermediate)
GLIBC_SUBDIR = build
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 2dc743b..84e843b 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -312,6 +312,7 @@ $(2)_DEPENDENCIES ?= $(filter-out host-toolchain $(1),\
ifeq ($$($(2)_TYPE)$$($(2)_TOOLCHAIN),targetNO)
$(2)_DEPENDENCIES += toolchain
endif
+$(2)_BUILD_DEPENDENCIES ?=
$(2)_INSTALL_STAGING ?= NO
$(2)_INSTALL_IMAGES ?= NO
@@ -363,30 +364,34 @@ $(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images
endif
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)
-$(1)-build: $(1)-configure \
- $$($(2)_TARGET_BUILD)
+$$($(2)_TARGET_INSTALL_TARGET) $$($(2)_TARGET_INSTALL_STAGING) \
+$$($(2)_TARGET_INSTALL_IMAGES) $$($(2)_TARGET_INSTALL_HOST): \
+ $$($(2)_TARGET_BUILD)
+
+$(1)-build: $$($(2)_TARGET_BUILD)
+$$($(2)_TARGET_BUILD): $$($(2)_TARGET_CONFIGURE) | $$($(2)_BUILD_DEPENDENCIES)
+
+$(1)-configure: $$($(2)_TARGET_CONFIGURE)
+$$($(2)_TARGET_CONFIGURE): | $$($(2)_DEPENDENCIES)
ifeq ($$($(2)_OVERRIDE_SRCDIR),)
# In the normal case (no package override), the sequence of steps is
@@ -395,13 +400,13 @@ ifeq ($$($(2)_OVERRIDE_SRCDIR),)
# extract
# patch
# configure
-$(1)-configure: $(1)-patch $(1)-depends \
- $$($(2)_TARGET_CONFIGURE)
+$$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_PATCH)
-$(1)-patch: $(1)-extract $$($(2)_TARGET_PATCH)
+$(1)-patch: $$($(2)_TARGET_PATCH)
+$$($(2)_TARGET_PATCH): $$($(2)_TARGET_EXTRACT)
-$(1)-extract: $(1)-source \
- $$($(2)_TARGET_EXTRACT)
+$(1)-extract: $$($(2)_TARGET_EXTRACT)
+$$($(2)_TARGET_EXTRACT): $$($(2)_TARGET_SOURCE)
$(1)-depends: $$($(2)_DEPENDENCIES)
@@ -411,10 +416,9 @@ else
# source, by rsyncing
# depends
# configure
-$(1)-configure: $(1)-depends \
- $$($(2)_TARGET_CONFIGURE)
+$$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_RSYNC)
-$(1)-depends: $(1)-rsync $$($(2)_DEPENDENCIES)
+$(1)-depends: $$($(2)_DEPENDENCIES)
$(1)-patch: $(1)-rsync
$(1)-extract: $(1)-rsync
diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index 8efebc6..094bdd9 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -25,7 +25,8 @@ UCLIBC_DEPENDENCIES = host-gcc-initial linux-headers
# Before uClibc is built, we must have the second stage
# cross-compiler, for some gcc versions, and when NPTL is used.
-uclibc-build: $(if $(BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD),host-gcc-intermediate)
+UCLIBC_BUILD_DEPENDENCIES = \
+ $(if $(BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD),host-gcc-intermediate)
# specifying UCLIBC_CONFIG_FILE on the command-line overrides the .config
# setting.
--
1.8.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 1/6] package: add toolchain dependency to inner-generic-package Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 2/6] pkg-generic: fix rules for top-level parallel make Fabio Porcedda
@ 2013-10-03 12:10 ` Fabio Porcedda
2013-10-03 16:54 ` Arnout Vandecappelle
2013-10-03 12:10 ` [Buildroot] [PATCH v7 4/6] pkg-generic: enable jobserver for recursive make Fabio Porcedda
` (2 subsequent siblings)
5 siblings, 1 reply; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
When the "BR2_JLEVEL" variable is empty use "make" without
the "-j" option, because to be able to use top-level parallel
make we must don't force the number of jobs in sub-make.
Example:
make BR2_JLEVEL= -j8
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/Makefile.in b/package/Makefile.in
index 170ad78..d406901 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -18,7 +18,7 @@ PARALLEL_JOBS:=$(BR2_JLEVEL)
endif
MAKE1:=$(HOSTMAKE) -j1
-MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS)
+MAKE:=$(HOSTMAKE) $(if $(PARALLEL_JOBS),-j$(PARALLEL_JOBS))
# Compute GNU_TARGET_NAME
GNU_TARGET_NAME=$(ARCH)-buildroot-$(TARGET_OS)-$(LIBC)$(ABI)
--
1.8.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 4/6] pkg-generic: enable jobserver for recursive make
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
` (2 preceding siblings ...)
2013-10-03 12:10 ` [Buildroot] [PATCH v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty Fabio Porcedda
@ 2013-10-03 12:10 ` Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 5/6] Makefile: fix rules for top-level parallel make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 6/6] Makefile: enable " Fabio Porcedda
5 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
Add '+' prefix to the $($(PKG)_BUILD_CMDS) and $($(PKG)_INSTALL*_CMDS)
commands to enable jobserver for the sub-make.
Without the '+' prefix GNU make does not detect the sub-make so it
disable the jobserver for the sub-make.
From GNU make documentation:
Using the MAKE variable has the same effect as using a ?+? character
at the beginning of the recipe line. This special feature is only
enabled if the MAKE variable appears directly in the recipe: it does
not apply if the MAKE variable is referenced through expansion of
another variable. In the latter case you must use the ?+? token to get
these special effects.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
package/pkg-generic.mk | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 84e843b..577956e 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -117,21 +117,21 @@ $(BUILD_DIR)/%/.stamp_configured:
# Build
$(BUILD_DIR)/%/.stamp_built::
@$(call MESSAGE,"Building")
- $($(PKG)_BUILD_CMDS)
+ +$($(PKG)_BUILD_CMDS)
$(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@
# Install to host dir
$(BUILD_DIR)/%/.stamp_host_installed:
@$(call MESSAGE,"Installing to host directory")
- $($(PKG)_INSTALL_CMDS)
+ +$($(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@
# Install to staging dir
$(BUILD_DIR)/%/.stamp_staging_installed:
@$(call MESSAGE,"Installing to staging directory")
- $($(PKG)_INSTALL_STAGING_CMDS)
+ +$($(PKG)_INSTALL_STAGING_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
$(call MESSAGE,"Fixing package configuration files") ;\
@@ -145,7 +145,7 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
# Install to images dir
$(BUILD_DIR)/%/.stamp_images_installed:
@$(call MESSAGE,"Installing to images directory")
- $($(PKG)_INSTALL_IMAGES_CMDS)
+ +$($(PKG)_INSTALL_IMAGES_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@
@@ -156,7 +156,7 @@ $(BUILD_DIR)/%/.stamp_target_installed:
$($(PKG)_INSTALL_INIT_SYSTEMD))
$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
$($(PKG)_INSTALL_INIT_SYSV))
- $($(PKG)_INSTALL_TARGET_CMDS)
+ +$($(PKG)_INSTALL_TARGET_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
$(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
--
1.8.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 5/6] Makefile: fix rules for top-level parallel make
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
` (3 preceding siblings ...)
2013-10-03 12:10 ` [Buildroot] [PATCH v7 4/6] pkg-generic: enable jobserver for recursive make Fabio Porcedda
@ 2013-10-03 12:10 ` Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 6/6] Makefile: enable " Fabio Porcedda
5 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
To be able to use top-level parallel make we must not depend in a rule
on the order of evaluation of the prerequisites, so instead of relyng on
the left to right ordering of evaluation of the prerequisites add
an explicit rule to describe the dependencies.
Add explicit rules to describe the following dependency chain:
$(TARGETS) -> target-finalize -> rootfs-* -> target-post-image
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
Makefile | 14 +++++---------
fs/common.mk | 4 ++--
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 44dc584..2c9e17e 100644
--- a/Makefile
+++ b/Makefile
@@ -340,8 +340,6 @@ include boot/common.mk
include linux/linux.mk
include system/system.mk
-TARGETS+=target-finalize
-
ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
TARGETS+=target-purgelocales
endif
@@ -358,8 +356,6 @@ endif
include fs/common.mk
-TARGETS+=target-post-image
-
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
@@ -397,11 +393,11 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
toolchain: prepare dirs dependencies $(BASE_TARGETS)
-world: $(TARGETS)
+world: target-post-image
.PHONY: all world toolchain dirs clean distclean source outputmakefile \
legal-info legal-info-prepare legal-info-clean printvars \
- $(BASE_TARGETS) $(TARGETS) \
+ target-finalize target-post-image $(TARGETS) $(TARGETS_ROOTFS) \
$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
$(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
@@ -458,7 +454,7 @@ endif
STRIP_FIND_CMD += -type f -perm /111
STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print
-target-finalize:
+target-finalize: $(TARGETS)
rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
@@ -565,7 +561,7 @@ target-generatelocales: host-localedef
done
endif
-target-post-image:
+target-post-image: target-finalize $(TARGETS_ROOTFS)
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
$(call MESSAGE,"Executing post-image script $(s)"); \
$(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
@@ -601,7 +597,7 @@ legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \
@rm -f $(LEGAL_WARNINGS)
show-targets:
- @echo $(TARGETS)
+ @echo $(TARGETS) $(TARGETS_ROOTFS)
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
diff --git a/fs/common.mk b/fs/common.mk
index 4dab7ea..7698c53 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -42,7 +42,7 @@ define ROOTFS_TARGET_INTERNAL
# extra deps
ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZO),host-lzop) $$(if $$(BR2_TARGET_ROOTFS_$(2)_XZ),host-xz)
-$$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
+$$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES)
@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
$$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),$$(call $$(hook))$$(sep))
rm -f $$(FAKEROOT_SCRIPT)
@@ -86,7 +86,7 @@ rootfs-$(1)-show-depends:
rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(1) $$(ROOTFS_$(2)_POST_TARGETS)
ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y)
-TARGETS += rootfs-$(1)
+TARGETS_ROOTFS += rootfs-$(1)
endif
endef
--
1.8.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 6/6] Makefile: enable top-level parallel make
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
` (4 preceding siblings ...)
2013-10-03 12:10 ` [Buildroot] [PATCH v7 5/6] Makefile: fix rules for top-level parallel make Fabio Porcedda
@ 2013-10-03 12:10 ` Fabio Porcedda
5 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2013-10-03 12:10 UTC (permalink / raw)
To: buildroot
Enable top-level parallel make because the previous patches have fixed
all the know issue about top-level parallel make.
Example:
make <board>_defconfig
make BR2_JLEVEL= -j$((`getconf _NPROCESSORS_ONLN`+1))
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
Makefile | 3 ---
1 file changed, 3 deletions(-)
diff --git a/Makefile b/Makefile
index 2c9e17e..bd0b5ac 100644
--- a/Makefile
+++ b/Makefile
@@ -42,9 +42,6 @@ export HOSTARCH := $(shell uname -m | \
-e s/macppc/powerpc/\
-e s/sh.*/sh/)
-# This top-level Makefile can *not* be executed in parallel
-.NOTPARALLEL:
-
# absolute path
TOPDIR:=$(shell pwd)
CONFIG_CONFIG_IN=Config.in
--
1.8.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty
2013-10-03 12:10 ` [Buildroot] [PATCH v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty Fabio Porcedda
@ 2013-10-03 16:54 ` Arnout Vandecappelle
2013-10-04 13:08 ` Peter Korsgaard
0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2013-10-03 16:54 UTC (permalink / raw)
To: buildroot
On 10/03/13 14:10, Fabio Porcedda wrote:
> When the "BR2_JLEVEL" variable is empty use "make" without
> the "-j" option, because to be able to use top-level parallel
> make we must don't force the number of jobs in sub-make.
>
> Example:
> make BR2_JLEVEL= -j8
>
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Peter, can we get this committed?
Regards,
Arnout
> ---
> package/Makefile.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 170ad78..d406901 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -18,7 +18,7 @@ PARALLEL_JOBS:=$(BR2_JLEVEL)
> endif
>
> MAKE1:=$(HOSTMAKE) -j1
> -MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS)
> +MAKE:=$(HOSTMAKE) $(if $(PARALLEL_JOBS),-j$(PARALLEL_JOBS))
>
> # Compute GNU_TARGET_NAME
> GNU_TARGET_NAME=$(ARCH)-buildroot-$(TARGET_OS)-$(LIBC)$(ABI)
>
--
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 v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty
2013-10-03 16:54 ` Arnout Vandecappelle
@ 2013-10-04 13:08 ` Peter Korsgaard
0 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2013-10-04 13:08 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
Arnout> On 10/03/13 14:10, Fabio Porcedda wrote:
>> When the "BR2_JLEVEL" variable is empty use "make" without
>> the "-j" option, because to be able to use top-level parallel
>> make we must don't force the number of jobs in sub-make.
>>
>> Example:
>> make BR2_JLEVEL= -j8
>>
>> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
>> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Arnout> Peter, can we get this committed?
Yes, committed - Thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-10-04 13:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03 12:10 [Buildroot] [PATCH v7 0/6] Fixes for top-level parallel make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 1/6] package: add toolchain dependency to inner-generic-package Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 2/6] pkg-generic: fix rules for top-level parallel make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 3/6] package/Makefile.in: don't force jobs when BR2_JLEVEL is empty Fabio Porcedda
2013-10-03 16:54 ` Arnout Vandecappelle
2013-10-04 13:08 ` Peter Korsgaard
2013-10-03 12:10 ` [Buildroot] [PATCH v7 4/6] pkg-generic: enable jobserver for recursive make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 5/6] Makefile: fix rules for top-level parallel make Fabio Porcedda
2013-10-03 12:10 ` [Buildroot] [PATCH v7 6/6] Makefile: enable " Fabio Porcedda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox