From patchwork Wed Apr 9 06:51:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 3952631 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 02B5A9F38C for ; Wed, 9 Apr 2014 06:52:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2AC920452 for ; Wed, 9 Apr 2014 06:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D79D620451 for ; Wed, 9 Apr 2014 06:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752444AbaDIGwA (ORCPT ); Wed, 9 Apr 2014 02:52:00 -0400 Received: from smtp.mei.co.jp ([133.183.100.20]:60866 "EHLO smtp.mei.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbaDIGv7 (ORCPT ); Wed, 9 Apr 2014 02:51:59 -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 s396pfgE024859; Wed, 9 Apr 2014 15:51:41 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili15) with ESMTP id s396pfB14280; Wed, 9 Apr 2014 15:51:41 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi12) id s396pf2j019677; Wed, 9 Apr 2014 15:51:41 +0900 Received: from poodle by lomi12.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s396pfhF019655; Wed, 9 Apr 2014 15:51:41 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 214642740043; Wed, 9 Apr 2014 15:51:41 +0900 (JST) From: Masahiro Yamada To: linux-kernel@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada , Michal Marek , Sam Ravnborg Subject: [PATCH] kbuild: support simultaneous "make %config" and "make all" Date: Wed, 9 Apr 2014 15:51:35 +0900 Message-Id: <1397026295-13822-1-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.3.2 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Kbuild is supposed to support mixed targets. (%config and build targets) But "make all" did nothing if it was run with configuration targets. For example, $ LANG=C make defconfig all HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf *** Default configuration is based on 'x86_64_defconfig' # # configuration written to .config # make: Nothing to be done for `all'. This commits allows "make %config all" and makes sure mixed targets are built one by one in the given order. Signed-off-by: Masahiro Yamada Cc: Michal Marek CC: Sam Ravnborg --- Makefile | 12 ++++++++++-- scripts/mkmakefile | 15 ++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 4eadf2d..40f731b 100644 --- a/Makefile +++ b/Makefile @@ -486,8 +486,16 @@ ifeq ($(mixed-targets),1) # We're called with mixed targets (*config and build targets). # Handle them one by one. -%:: FORCE - $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@ +PHONY += $(MAKECMDGOALS) __build_one_by_one + +$(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one + @: + +__build_one_by_one: + $(Q)set -e; \ + for i in $(MAKECMDGOALS); do \ + $(MAKE) -f $(srctree)/Makefile $$i; \ + done else ifeq ($(config-targets),1) diff --git a/scripts/mkmakefile b/scripts/mkmakefile index 0cc0442..84af27b 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile @@ -42,18 +42,11 @@ MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$ MAKEFLAGS += --no-print-directory -.PHONY: all \$(MAKECMDGOALS) +.PHONY: __sub-make \$(MAKECMDGOALS) -all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) +__sub-make: + \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS) -all: - \$(Q)\$(MAKE) \$(MAKEARGS) \$(all) - -Makefile:; - -\$(all): all - @: - -%/: all +\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make @: EOF