From patchwork Tue Oct 1 13:24:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 279463 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 5079C2C0085 for ; Tue, 1 Oct 2013 23:25:21 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 631CA8B5A0; Tue, 1 Oct 2013 13:25:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G-REE-Xo9kWj; Tue, 1 Oct 2013 13:25:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id AACD38ADF1; Tue, 1 Oct 2013 13:25:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2FAAE1BFA6D for ; Tue, 1 Oct 2013 13:25:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1F4338B067 for ; Tue, 1 Oct 2013 13:25:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id il-1YIcMsA7w for ; Tue, 1 Oct 2013 13:25:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by whitealder.osuosl.org (Postfix) with ESMTPS id C6C218B2AF for ; Tue, 1 Oct 2013 13:25:11 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id ro12so7181345pbb.27 for ; Tue, 01 Oct 2013 06:25:11 -0700 (PDT) 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=nSqXJdq+VqaTER2WGXK8lBGFNw8SgX6kuoNGUW6Q508=; b=HucDP/od/ClHIChz7s+GUHfn/nY4LgjA3qeAnBkcZjre1VkDLy1WTyWmFDRI6rCe8c gKUSi60y+K5SLHEHH/3mRMc4mU4uf3iXyDGMp/ycnO2Ow8ub1vBOmWsm49sDdAhmm+qO trbiWTkg146oDg43EqL0IQpQCZyHSLdBofdVRaN9vBNUxgs41kl9iUMhUc6ky3NQy/h5 A3FpfY1uiTTwmvCw6d4Fd2n9TPVt7wQ1EztU1+M6vaY+EBSrCDWy5sNU/bVuiUJzoVyA 2is38wlZVI2Veoy/wdHNEMjzYbtaa0nRigWA5/nF+GN/bUmDnE21C33Mkq4i++To27p9 Rt4w== X-Received: by 10.68.190.103 with SMTP id gp7mr29558366pbc.74.1380633908674; Tue, 01 Oct 2013 06:25:08 -0700 (PDT) Received: from ld2036.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id ct4sm6819312pbb.41.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Oct 2013 06:25:08 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Tue, 1 Oct 2013 15:24:37 +0200 Message-Id: <1380633877-10702-6-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1380633877-10702-1-git-send-email-fabio.porcedda@gmail.com> References: <1380633877-10702-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH v6 5/5] Makefile: fix rules 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 --- Makefile | 14 +++++--------- fs/common.mk | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c31995a..0ee2c62 100644 --- a/Makefile +++ b/Makefile @@ -337,8 +337,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 @@ -355,8 +353,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)) @@ -394,11 +390,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) @@ -455,7 +451,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 @@ -562,7 +558,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)"); \ $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) @@ -598,7 +594,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..1056679 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): $$(ROOTFS_$(2)_DEPENDENCIES) target-finalize @$$(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