From patchwork Tue Aug 19 07:34:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 4741111 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 30B669F402 for ; Tue, 19 Aug 2014 07:36:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DFB720107 for ; Tue, 19 Aug 2014 07:36:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18BDE20172 for ; Tue, 19 Aug 2014 07:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbaHSHev (ORCPT ); Tue, 19 Aug 2014 03:34:51 -0400 Received: from smtp.mei.co.jp ([133.183.100.20]:52689 "EHLO smtp.mei.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752767AbaHSHet (ORCPT ); Tue, 19 Aug 2014 03:34:49 -0400 Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile14) with ESMTP id s7J7YgRU002368; Tue, 19 Aug 2014 16:34:42 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili14) with ESMTP id s7J7YgL19693; Tue, 19 Aug 2014 16:34:42 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi17) id s7J7YgeF001948; Tue, 19 Aug 2014 16:34:42 +0900 Received: from poodle by lomi17.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s7J7YgeQ001888; Tue, 19 Aug 2014 16:34:42 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 223012743A5C; Tue, 19 Aug 2014 16:34:42 +0900 (JST) From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] kbuild: handle the dependency of multi-objs hostprogs appropriately Date: Tue, 19 Aug 2014 16:34:21 +0900 Message-Id: <1408433663-17435-3-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408433663-17435-1-git-send-email-yamada.m@jp.panasonic.com> References: <1408433663-17435-1-git-send-email-yamada.m@jp.panasonic.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Assume we have a Makefile like: hostprogs-y := foo bar foo-objs := foo1.o foo2.o bar-objs := bar1.o bar2.o Without this commit, the host program foo depends on all of foo1.o foo2.o bar1.o bar2.o. This commit allows to handle the dependency of each host program separately. Signed-off-by: Masahiro Yamada --- scripts/Makefile.host | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.host b/scripts/Makefile.host index ab5980f..133edfa 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -96,8 +96,9 @@ quiet_cmd_host-cmulti = HOSTLD $@ cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ $(addprefix $(obj)/,$($(@F)-objs)) \ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cmulti): $(obj)/%: $(host-cobjs) FORCE +$(host-cmulti): FORCE $(call if_changed,host-cmulti) +$(call multi_depend, $(host-cmulti), , -objs) # Create .o file from a single .c file # host-cobjs -> .o @@ -113,8 +114,9 @@ quiet_cmd_host-cxxmulti = HOSTLD $@ $(foreach o,objs cxxobjs,\ $(addprefix $(obj)/,$($(@F)-$(o)))) \ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) FORCE +$(host-cxxmulti): FORCE $(call if_changed,host-cxxmulti) +$(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) # Create .o file from a single .cc (C++) file quiet_cmd_host-cxxobjs = HOSTCXX $@