From patchwork Sun Nov 6 22:18:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 9414143 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2DE796048F for ; Sun, 6 Nov 2016 22:34:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4F62811D for ; Sun, 6 Nov 2016 22:34:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FF7F284F1; Sun, 6 Nov 2016 22:34:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A81C62811D for ; Sun, 6 Nov 2016 22:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751042AbcKFWeC (ORCPT ); Sun, 6 Nov 2016 17:34:02 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35911 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbcKFWeB (ORCPT ); Sun, 6 Nov 2016 17:34:01 -0500 Received: by mail-pf0-f193.google.com with SMTP id n85so14294282pfi.3; Sun, 06 Nov 2016 14:34:01 -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=Z5L9mH7YaiMagqoUEabEkIzhMi29MiDNvB6ASZeomAU=; b=sMzpwSEsnKMHok9Dypt+qXpuhiBaoKkSRv3igEBTqVDd8CNMfaG6XX0nIBaz29pq+W hj4iLdJ0gE5+WhGQOVbMTMouOrcE15V0w6bwQ0r4iqRvP8MiVGefCroMGL7bWsuFzxWp FN39l3U9/6pxTw6crnOBRnOVraifVDc6oH3YBvfSVeBgh7mjN1GH4ZojqeqkdpDNZeM1 XREXw08t89CMQsE/lopCwm2EBAn6prnTNDwEqq4nILnGKFrnOrvap9mSgTfrAFbdvAG2 Czz/xcvch8BYEb2Mlg/5hoILvLKyKaDHRz07xpAcBHvxc2QvB3Vl9p5/bSmgac/RisJK O7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z5L9mH7YaiMagqoUEabEkIzhMi29MiDNvB6ASZeomAU=; b=ZkDxUsRwD/syS4UeGjNju+nCP/4p6F6hkCboy8kc66lHcCzCa9ScZGdRNGgrN8MHuT hTBwvU2vvzOCi/pT+FfLgUiPOB3fgzmmSa2/fRCamvCemS6amxTWSvbTZ+Qvp3Y4dNxP VMhuKwyvyhEhaundTjNBmGHhOIyQl842urOGBVbyYWctdqhoI/1R8/z+kHK10voXS8v5 XONjhRTkQSHy2ZRvLzb7DTUSgmtiSpx8SZtOQTCyovqJhk/jSTJ+lggNFzMrCQexxeAW zAKYRE/lvUft5Vcx0AFAHoyjgXBE2SIWr9aYkJPMSFOgSBRUkY5W8NfuTava6SlhzzEe /TWA== X-Gm-Message-State: ABUngvffcEPROLT70ClhkMkgjS2lhGaiuDXu68AITG0yx0afwn/VdbOoqYpGa0R61gBBng== X-Received: by 10.99.123.87 with SMTP id k23mr6209513pgn.101.1478470756429; Sun, 06 Nov 2016 14:19:16 -0800 (PST) Received: from localhost ([45.32.44.20]) by smtp.gmail.com with ESMTPSA id c2sm12710847pfl.66.2016.11.06.14.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Nov 2016 14:19:15 -0800 (PST) From: Wei Yang To: mmarek@suse.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH V2] kbuild: add %/built-in.o target in top Makefile Date: Sun, 6 Nov 2016 22:18:32 +0000 Message-Id: <1478470712-9872-1-git-send-email-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1477313111-25205-1-git-send-email-richard.weiyang@gmail.com> References: <1477313111-25205-1-git-send-email-richard.weiyang@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current kbuild just supports building built-in.o in second directory level individually. There is no rule to build those built-in.o targets below third directory level. Even current kbuild system could achieve this with rule "%/", while this not only builds built-in targes but also lib target, extra target and module objects. This patch adds the "%/built-in.o" rule so that each built-in.o in the kernel tree could be the build target, which looks more consistent for the kbuild system. Signed-off-by: Wei Yang --- v2 . add FORCE in prerequest --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index f97f786..9c65498 100644 --- a/Makefile +++ b/Makefile @@ -1638,6 +1638,8 @@ endif $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.symtypes: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%/built-in.o: prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) # Modules /: prepare scripts FORCE