Received: by 10.223.176.46 with SMTP id f43csp1471527wra; Wed, 24 Jan 2018 17:43:15 -0800 (PST) X-Google-Smtp-Source: AH8x224Rfy2/sJCoQqNfi6c9F4mRKFj0xp+IJYdfsXjOc47BP9lOggJBm1mFBDwyj3Wndng8S4me X-Received: by 10.99.2.203 with SMTP id 194mr12227473pgc.268.1516844595364; Wed, 24 Jan 2018 17:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516844595; cv=none; d=google.com; s=arc-20160816; b=dTHT5ievsGEYp7NZuvyFLWNPCxYeRLtPxt8uFHmyPxRD0noMqGaEhg07JpB0LPI6lI U7s+jaJuVPnfCtZOsRncZF4jBCH4L/K53h8TcoEbSiqMAHzas1p9aBr50AGpN+lqpCS7 b9WlC6mx9UbGzS+pdPCA8tVLjJMwpkFP0L3+0x8sSvRsWNAhOi8WWCsp4SJxOTtv/Qzd enz/wUmYXzUpd3+uAjEX8aJvNRNeLTo+26wmnZKOrXiknaP4NTHbBkKKcljJWvo1i3Dh Aez+NRxdOc9s7mpGRnbI2C2ArcUfE1kNZpuFcitZlaLwvan61vigSNbBHI4WQq7vvAOE T28w== 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:arc-authentication-results; bh=65UwcxLtKdq/8Ak8DSxZdXNcam0ewUKmZJe8EBQ/38o=; b=SAbDyINbrnGpxXP+nkEGtdrLoFEDCxzs4yuUUipdhKVHY3pRsBXnsBgOTYivAJOOyI UGAb9sAKwpoqdzt+IDM82Bi4RR5igFg6PKR1u62oTn0VxtdGB0spnq+JnSy7E8feUU+6 9vbGS97lkNEFlwiPPKiFVkYq/ryUXlvD0GqX0ekHg4TiInA4TxjTovc8Fq+drR21mF72 /+TFzml+2e62FrF6ZfFeemurzEXKiYezOp3Qm38/yZn7kHdseKuS8vDLhtNQhDdAKnCG R1mZytZAnRpbKINmLKBz7RsJsqkxcnzijspGUm66pRMgPlgU5RB9JPOCSas5XBPUWi6a I6ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=X6+RADn2; 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 d12si852340pgt.729.2018.01.24.17.43.01; Wed, 24 Jan 2018 17:43:15 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=X6+RADn2; 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 S1752764AbeAYBmM (ORCPT + 99 others); Wed, 24 Jan 2018 20:42:12 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:41983 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbeAYBl2 (ORCPT ); Wed, 24 Jan 2018 20:41:28 -0500 Received: by mail-pf0-f193.google.com with SMTP id c6so4603969pfi.8 for ; Wed, 24 Jan 2018 17:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=65UwcxLtKdq/8Ak8DSxZdXNcam0ewUKmZJe8EBQ/38o=; b=X6+RADn2uCt06lz8kiwamWhNyjYopEl2ACXBi6dQUcHRchq/QeM3t7kYefecXPREnr SJXU86+xineVfSw2X8fnqgYfN/pXNHHPbmiYArSVwC4lchy7wDiAP8L7hYYzcVmjDZP1 1hJsK7YFlvNvAuMZPVnUVZkih55VSXAU7QbouAC9URoLyj8YgKn6QkM5Riq/Nu+PtyTf 9UhFI/3L2SDIw3f6YDwvy2ERlDNQwM5XnwTtfSmlj00/4hW49Q+yjDrJLh6dwAKCjP0M MPHYERy4c9uS9o44hEtohPl4WdLDtPaWCTak7P23nBU8MR+8zsFOnTwCIQiwvs3u7Apy k1ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=65UwcxLtKdq/8Ak8DSxZdXNcam0ewUKmZJe8EBQ/38o=; b=QeaD70U4fBAC5x+yN8e37SalFR/gN07OzJp0TWnN14g9LhL4Nr28DQBr91rqwnCzSa heqli1D0SNR62tce52vlL8Op5iYv/29ZHhZM1n/+Wb653lxYjmyU/gkf9RM9vwOk8ql9 jUJ4EINFzA6GdHTSWJBXTZi3rtqgtsRMlW0X3RYCxCfjoi+EpjZhq215tp9J8wAFiYnA yo0Kq4ojV8K7GrqU8HEJVhWUlbNGpqPHeF2tXx9NNmcxigfLRVeVNnieTJc4e0k0E1mJ jPEQ9KoylZmS8B72d3QUWTzsj/Tpo47rrrJiA/QKyqIxne8DJlJW6CBALmOFErCPvTa+ E1bg== X-Gm-Message-State: AKwxytf3X5PTTY+KR6ar6S/xMJXPDy4XD+RRGt8VPGCPF5SNG251ehnc 7y78OOXrrWx1qV70Hcp1oMxX/A== X-Received: by 10.98.223.196 with SMTP id d65mr14826046pfl.176.1516844488093; Wed, 24 Jan 2018 17:41:28 -0800 (PST) Received: from jkicinski-Precision-T1700.netronome.com ([75.53.12.129]) by smtp.gmail.com with ESMTPSA id e7sm10899219pfj.44.2018.01.24.17.41.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jan 2018 17:41:27 -0800 (PST) From: Jakub Kicinski To: linux-kbuild@vger.kernel.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, oss-drivers@netronome.com, Jakub Kicinski Subject: [PATCH] kbuild: make Makefile|Kbuild in each directory optional Date: Wed, 24 Jan 2018 17:41:19 -0800 Message-Id: <20180125014119.31219-1-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is useful to be able to build single object files, e.g.: $ make net/sched/cls_flower.o W=1 C=2 Currently kbuild does a hard include of a Kbuild or Makefile for directory where that object would reside. Kbuild doesn't cater too well to multi-directory drivers, meaning such drivers will usually only use a single central Makefile. This in turn means it will be impossible to build most of object files individually for such drivers. Make the include of $dir/{Makefile,Kbuild} optional. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe --- I must admit I have no idea whose tree I should send this to :( Could it go via net-next if no one on linux-kbuild objects? scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 47cddf32aeba..178864f877d5 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -42,7 +42,7 @@ save-cflags := $(CFLAGS) # The filename Kbuild has precedence over Makefile kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) -include $(kbuild-file) +-include $(kbuild-file) # If the save-* variables changed error out ifeq ($(KBUILD_NOPEDANTIC),) -- 2.15.1