Received: by 10.223.176.5 with SMTP id f5csp1038015wra; Sat, 27 Jan 2018 14:30:06 -0800 (PST) X-Google-Smtp-Source: AH8x224HervP2mAy4Ko1acoVqnFaqNUfKvNb2atdNeQyBxqS2V1KfytGs5lbLwHKDFp2D/3llxvM X-Received: by 2002:a17:902:8c87:: with SMTP id t7-v6mr3949319plo.205.1517092206226; Sat, 27 Jan 2018 14:30:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517092206; cv=none; d=google.com; s=arc-20160816; b=KaLDY1ARmOsAIYYzRWEDnqkJIzwB7AvK7u9CUB0S9Bn8tKpRyqBK6HRO6FL/Jjugfq zOuiNmzkWxQbdUQK65Z9uIA/xgGkYbAZ9ErBmEqmeWIW4NYmy4aelsleDla/nIJR1icJ faX2YqyOdip9YLM+6sYW1GJ9MDB35/KujStEbwI8h8hfdbzIfbk3h78vUQJQe8dqTceg d5JXnwIKjnn3Wmu7tHsrq7FNnmrOaPf0SqhZWaPIYglRvtUSYR2juW4Y+jYLLaaO8xWx cGqZWQVERQv5+lcqnsySzHGpvPWqvJqyjKw+ftUFp13fA08yfrE806hEaeNxNqZBm9pV 6TvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=SwBT3zQpAC+GGUirPOTcxuiYPNxk8f6Ta1aikV+MlUE=; b=kNuiFJ2Kk3DnCBTtkauyFSvYhgN4TzPQKT4QU0nkVJTWT/8Be0AIITESyB4x0tiGcr BIBFaFlPFdK1SWnHC+PywcPGLG90PGgtZe/g33poywRxemr0FchaAB4TtGR8hAqT+2HD wNGh2yd9KYcJlaWhhkcNW+0OkjSHH61P3KoeKDXSiqReDo6uf+tjBKDHqHETNPFn+Nmk X0Y+F9sF0bvTldkvP3+0LuO0Ovn94a/qiSRDpjMPH2y/QIMFemt/kUH38N0KivOOYgje PAZNPS0dNQl3ELw/kybO4zb0PJV1YoxEyyrztEsghzI+ZD27VbczFMGp57HnB+xe5xyF yGTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NRpGHDjN; 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 b35-v6si5892303plh.618.2018.01.27.14.29.51; Sat, 27 Jan 2018 14:30:06 -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=NRpGHDjN; 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 S1752954AbeA0W2z (ORCPT + 99 others); Sat, 27 Jan 2018 17:28:55 -0500 Received: from conssluserg-05.nifty.com ([210.131.2.90]:34672 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbeA0W2x (ORCPT ); Sat, 27 Jan 2018 17:28:53 -0500 Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com [209.85.213.43]) (authenticated) by conssluserg-05.nifty.com with ESMTP id w0RMSjTl001179; Sun, 28 Jan 2018 07:28:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com w0RMSjTl001179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1517092125; bh=SwBT3zQpAC+GGUirPOTcxuiYPNxk8f6Ta1aikV+MlUE=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=NRpGHDjN//VtED+85kTJA3T0H5swliPfRU9fco7WMpoDbf/pyq7p9rdaV1YtgERti pwi9T9eJqVoKrZ2bp8v4yNa5FL58mBvs1cB1EHhycg+GeibDR0k6ubtwR+GIDMhcBu 4VEWH2xmWNHuE+X/zaTuMh+ySI+kmZhbwRKHs+I29SMhVG2GHujMCpSeR1qMlXTenP t3IVCTuGpmMNFY4sWmSjcR+IrtZkOdnKvm6zenZCc8ePPFKAr3iqD1CO4s06kCtrD1 8jIkhpJ+vnowN6tJQBEtr5tA+mQ4BqJYe4vjQ4nyoHjp8a5mGWEbslUHc6mGM2bN3P 8B9Bru4oZl6Vw== X-Nifty-SrcIP: [209.85.213.43] Received: by mail-vk0-f43.google.com with SMTP id w201so2391073vkw.0; Sat, 27 Jan 2018 14:28:45 -0800 (PST) X-Gm-Message-State: AKwxytdjk0NkCKtkQG/4tlvr95F5nlVMnvNTBuH+VOg7Ql9rQKi2tQs8 Tbqu5be/IsuTjiEj47QRANT1s27WBQ5Tcl14FTQ= X-Received: by 10.31.214.196 with SMTP id n187mr14510478vkg.25.1517092124531; Sat, 27 Jan 2018 14:28:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.49.90 with HTTP; Sat, 27 Jan 2018 14:28:04 -0800 (PST) In-Reply-To: <20180125114740.076b7583@cakuba.netronome.com> References: <20180122134607.00d77101@cakuba.netronome.com> <20180125114740.076b7583@cakuba.netronome.com> From: Masahiro Yamada Date: Sun, 28 Jan 2018 07:28:04 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Mutli-directory module Makefiles To: Jakub Kicinski Cc: Linux Kbuild mailing list , LKML , Sam Ravnborg Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-01-26 4:47 GMT+09:00 Jakub Kicinski : > On Thu, 25 Jan 2018 22:08:34 +0900, Masahiro Yamada wrote: >> 2018-01-23 6:46 GMT+09:00 Jakub Kicinski : >> > Hi! >> > >> > in drivers/net/ethernet/netronome/nfp there is a module which is built >> > from C sources in 4 directories. What is the best way to handle that? >> > >> > Currently we just add all the objects in one Makefile: >> > >> > nfp-objs := \ >> > nfpcore/nfp6000_pcie.o \ >> > nfpcore/nfp_cppcore.o \ >> > etc. >> >> >> I recommend you to refactor the Makefile, >> adding Makefiles into nfpcore, nic, flower, bpf sub-directories. >> >> >> Also, ifeq is ugly, >> can you rewrite like follows? >> >> >> nfp-$(CONFIG_NFP_APP_FLOWER) += flower/ >> nfp-$(CONFIG_BPF_SYSCALL) += bpf/ >> nfp-$(CONFIG_NFP_DEBUG) += nfp_net_debugfs.o > > I tried that, but what do I build inside the directories? I tried > adding the objects to nfp-objs, building a lib.a, or trying to build a > separate object, but it's either ignored or dependency is not obeyed > and nfp.o complains that the subdirectory object doesn't exist yet > when the build of subdirectory finishes later :( > > Sorry for not spotting your response earlier! It went into Spam for > some reason :S > Sorry, I was misunderstanding. The notation I suggested is not supported for composite objects (like nfp-objs, nfp-y). The only solution is to move all files to the same directory, as Sam pointed out. -- Best Regards Masahiro Yamada