From patchwork Wed Feb 12 09:19:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 319585 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id BBA7E2C00B3 for ; Wed, 12 Feb 2014 20:19:37 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8F77D8B0F8; Wed, 12 Feb 2014 09:19:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rf1zfEtZkUQM; Wed, 12 Feb 2014 09:19:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 134858B0EC; Wed, 12 Feb 2014 09:19:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id AA2861BF966 for ; Wed, 12 Feb 2014 09:19:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A3B9D32E6A for ; Wed, 12 Feb 2014 09:19:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q943PkEI7dbI for ; Wed, 12 Feb 2014 09:19:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by silver.osuosl.org (Postfix) with ESMTPS id D24A032E61 for ; Wed, 12 Feb 2014 09:19:31 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id kx10so8957314pab.35 for ; Wed, 12 Feb 2014 01:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TCTj+FFwdeBrs7XWLEchV6bYEnHeTKOsdlkZ8MezdkE=; b=mxYLxas9fILXCfDjrwsARPjh1eMMi5+RSbI48DHR6OlG4LouzqYzL3315BJCAmHt6A ZIIGzNxHjDI/84O9AAbxFtOkrDXY9pUYzNVqDnkT7svXQG4xpauAplC+1MiYnVp1Zdfg J5fx6izfapcDqrV4W380aWZcvigBocgHObs0BycVo8yTHyqkoiiBl4euBOjthIMQ2qH2 HKt6Kh91WsqYydXcDROX+56oDRoFc7OL0Br2EiHX9t+dPQk8QXZnIL2wy25s9O60HIoL /eKW2CBVaC3b/jBJTAF3erCglSq1y5zmJqhH11cnYiGrfLV3BXKyXg5yI4BAaxV0SuTN 2NsQ== X-Received: by 10.66.26.10 with SMTP id h10mr37924709pag.24.1392196771567; Wed, 12 Feb 2014 01:19:31 -0800 (PST) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id lh13sm156417637pab.4.2014.02.12.01.19.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 01:19:31 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Wed, 12 Feb 2014 10:19:08 +0100 Message-Id: <1392196751-23485-5-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1392196751-23485-1-git-send-email-fabio.porcedda@gmail.com> References: <1392196751-23485-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , Dallas Clement Subject: [Buildroot] [PATCH v12 4/7] Makefile: add support for top-level parallel make X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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 Acked-by: Arnout Vandecappelle (Essensium/Mind) --- Makefile | 21 ++++++++++++--------- fs/common.mk | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 8e65bc7..c89107a 100644 --- a/Makefile +++ b/Makefile @@ -377,8 +377,6 @@ include system/system.mk include $(BR2_EXTERNAL)/external.mk -TARGETS+=target-finalize - ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) TARGETS+=target-purgelocales endif @@ -395,8 +393,6 @@ endif include fs/common.mk -TARGETS+=target-post-image - TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) @@ -429,11 +425,16 @@ $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG) prepare: $(BUILD_DIR)/buildroot-config/auto.conf -world: $(TARGETS) +# Add base dependencies to all targets even on those not based on the +# package framework. +$(TARGETS): dirs prepare dependencies + +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 \ + $(BASE_TARGETS) $(TARGETS) $(TARGETS_ROOTFS) \ $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \ $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) @@ -493,7 +494,7 @@ endif STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \) 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 @@ -520,6 +521,8 @@ endif find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \ xargs -r $(KSTRIPCMD); fi +$(TARGETS_ROOTFS): target-finalize + # See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads # besides the one in which crash occurred; or SIGTRAP kills my program when # I set a breakpoint" @@ -598,7 +601,7 @@ target-generatelocales: host-localedef done endif -target-post-image: +target-post-image: $(TARGETS_ROOTFS) @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ $(call MESSAGE,"Executing post-image script $(s)"); \ $(USER_HOOKS_EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) @@ -635,7 +638,7 @@ legal-info: dirs legal-info-clean legal-info-prepare $(TARGETS_LEGAL_INFO) \ @rm -f $(LEGAL_WARNINGS) show-targets: - @echo $(TARGETS) + @echo $(TARGETS) $(TARGETS_ROOTFS) graph-build: $(O)/build/build-time.log @install -d $(O)/graphs diff --git a/fs/common.mk b/fs/common.mk index 30e7524..d95c26b 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -64,7 +64,7 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz ROOTFS_$(2)_COMPRESS_CMD = $$(XZ) -9 -C crc32 -c endif -$$(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) @@ -95,7 +95,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