From patchwork Thu Feb 14 03:05:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158291 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp834706jaa; Wed, 13 Feb 2019 19:06:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IY4J1VhwALEaWoFARmnWBjvgewyNxEDW97h+6lHbLEC/EGq+FTNCTcFmBlAkBT2duegWl74 X-Received: by 2002:a65:4608:: with SMTP id v8mr1573553pgq.9.1550113568903; Wed, 13 Feb 2019 19:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113568; cv=none; d=google.com; s=arc-20160816; b=GIDl52JVY3G9QPpA0dYfPLF3ZMbty6URRkBFJu8jCJwKvWUwD/xnG3+BaAUBpCHhpT O5UhRaIhPQAY+Vk9QyLJKYPUytkm9MbMdaeWir6ygIo/RTYTrUKhxrikYycSeoQTozO+ VWSM4kK5mOe9GETkSgJ6DldZ48merjnLbBnUm5qTeWDTKBhebvAp5ESYp+en0rz5RMFH zdqAmZ0yTFMQ5oArk+9Kk8nM6zuk6WdYunD9Rot47x68Z590qoSifBP57gwVbweI8mmv s7jqwFS5owOuymumcZ3bUtUz8HG/lI7J5W0tCrL7NZ7Pnkl7p4rZJIk1dcK0bPNFw9tW G34A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=yO8RC+IzX+7q6ObGuUgOsgj+kpMFLH2G7hMx94CJuxg=; b=Cnd1jy45mgJLzJECJB2rX9aFtTrreLJ4dJg+kVMp4GvY2LGTvMvXuLt//MGJnrevbV yLVi5TcXZ7CIuV0rhzh3mMWmDYwosDl6JZNh2FoMrRHPpgW0fahKbIRYm0BG+KYoV5ZB sohVVfp09rHXylRvOufTDhay7pgIkwlNqnlOnqm54yhLIFJqihB4ZslfFCqTgdlW8wxa 9M8RCxCt4/pRbxllLMD5fNKyNXGucIytssDrMOUZy9jWKCfbYiLc3eR6ep0E/JNEJeXr c4W6cjDmBlmoLSXtVCeEz6rmS1vPr6PVUmjsftH1bhifXinVRZvcmC430jfa5kXX8srg jlig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xa9xx55x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24si1173042pgj.315.2019.02.13.19.06.08; Wed, 13 Feb 2019 19:06:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xa9xx55x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395215AbfBNDGH (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:07 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64387 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbfBNDGG (ORCPT ); Wed, 13 Feb 2019 22:06:06 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg2020814; Thu, 14 Feb 2019 12:05:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg2020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113525; bh=yO8RC+IzX+7q6ObGuUgOsgj+kpMFLH2G7hMx94CJuxg=; h=From:To:Cc:Subject:Date:From; b=xa9xx55x3a46jz1CDBYlsEEOL296PAe7Tgo9BkkXj3NBFmssf4NG8Pentf8AbN9u4 h1Ozqfic48t7KM6Ws3JxYECl69MbPv1M6bOhoJhCBMUFIADfZRQe18F6FoEcTBar+8 6jZ/A7ZsKVHwZeTd07VyBFEKRsinWNwH0NszGYxDQTpQQ4vaNWtwvwAG9l5QZbpjP0 6KBUu56t4sa5xPacF5h7NMvHrVDNqnca/uAge8lEVCxlHuD6VBeqoYoO0+N+/Vt5YC NuTl95roarog8CttNiwm6d8vB60wLbk+UXGuCZCg31j9CJg3XOzgP5up7BZOoRuer7 hW4tYZzpZuC/g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/8] kbuild: pkg: use -f $(srctree)/Makefile to recurse to top Makefile Date: Thu, 14 Feb 2019 12:05:14 +0900 Message-Id: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org '$(MAKE) KBUILD_SRC=' changes the working directory back and forth between objtree and srctree. It is better to recurse to the top-level Makefile directly. Signed-off-by: Masahiro Yamada --- scripts/package/Makefile | 4 ++-- scripts/package/builddeb | 10 +++++----- scripts/package/buildtar | 2 +- scripts/package/mkdebian | 6 ++++-- 4 files changed, 12 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 453fece..aa39c2b 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -59,7 +59,7 @@ rpm-pkg: FORCE # binrpm-pkg # --------------------------------------------------------------------------- binrpm-pkg: FORCE - $(MAKE) KBUILD_SRC= + $(MAKE) -f $(srctree)/Makefile $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ $(UTS_MACHINE) -bb $(objtree)/binkernel.spec @@ -102,7 +102,7 @@ clean-dirs += $(objtree)/snap/ # tarball targets # --------------------------------------------------------------------------- tar%pkg: FORCE - $(MAKE) KBUILD_SRC= + $(MAKE) -f $(srctree)/Makefile $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ clean-dirs += $(objtree)/tar-install/ diff --git a/scripts/package/builddeb b/scripts/package/builddeb index f43a274..8ac25d1 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -86,12 +86,12 @@ cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then # Only some architectures with OF support have this target if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then - $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install + $MAKE -f $srctree/Makefile INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install fi fi if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then - INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install + INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_install rm -f "$tmpdir/lib/modules/$version/build" rm -f "$tmpdir/lib/modules/$version/source" if [ "$ARCH" = "um" ] ; then @@ -113,14 +113,14 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then # resign stripped modules MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)" if [ -n "$MODULE_SIG_ALL" ]; then - INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_sign + INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign fi fi fi if [ "$ARCH" != "um" ]; then - $MAKE headers_check KBUILD_SRC= - $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" + $MAKE -f $srctree/Makefile headers_check + $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" fi # Install the maintainer scripts diff --git a/scripts/package/buildtar b/scripts/package/buildtar index d624a07..cfd2a4a 100755 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar @@ -57,7 +57,7 @@ dirs=boot # Try to install modules # if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then - make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install + make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_install dirs="$dirs lib" fi diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index edcad61..f030961 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -205,13 +205,15 @@ EOF cat < debian/rules #!$(command -v $MAKE) -f +srctree ?= . + build: \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ - KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= + KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile binary-arch: \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ - KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg + KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg clean: rm -rf debian/*tmp debian/files From patchwork Thu Feb 14 03:05:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158293 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp834874jaa; Wed, 13 Feb 2019 19:06:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IaKpnHBJbCajER6HBfGJsb35Ze0naEtYxElOtGH5UuYsdBJiCAqmE0oAyyojIw1gmqq2bkl X-Received: by 2002:aa7:8286:: with SMTP id s6mr1634533pfm.63.1550113579409; Wed, 13 Feb 2019 19:06:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113579; cv=none; d=google.com; s=arc-20160816; b=U2g93JAaFWyWNtgNOYEmofertUb/KJKh7Z41jfqG1RnrvGiqFJkcJaEJyMspUD/NdB AHJDHwzaDp2b+aWVsf7iWhdNvuhkg6gs1/beQO80JHuEKxEzbbpROtmp2mietwmRRnpS J2MVFrgWQxX9TVn2RhL1j+RSW8UkEs5O2n52xxGv7LMRVIvgMQx68JRTYWMc2Lx8BErW Bkj4imWehNkJnNBzJt14rjdVzwTbtj084bplCPRtia+Y1qN8AGAwI111K/fIWX1TfXWZ PFv2ajzzIa0kZm9/lwXsYAGHwI8GycK8j6EtfMOlm3je+irJR1ulMZ59ezqb6KDRlAtl 9ohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=z7QbcsEL2gebJ2pwu1NQAHednh5Ku/Vt6/MmBfIu8UY=; b=Gisk/YVYwxDa1UkkQDYUGRDPNd7j31lfnmct1Qjr5Kbb+3BlPkVMZzU0BNMon2Gyym nSEDN9Y+6+9oxRnQHloomGYLMj3dgWUZLjPo+VYAwR/Rfxsc86o41cNzjOYRisQjPSHr OhmgeVs/rS/m/aA3yhLUFLcdLUgn5W+1/1E00BlXgHgkgEzsg6NvOa/cL/xlIXrj0ReN nKbK1jrA+Iuw2d/6cCH9TAUDLlN8+qqLDlresbbHHten91hR5k23xcjlOERrfZc436Cj 9LzpfGmcR0Ieq837jLXC7pEQnUhm1nvlSpy0Cn1zdomOzMxft3PSh+ptG3Xjst+uOsed eIwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=yCK6NlQq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38si1187893pla.207.2019.02.13.19.06.19; Wed, 13 Feb 2019 19:06:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=yCK6NlQq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394329AbfBNDGF (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:05 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64388 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388324AbfBNDGF (ORCPT ); Wed, 13 Feb 2019 22:06:05 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg3020814; Thu, 14 Feb 2019 12:05:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg3020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113526; bh=z7QbcsEL2gebJ2pwu1NQAHednh5Ku/Vt6/MmBfIu8UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yCK6NlQq6emtPRc5IEqJokU4opyLttoMvwtjnKyj1aW62BKX7SUzwb0Z5eHz2syxN zJcnKWII+vT+cGsJwxmaPRr8FQMjcmj+k3RBvAZbFqcuzECTumdAVH8WIooepZyOst M2nRsOUWRKjU5kjCUqfGIWAUyo0duBrmXFr4cLIakX4a3x0XmKBRCtNoS3ihhJB2va RegSQBaiSUQOe2KSK6+HsA99W7BI5e2l0DQ3cDyCT6/pyN1ZVZNlZ9xJjcQYkb1SAW wkFYrdyAd/I/N3KN+vcRyFda95z8UgIfpMXde2cvSLHxxopfSxqEb1iHFbBr7fm25m pdbmM1KAcgAsA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/8] kbuild: generate modules.order only when CONFIG_MODULES=y Date: Thu, 14 Feb 2019 12:05:15 +0900 Message-Id: <1550113521-23577-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not generate pointless modules.order when the module support is disabled. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 99be01c..89debbe 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -63,7 +63,9 @@ ifneq ($(strip $(real-obj-y) $(need-builtin)),) builtin-target := $(obj)/built-in.a endif +ifdef CONFIG_MODULES modorder-target := $(obj)/modules.order +endif # We keep a list of all modules in $(MODVERDIR) From patchwork Thu Feb 14 03:05:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158297 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp835187jaa; Wed, 13 Feb 2019 19:06:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IZv1bEUPRPTwflnbxtrL2pFvd0peyEYdWxLqJSQEkqIOkjNUg/uLNYM5kDQPoexmcjHJ0BJ X-Received: by 2002:a63:f253:: with SMTP id d19mr1595145pgk.14.1550113603460; Wed, 13 Feb 2019 19:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113603; cv=none; d=google.com; s=arc-20160816; b=NAJymS7fKk1ivBx0CSTyBZTkSDU5jPDc2r07dRMcUPg3UzBUqzY6yWihD6j/sVXRUp hPzWSA3vO+WdR9f8qUO/+icJYfxNDrExd+HmdfTz7Q763YbVb8RQzgHWh/bKaV38zvBY IR0N/EwK7WMRqd9+NWfj9fJNHQ50JQzRfUbyYt/EUq+5XgVbTTdd/MIT13wB+qN+wHku QCnD7SPRgM1GWO4Ze1fhbqghWoDx1MIr5Rv4LtKfwDPE3MWE29l5Zhu4Dttng8QPrldZ AbmoJZoTvMSYoIvtCoWUGvwqOmCqYfQnWuyFxmfY7GUX8qVORkEZXhmjDKoOnNS9yW2e sZvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=qmqFYzrO309vIKYtqQ9mMRdEh6RcNYvW13KnAIs8pHM=; b=vFjkyXJ/u6CvCH9upd/EX7LTFT3X/4XGEwqwlBG1hkFMnWEdpu1Bo0anXkQPENsHWH F9nfI8h98MqHjyHmqG6EnI7FYB7nBxYIUkpakQCQgWOWEr3u4mDmfFWnNh/lgEf0Q9FA hJNEc8ZJxJwfKAxFHEmgrNcqcfuD/o8UK+b/azKb4mSUveoVHrSWqmmkeOBgicSZp5za DoyuCjH2GMYRVmIzjpuXbddimI+ZgFRgm5Tn+vhURNL23wEORMAvS2fE+BypVuhSmCjZ l9LzBrYBoQzR7eEn0hBNOARGMX0CTu5WeA52D0so01zA2HO/n9MYNSsBFBHMIFW2A7EF FW8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gogeCQ+a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si1139616pls.290.2019.02.13.19.06.43; Wed, 13 Feb 2019 19:06:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gogeCQ+a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405328AbfBNDGm (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:42 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64383 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393468AbfBNDGF (ORCPT ); Wed, 13 Feb 2019 22:06:05 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg4020814; Thu, 14 Feb 2019 12:05:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg4020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113527; bh=qmqFYzrO309vIKYtqQ9mMRdEh6RcNYvW13KnAIs8pHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gogeCQ+aeK2rK/zRoyN4DEr2oaQQkFWJzU1sHYgz8JNh1OEpdRF17PLUQ0EROdROE 68/9EMAPqH+gcEcLAcLrvGo8YDGs2hEu8dnY7VNZVXSolDGEnMH+DGkSib03Dsw8KA LixGtZOySh/1Ya29F+xPK70pPsiPhR0KJnyVJjVN101xAvKRyfbb34mC/KXuTL5tXQ EfSW2LsF2T1V1c3kOst+Bgz8+dTo5iARpIx1ZWHBsiKVrWlgOji1TLmJ33Ctd3P2Pp XRNBmy0rbkBMcIu9GXuIMaC5wAeP88Qh7OeFNOOvLtI2+Nl79/5laC89j/Ir61c3LX Fn3zd9l5sxe0g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/8] kbuild: set KBUILD_MODULES=1 all the time for single target %/ Date: Thu, 14 Feb 2019 12:05:16 +0900 Message-Id: <1550113521-23577-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is fine to set KBUILD_MODULES=1 when CONFIG_MODULES is disabled. It is actually how "make allnoconfig all" works. On the other hand, KBUILD_MODULES=1 is unneeded for the %.ko pattern. It is just a matter of whether modules.order is generated or not. Signed-off-by: Masahiro Yamada --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 3cf253d..fe62de3 100644 --- a/Makefile +++ b/Makefile @@ -1710,16 +1710,13 @@ endif # Modules /: prepare FORCE - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ - $(build)=$(build-dir) + $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) # Make sure the latest headers are built for Documentation Documentation/ samples/: headers_install %/: prepare FORCE - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ - $(build)=$(build-dir) + $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) %.ko: prepare FORCE - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ - $(build)=$(build-dir) $(@:.ko=.o) + $(Q)$(MAKE) $(build)=$(build-dir) $(@:.ko=.o) $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost # FIXME Should go into a make.lib or something From patchwork Thu Feb 14 03:05:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158295 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp835048jaa; Wed, 13 Feb 2019 19:06:32 -0800 (PST) X-Google-Smtp-Source: AHgI3IZiKNr3idOqiyMh6o0uU6JU5Xf2OrsdSJPkD5UKaJyUioxPP2Mo32fk0ukl2o316GOijaDt X-Received: by 2002:a17:902:7889:: with SMTP id q9mr1761511pll.134.1550113592892; Wed, 13 Feb 2019 19:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113592; cv=none; d=google.com; s=arc-20160816; b=FYz78kniSD32G2xNJjm0Xfc+f1Wc98VUa/i95o24rTx9NfeBU34wYfLIIznPi34qcM c3OYKqaMzH4fw42KPQ9HmsnZ0h8bQReov+f1bg4x7W77utzbz/U0l0JWCD4vJl7nQd85 n0QL1k1pjDUOGunWTXjH4HcYr1SpdjuW+HfdmKc/6fEy9Qzxp8ACAJFlVp4SSJir2wag sgXdYemb7PScmYrBfqtAYSQyzKH1tAyBX/9mI7+kjAFiepp360c1o57+EN0CiRO09tq5 D0+/uuP6yDJytJ0A7SAAoG9UIzhE5EFU96zekbWCUIQbvrKLrZq3UkvGSy7w/hl7rV7A pD3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=12ymzprJkRQOxFpe2dJ/Cbc9UDJYC/XmnLNco9k9Spw=; b=y87EbBiI7GFJMJQ98Qa46WMdVpkgOvpdhNbm2c/ePdpISCQudOHC0aqP5aNU8YiOWI +O/66UVRznn29WK99LZtOtYh1hovCi4CA5hqF93PkQ/+ZS9U8OSMWDiYg5ksWVNk/FDR Yt+sNbjVI+V7F85xraPPMXYI4esvyGNcg1gIlH7uYJkeaqYS2m2kHOBo58SRS+8Zv7Oy wlovnhNRIZawdk4FxrwG90DSoXTtHgcdzmSrFcYjQx4oUktydXjulAz7uefBDJCgRJYs R2g7qoTnk8rmGcdpbV5whsNJARkoMrdPSEX4LwE/mFpZfwk2Xo5Pkw3dgaJZmcdWI7J/ ir+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=tG9dxpNy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si1125330pgk.173.2019.02.13.19.06.32; Wed, 13 Feb 2019 19:06:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=tG9dxpNy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405299AbfBNDGb (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:31 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64821 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393851AbfBNDGS (ORCPT ); Wed, 13 Feb 2019 22:06:18 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg5020814; Thu, 14 Feb 2019 12:05:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg5020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113527; bh=12ymzprJkRQOxFpe2dJ/Cbc9UDJYC/XmnLNco9k9Spw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tG9dxpNyBLAjEl8FblEfSiTQNpAD2n7eZvUoSTp7oHhj+PdGsZOOShr45k7YF+n2t l8YJbVG5Cu91/z7QDjULzMd4nEFu2/Y5n36u625G5FuVsZXb8smX4oK9q80IkREExn B/6408aN990ydI6bYIAuRIR3JsNBXej8nkR894OlZ2MFqpI3iiQkBjiNSg++Y6/6vJ tkkUlTEgmcKKQnSDQHbZLp6U8LIKc6ZG956gfwC6D7xu7BCvQlYq4tjMYYuMz/75YJ QIq5qy6xrZaZKnhdGYbzUI2LDCoHnTOmhUnK/JKHIPleHawAX+KUTDuraB8eBSPtxJ E3eF7DRjFVBvQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Corbet , Michal Marek Subject: [PATCH 4/8] kbuild: turn '/' into an alias of './' Date: Thu, 14 Feb 2019 12:05:17 +0900 Message-Id: <1550113521-23577-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 06300b21f4c7 ("kbuild: support building individual files for external modules") introduced the '/' target. It works only for external modules to build all .o files, but skip the modpost stage. However, 'make /' looks a bit weird to me. 'make ./' is more sensible if you want to build all objects under the current directory, and it works as expected. Let's change '/' into a phony target that is an alias of './', but I may feel like deprecating it in the future. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/modules.txt | 2 +- Makefile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index 3fb39e0..80295c6 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt @@ -140,7 +140,7 @@ executed to make module versioning work. make -C $KDIR M=$PWD bar.lst make -C $KDIR M=$PWD baz.o make -C $KDIR M=$PWD foo.ko - make -C $KDIR M=$PWD / + make -C $KDIR M=$PWD ./ === 3. Creating a Kbuild File for an External Module diff --git a/Makefile b/Makefile index fe62de3..3956e93 100644 --- a/Makefile +++ b/Makefile @@ -1709,8 +1709,9 @@ endif $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) # Modules -/: prepare FORCE - $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) +PHONY += / +/: ./ + # Make sure the latest headers are built for Documentation Documentation/ samples/: headers_install %/: prepare FORCE From patchwork Thu Feb 14 03:05:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158298 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp835267jaa; Wed, 13 Feb 2019 19:06:48 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia5yPrPGBVFnf1AaYZFNVLLJAsDDShJxkJq/WZyIL1o8xBSoGEeUsDsb76rqXE0O0wiGL6p X-Received: by 2002:a65:6553:: with SMTP id a19mr1544538pgw.267.1550113608030; Wed, 13 Feb 2019 19:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113608; cv=none; d=google.com; s=arc-20160816; b=V6TBUaHqWFpt37XoAogq+klI6COZVDTr+AliBAiBemCBugCuGPcmqMok/Ssl6Oy5EH ygGkBfqSLkoilzYlPfqYi6ql7sPtkB2OOFDst/VjslHr0vaj0Nfn7AFHd8gUFbQ8RpZ8 x6sphho6l9cP9u4zxvnWZVidfQyupMBC2FKfhYeGEV2XfVe3Nr5KXXL0frtR2ISJL59W dA3tqEv9gaPwUM3lq9sWx9gmy/eMO/DhpscdpEqMfJwjVTxErkrFTk95clNEXs8zNZ0B yuW9DioYgW4MSTUWHsd078RyXA60r3hf7wInUg7WHoaoA2BzbwxQj4Mlvs/u1vdGdimI 8ScQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=9+FohcoLHm8KYNdVvN4X6+iAEs7CLHpN0SKeH6bEVW0=; b=aarTIoelI/RCqnIHVJKCTZDwDgF8O4IvjfnRhxXDMSBVuJXQcB9++SUS/xA0OO78Iw 2bq/nP+Hy8dX1sXgJaJt5QYzszT5qImYwJyIWpBJquzlsRA3bkg1CjgIkSOkmnhx3xJO ll+qPreYPXZEMbDJd5MknktBeL0elAXgpz9/2ilPLSdAfYWLpUxDzkXCcKb74+VZks2i KIWjA6LOio9tTl5tT/1iqsb6U/iED8YqzFYom7x2ddG06EORZO/SQQLuhwus7IDrSLHn sQCXRBdebpqS3xgm/JaKvWA+esz/UdYyzVMWTCFTdShBZv1/DNuZLhI0IkG7tXik4K/C vAgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1ty/8NMW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si1139616pls.290.2019.02.13.19.06.47; Wed, 13 Feb 2019 19:06:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1ty/8NMW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394294AbfBNDGF (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:05 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64385 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733190AbfBNDGF (ORCPT ); Wed, 13 Feb 2019 22:06:05 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg6020814; Thu, 14 Feb 2019 12:05:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg6020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113528; bh=9+FohcoLHm8KYNdVvN4X6+iAEs7CLHpN0SKeH6bEVW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1ty/8NMW+CQYyU1AAuHhVNAXdSzFBQqFW09+HRt81NogjtBW0P6b+UdsowdN+nYpZ 0G2z93wrqw/G2JCM802DB2vENVcXsfyKSKMntbRx0ORPadmAmI+G/pOibhITpKO+9a Ll4ONtRawU1Zp6U+EeQoCUsxq1a1RedYF/dGwA35ZwHeYOOkQpHPcsK/6txvP5PSc5 KMjBV0sg5nvES7Rzro+dwALW472L2H54pSUqMuNO56N1dWBJUVknPZnd6CAtQE+JJB vPMDxTPFAZZ5rfmBD1pdx9YIJH5jCX8SlJqZOkD4P147mWs39Sy4/NyqA+WlJrC7Fp PKhG36EGwz20g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 5/8] kbuild: move tools_silent to a more relevant place Date: Thu, 14 Feb 2019 12:05:18 +0900 Message-Id: <1550113521-23577-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This would disturb the change the sub-make part. Move it near the tools/ target. Signed-off-by: Masahiro Yamada --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 3956e93..0180b23 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ endif ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) quiet=silent_ - tools_silent=s endif export quiet Q KBUILD_VERBOSE @@ -1664,6 +1663,11 @@ image_name: @echo $(KBUILD_IMAGE) # Clear a bunch of variables before executing the submake + +ifeq ($(quiet),silent_) +tools_silent=s +endif + tools/: FORCE $(Q)mkdir -p $(objtree)/tools $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(src)/tools/ From patchwork Thu Feb 14 03:05:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158296 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp835094jaa; Wed, 13 Feb 2019 19:06:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IaERgCqyreWaqqVXcBcjzasr7bcokr9sE/1739lCwLdh7ThFAZm7jBVljuhSBd8pytIdt3T X-Received: by 2002:a17:902:33c2:: with SMTP id b60mr1687068plc.211.1550113596436; Wed, 13 Feb 2019 19:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113596; cv=none; d=google.com; s=arc-20160816; b=rrFQGmyRPbiofHsWGFEM3a9sNMKKAp+UM7el4+gh/FQbklwvDURSochWiYzGek5MY/ KG8d2UzYwZ9JX2dyPPcXJB9wEz8Yc9EAAHN8swCAAiic0hqc4N8HfFC7qJSM5KqUp4eg K1rv5g9TEfdu7692F/b0nUjTiT2qwZ2pcGNLVHQEXHdcD6TXpjapqd5hfhIHB9WLN18d 2xAnCct4wJE10rqIiC050b4X1xFcqHTOHKCqgSh4N46zE6nrgk/tUTKKi7CmTO1LqCYs VDqHOFPVfg49K4OPMfO+MKHIADXwBbMDJQmSlD297UdzzY7fZvFVyCbdnUzb0z3B6nFB GkSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=UInuA6sjxvO1VVgZ8XgryVYJnyZUkO/SzulavMh+Za8=; b=SQEKFHQOLA14S/MT8xfIaZ3GO8LWofKpsqmRr9mHBlXqd0sMxyPJDRagLV7xkcaVq5 DB+7Z/2GqSGAPiErxZx58f5CwE8iN915/YmDPC+f9RNuJYefxltl1ItEEYVy7txIu5zi p/krprSwjs1T38sXHwqqeKDRmXqvFxllZQT82i/Fl2CFojBtr54sH7nWeIy+eEVF3RlV WX5GQXBV302tAM0ZDF8qDI+uEJI98GZtn85QpjqYVvub5zrvlTGu7oYP+6k7LWFKlB7L mBeR4XdynEjaIfqbPRH/gtPRCpS1Za1XbFJpUZSsyVDuSqD+XTPl6sE3G7Poxk74h0UR OfNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DD8gCOZ6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si1130117pgh.554.2019.02.13.19.06.35; Wed, 13 Feb 2019 19:06:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DD8gCOZ6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405272AbfBNDGa (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:30 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64382 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394145AbfBNDGG (ORCPT ); Wed, 13 Feb 2019 22:06:06 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg7020814; Thu, 14 Feb 2019 12:05:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg7020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113529; bh=UInuA6sjxvO1VVgZ8XgryVYJnyZUkO/SzulavMh+Za8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DD8gCOZ6YNKXjbMHKfAvzQAluld269OrZC1Z5CbLmpaYr68I6ycnzA2MYNPcmvx4c VnhWyuscYXmVr+LFbUWbBTd/pSe3RNUtVouLxokARc9aGEuNKiPb8Y+Vu4qPKtaLEn BNWrIbI/tQFwRe7m1n348IQcq/nzOMmIKucDsbJO6IfpRQVDuRh4NRyGCJEyviADWY JIr0DwsQR/JjpGDrYh8hIpdNr2iWECuIJyi2k5qvfwzZEoRIpwNfGitEU/d29WWC/a /CZxyc0ICvZiYNPrRMzSqBN7jlu9feDwCzVKYCr6ov+ZBpJG0I4PkNmzXW5ZbQFnvC xWN6j01qMFMDw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 6/8] kbuild: make -r/-R effective in top Makefile for old Make versions Date: Thu, 14 Feb 2019 12:05:19 +0900 Message-Id: <1550113521-23577-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding -rR to MAKEFLAGS is important because we do not want to be bothered by built-in implicit rules or variables. One problem that used to exist in older GNU Make versions is MAKEFLAGS += -rR ... does not become effective in the current Makefile. When you are building with O= option, it becomes effective in the top Makefile since it recurses via 'sub-make' target. Otherwise, the top Makefile tries implicit rules. That is why we explicitly add empty rules for Makefiles, but we often miss to do that. In fact, adding -d option to older GNU Make versions shows it is trying a bunch of implicit pattern rules. Considering target file `scripts/Makefile.kcov'. Looking for an implicit rule for `scripts/Makefile.kcov'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.o'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.c'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.cc'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.C'. ... This issue was fixed by GNU Make commit 58dae243526b ("[Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile"). So, it is no longer a problem if you use GNU Make 4.0 or later. However, older versions are still widely used. So, I decided to patch the kernel Makefile to invoke sub-make regardless of O= option. This will allow further cleanups. Signed-off-by: Masahiro Yamada --- Makefile | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 0180b23..25d7d46 100644 --- a/Makefile +++ b/Makefile @@ -15,19 +15,6 @@ NAME = Shy Crocodile PHONY := _all _all: -# Do not use make's built-in rules and variables -# (this increases performance and avoids hard-to-debug behaviour) -MAKEFLAGS += -rR - -# Avoid funny character set dependencies -unexport LC_ALL -LC_COLLATE=C -LC_NUMERIC=C -export LC_COLLATE LC_NUMERIC - -# Avoid interference with shell env settings -unexport GREP_OPTIONS - # We are using a recursive build, so we need to do a little thinking # to get the ordering right. # @@ -44,6 +31,21 @@ unexport GREP_OPTIONS # descending is started. They are now explicitly listed as the # prepare rule. +ifndef KBUILD_SUBMAKE + +# Do not use make's built-in rules and variables +# (this increases performance and avoids hard-to-debug behaviour) +MAKEFLAGS += -rR + +# Avoid funny character set dependencies +unexport LC_ALL +LC_COLLATE=C +LC_NUMERIC=C +export LC_COLLATE LC_NUMERIC + +# Avoid interference with shell env settings +unexport GREP_OPTIONS + # Beautify output # --------------------------------------------------------------------------- # @@ -111,7 +113,6 @@ export quiet Q KBUILD_VERBOSE # KBUILD_SRC is not intended to be used by the regular user (for now), # it is set on invocation of make with KBUILD_OUTPUT or O= specified. -ifeq ($(KBUILD_SRC),) # OK, Make called in directory where kernel src resides # Do we want to locate output files in a separate directory? @@ -141,6 +142,13 @@ $(if $(KBUILD_OUTPUT),, \ # 'sub-make' below. MAKEFLAGS += --include-dir=$(CURDIR) +else + +# Do not print "Entering directory ..." at all for in-tree build. +MAKEFLAGS += --no-print-directory + +endif # ifneq ($(KBUILD_OUTPUT),) + PHONY += $(MAKECMDGOALS) sub-make $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make @@ -148,16 +156,12 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make # Invoke a second make in the output directory, passing relevant variables sub-make: - $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ + $(Q)$(MAKE) KBUILD_SUBMAKE=1 \ + $(if $(KBUILD_OUTPUT),-C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR)) \ -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) -# Leave processing to above invocation of make -skip-makefile := 1 -endif # ifneq ($(KBUILD_OUTPUT),) -endif # ifeq ($(KBUILD_SRC),) - +else # KBUILD_SUBMAKE # We process the rest of the Makefile if this is the final invocation of make -ifeq ($(skip-makefile),) # Do not print "Entering directory ...", # but we want to display it when entering to the output directory @@ -1752,7 +1756,7 @@ $(cmd_files): ; # Do not try to update included dependency files endif # ifeq ($(config-targets),1) endif # ifeq ($(mixed-targets),1) -endif # skip-makefile +endif # ifndef KBUILD_SUBMAKE PHONY += FORCE FORCE: From patchwork Thu Feb 14 03:05:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158292 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp834751jaa; Wed, 13 Feb 2019 19:06:11 -0800 (PST) X-Google-Smtp-Source: AHgI3IbNR/H84brc3gPqLGq6GbvTPGxAlkSGsWjnGuKtKgQaFI/KdPQV0NKGUiFSoGTIIFIU4pnd X-Received: by 2002:a62:4bd5:: with SMTP id d82mr1612945pfj.85.1550113571552; Wed, 13 Feb 2019 19:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113571; cv=none; d=google.com; s=arc-20160816; b=hyWI7kdjU4xV6OJ21WvC9bb+r+iIt8s+rHy+ZOV6apHGw5y6kyICeWuuOnzXpy4EUM gCAVws9ySmgDSkFBbpnTo1iBk6pzJ676Y4Dps+Us3jeafliaJt9LKAd1Bv/ZFVoFfaSi 6l/ujAKDyCXFhmQmEojiY1nD3rgelkWtJVGZv+W2mtp7aVMupd4Bn07xgbDgZ9OiXwaA 4TbXN6Ttz1Jpbv9i4rZU5hlLFKQRKizNvzCykgyWlIeQmq4NRQbAK2I9ygERE9967U3c gTzdwYJNnyrq61jf1PVxCkKt7cflI2jt8i3qUp7waxQKIBeN8a0o3ITYOib/CGjUMKOB UiNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=9rCnJrZhrNGJF/7A8mlLM75Z8BqThK/fBdPkgtUyRPA=; b=qOcwmARfpZm80eFLRJiH1ZXC/xYKSjJnozoMyzn/YOLdLjXVn5K1ROf9gn6XT9TnAv 8NwPPA/jOfMxLDkhD2HaANd6hy8elx26obk5rMauBwzpt3brixKqQ7Rs4WOPIO/uXBJK o2b7n83qktJ1f7dp4CCjNlpYtq5c0AAHQC140xlLd0q20WjbRk1SAmLPEAXOIY5pCCGY q95dc62jcys96G/yzO7t9Sg5OzfIqc99PEOTOT8evzVgjBj3VmHo+2LrGBOqNR57qj3k qb2uAHwYsm7hNjZ0kCeeYOhMsKiwEaGZO2TyBsmjzD659ygkbLEXBo8kgksAUzxWLT34 R8cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YHX966Qj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si1139650pgc.221.2019.02.13.19.06.11; Wed, 13 Feb 2019 19:06:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YHX966Qj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395308AbfBNDGI (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:08 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64384 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394268AbfBNDGG (ORCPT ); Wed, 13 Feb 2019 22:06:06 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg8020814; Thu, 14 Feb 2019 12:05:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg8020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113529; bh=9rCnJrZhrNGJF/7A8mlLM75Z8BqThK/fBdPkgtUyRPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YHX966QjGfaHOVTquVmuzHmIIdhYCCM6T/lIo243Ly6iBmhF/LJ76ItK3CsAh+GZh A9ionEc55vwALlYZXihilnIQi/q6yBLM4lxAJfWHTQambXxNMch63348VWxCAHj4pJ LC/kCJ4MNa6WgfVj6ROeXAsL8Y9BgGHP6SJ9nCKY7Epspf9kV1jYKN8fUp3zYpv+fS NA5kuV/JTaHvOJd5wFTR522ny/WsOIGwi/ab7QXpJpo8HHtrc0HCnwkrACzdkwa0Zo w8PP+6lp50lVKeUjl5FRxIRhbVM+7cDVxWgRXsCHp8kb5eB1eCdwgHqD9fvajxQQzR sm1dYtn9UQE+A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 7/8] kbuild: remove empty rules for makefiles Date: Thu, 14 Feb 2019 12:05:20 +0900 Message-Id: <1550113521-23577-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The previous commit made 'MAKEFLAGS += -rR' effective in the top Makefile regardless of O= option, GNU Make versions. The top Makefile does not need to cancel implicit rules for makefiles. There is still one place where an empty rule is useful. Since -rR is effective only after sub-make, GNU Make would try implicit rules to update the top Makefile. Although it is not a big overhead, cancel it just in case. Signed-off-by: Masahiro Yamada --- Makefile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 25d7d46..f7f1aa1 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,10 @@ ifndef KBUILD_SUBMAKE # (this increases performance and avoids hard-to-debug behaviour) MAKEFLAGS += -rR +# 'MAKEFLAGS += -rR' does not become immediately effective for old +# GNU Make versions. Cancel implicit rules for this Makefile. +$(lastword $(MAKEFILE_LIST)): ; + # Avoid funny character set dependencies unexport LC_ALL LC_COLLATE=C @@ -120,9 +124,6 @@ ifeq ("$(origin O)", "command line") KBUILD_OUTPUT := $(O) endif -# Cancel implicit rules on top Makefile -$(CURDIR)/Makefile Makefile: ; - ifneq ($(words $(subst :, ,$(CURDIR))), 1) $(error main directory cannot contain spaces nor colons) endif @@ -303,8 +304,6 @@ __build_one_by_one: else -# We need some generic definitions (do not try to remake the file). -scripts/Kbuild.include: ; include scripts/Kbuild.include # Read KERNELRELEASE from include/config/kernel.release (if it exists) @@ -627,9 +626,6 @@ ifeq ($(may-sync-config),1) # because some architectures define CROSS_COMPILE there. -include include/config/auto.conf.cmd -# To avoid any implicit rule to kick in, define an empty command -$(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; - # The actual configuration files used during the build are stored in # include/generated/ and include/config/. Update them if .config is newer than # include/config/auto.conf (which mirrors .config). @@ -1750,9 +1746,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ # read saved command lines for existing targets existing-targets := $(wildcard $(sort $(targets))) -cmd_files := $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) -$(cmd_files): ; # Do not try to update included dependency files --include $(cmd_files) +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) endif # ifeq ($(config-targets),1) endif # ifeq ($(mixed-targets),1) From patchwork Thu Feb 14 03:05:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158294 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp834943jaa; Wed, 13 Feb 2019 19:06:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IaCjoA29zhFWI90pn3ZzeCNgvlGdtOIKi40wbxoaiadMvEcdAvtTnHnVTMavIG/UwnT+UvT X-Received: by 2002:a17:902:778d:: with SMTP id o13mr1722261pll.234.1550113585343; Wed, 13 Feb 2019 19:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113585; cv=none; d=google.com; s=arc-20160816; b=QmYwufu7seGTmqAbNOyZg8UfAYKQcSRBLqsqBaaq/30lXCba8cEZWMx0z3t7utF56B /TVRDjNzQ3oLptIzMnTkNuI6h2WG8sS3X6hedj3eksEq1dKugy7vN6BlWYSlSnZsUkJS JtHBTeE2CTPo+9jE1lwbk8iqtDIuRo61M2Qu+IXKX/SP7oigW2XXf2qsTMeId5uf89AA tQfNdCmGKsz0MaJsubBQn/zw2SF+Ib5KnXzDu0z8qqs5lsc9kbHf951InXGxr3/v1XSp CHI3D2Kpt+2J4UOXx4rjN5tkiNkLNRq3CywIRiq0U+fEyFwIPtKHjFEXLGyHrM89MOF3 fvTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=VnFzu1pRBkse1rgGgc43E28soFZDRai0oiY6uEajTrc=; b=LSJVqHXmwF9tVFqHY/hVt6qJw5tN4KomqVXcXIyLMW/pDGocSeRZZu7F3F9ETUUC2e bDD9L2L6TB7tfPhjbVBCPVh8dRZzrH+vbVa6Iiaw7/HubnAyMW432n9cm4VHapkMUgcR 9Vq3f45icc9pVLRBqDM1lslzT+yzXqRP3vskc25viH5fUDvLnNEwioauDPgQc/qc6oz9 /Nwq2O09nXDgfOyPkDyQhkN+md8QNTQAsXxdfLx++Sth7PqYZOOxjoUHlI5OB0SlOvzR maRlr4Lb5C7dzWPJRwUKJKYgmFFUbohWHxx0qR5TXq0ePcPCvYDi1k3Pn9JZwwZKKphw nDTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=o9Udx84v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si1125330pgk.173.2019.02.13.19.06.25; Wed, 13 Feb 2019 19:06:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=o9Udx84v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405244AbfBNDGX (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:23 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64386 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393527AbfBNDGG (ORCPT ); Wed, 13 Feb 2019 22:06:06 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1E35Pg9020814; Thu, 14 Feb 2019 12:05:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg9020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113530; bh=VnFzu1pRBkse1rgGgc43E28soFZDRai0oiY6uEajTrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o9Udx84v3yeIM0EAKBWQuWLIjCN5zZoaes7EcO/oM3OqAil+9BT3IM8dWkAQZVOez A6xzIGv4dQjpPG4qm7Apl4rCZV75ZHN4jNNOKcRZQospeyxDXuUdvQY6TSUHRrE2dA 5u6iVZwUNa5TYa6H4fHf//Id/NaiOnO5b8nWLGPtY8MgsM3wymuzgI+m7J0bHvmdOX MHZpc4mwPBey7X6YpF9WEForOxFl8IdNVUqdQxckfSRMlpHNSEnsbUCT1jSFij8mZz mBhkswIpVFnP+89h3pTKIfaVgGg74pnXYLHIurShSmFk3LR57wpUvJZmfKug5jhVZl h06Vnc05KqBkg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 8/8] kbuild: simplify single targets Date: Thu, 14 Feb 2019 12:05:21 +0900 Message-Id: <1550113521-23577-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dependency will be checked anyway after Kbuild descends into a sub-directory. Skip object/source dependency checks in top Makefile. VPATH can be simpler since the top Makefile no longer checks the preprense of the source file, which is located in in the external module directory. [Pros] - Code is cleaner - It can compile an object from a generated source file For example, $ make crypto/rsapubkey.asn1.o ... ASN.1 crypto/rsapubkey.asn1.c CC crypto/rsapubkey.asn1.o [Cons] - The top Makefile does not let it fail immediately when a user tries to build a wrong object. Signed-off-by: Masahiro Yamada --- Makefile | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index f7f1aa1..8bf0ed6 100644 --- a/Makefile +++ b/Makefile @@ -219,7 +219,7 @@ objtree := . src := $(srctree) obj := $(objtree) -VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) +VPATH := $(srctree) export srctree objtree VPATH @@ -1686,31 +1686,14 @@ tools/%: FORCE # target-dir => where to store outputfile # build-dir => directory in kernel source tree to use -ifeq ($(KBUILD_EXTMOD),) - build-dir = $(patsubst %/,%,$(dir $@)) - target-dir = $(dir $@) -else - zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@))) - build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash)) - target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) -endif - -%.s: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.i: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.o: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.lst: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.s: %.S prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.o: %.S prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.symtypes: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.ll: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +build-target = $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD)/)$@ +build-dir = $(patsubst %/,%,$(dir $(build-target))) + +%.i %.ll %.lst %.o %.s %.symtypes: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) + +%.ko: %.o + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost # Modules PHONY += / @@ -1720,9 +1703,6 @@ PHONY += / Documentation/ samples/: headers_install %/: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) -%.ko: prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(@:.ko=.o) - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost # FIXME Should go into a make.lib or something # ===========================================================================