Received: by 10.223.176.46 with SMTP id f43csp2563147wra; Thu, 25 Jan 2018 11:49:00 -0800 (PST) X-Google-Smtp-Source: AH8x2272hqEut8fTVJuPWbTk0BmwbyjeECmlD9HrzDnZd96IwSF1QVtVvcG3z5FOE/yzngvE0UqJ X-Received: by 10.101.102.3 with SMTP id w3mr13915242pgv.326.1516909740706; Thu, 25 Jan 2018 11:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516909740; cv=none; d=google.com; s=arc-20160816; b=M+bktDdmhTypUYSRanEV27jl+CYU9sxA3LIZ3RsS7wWjwZINjFPDgmN82emOF/0iEY zaJbc4h5noVtAX8XFePsWfN9IaTybDmeqhdCchW5wGzgmPYqOEIyfTi3rRVSjjkqTXyD 2zUX3Q/2/Maekd+5PF/Hx5vDtFEvkXzPoiGYfPW5r29BdiQipTcN84Ckp+0d1SMZuCh+ RtQeU35+NJLktHyKJU7+Iy6C14icRlnZd3SQ0SCatNgfGw+TK+HECxBF4gdNmEkVQx24 U51JP2woyfHzMrCA/2hI6RjWZIegS/8iXj/tItfGj0/2GM5zUkSnO1PYL/KzfwiBMi6q qAkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=agignghDldxLFsQabScU1hFtavFWpxyO035xylIUiZg=; b=DKNQuDekDnujzPFoJD0sOvXg7Uc1pKOLQbaEok19Q6jEJ29YxFI+ugUZxTPNwJwZ51 zRSFsggz1l0Ip7ru1xYaI2l0jC7w13vzry8aOID4NdzsFYIjIeXVkaf0PIlopFgYwlwL Y95CaYXkHDDwYko0rzZPOkVYcmTR7wkknS7h1CRAxmhF6XYLTkWfNlhdbX5UlmmOGt+N ymXKy+qLnfA+uwU1f90Gb2NAM3Y9Qb+sv5vDsURH5p+JjU5Fmuvv7Ddb+z/wZ6DRo2Tc XZ0UGt0s0gcKuUpWFOrsXlaX5woi6c0tzEXrAfhXqoMFQkOFreJhfKVt7PhHz7mS68qb sUPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=sX8N218L; 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 x15si1955010pgq.25.2018.01.25.11.48.45; Thu, 25 Jan 2018 11:49:00 -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 (test mode) header.i=@wp.pl header.s=1024a header.b=sX8N218L; 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 S1751303AbeAYTrv (ORCPT + 99 others); Thu, 25 Jan 2018 14:47:51 -0500 Received: from mx4.wp.pl ([212.77.101.12]:35982 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108AbeAYTrt (ORCPT ); Thu, 25 Jan 2018 14:47:49 -0500 Received: (wp-smtpd smtp.wp.pl 11493 invoked from network); 25 Jan 2018 20:47:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1516909666; bh=agignghDldxLFsQabScU1hFtavFWpxyO035xylIUiZg=; h=From:To:Cc:Subject; b=sX8N218LhGnxluPBuiTY9UFOaJB9zSUpCwzMvUVHCZx+k01fFTGX6BWLu1bOFXc5y JOYOEltByoIhvrnIdTqvht19urb8g4wVNZWQv41LxgqX8nUSwgooBJWTb0l3EcEKjM VibUcnU4f79extnMDQ71SxeLp5HvPTykUJgse0Io= Received: from unknown (HELO cakuba.netronome.com) (kubakici@wp.pl@[75.53.12.129]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 25 Jan 2018 20:47:45 +0100 Date: Thu, 25 Jan 2018 11:47:40 -0800 From: Jakub Kicinski To: Masahiro Yamada Cc: Linux Kbuild mailing list , LKML Subject: Re: Mutli-directory module Makefiles Message-ID: <20180125114740.076b7583@cakuba.netronome.com> In-Reply-To: References: <20180122134607.00d77101@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-WP-MailID: 0bc9c548558eaba44349c8963e87aa6d X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000A [wVNU] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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