From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 1 11:31:55 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A84B1065677 for ; Mon, 1 Dec 2008 11:31:55 +0000 (UTC) (envelope-from fbsd.hackers@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 64FD98FC17 for ; Mon, 1 Dec 2008 11:31:55 +0000 (UTC) (envelope-from fbsd.hackers@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id AB819AFC1C6; Mon, 1 Dec 2008 02:31:54 -0900 (AKST) From: Mel To: freebsd-hackers@freebsd.org Date: Mon, 1 Dec 2008 12:31:51 +0100 User-Agent: KMail/1.9.7 References: <711D7381-D852-4B6B-991A-84BA6DEFB679@gmail.com> <49332E5C.9020303@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200812011231.52262.fbsd.hackers@rachie.is-a-geek.net> Cc: Nikola =?utf-8?q?Kne=C5=BEevi=C4=87?= Subject: Re: How to build kernel module spread on subdirectories? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 11:31:55 -0000 On Monday 01 December 2008 12:08:13 Nikola Kne=C5=BEevi=C4=87 wrote: > On 1 Dec 2008, at 01:22 , Tim Kientzle wrote: > >> .MAKEFILEDEPS: elements.mk > >> .sinclude "elements.mk" > >> .include > >> --->8--- > >> When I run make depend, it only includes SRCSs from BSDmakefile, > >> not those from elements.mk. > > > > I would try adding a "beforedepend" requirement: > > > > beforedepend: elements.mk > > > > Look at /usr/share/mk/bsd.dep.mk, which has the 'make depend' > > logic. It supports optional "beforedepend" and "afterdepend" > > targets. > > Hi Tim, > thanks for the tip. > > I've tried adding beforedepend: elements.mk rule before .sinclude. > > Unfortunately, everything is the same still. Is there a way to force > explicitly what .MAKEFILEDEPS? beforedepend will create elements.mk, > but that file won't be re-read and included before depend is called. Does it have to be generated? What's the contents of that file after=20 generation and what generates it? As you discovered, includes are done before targets. You would need seperat= e=20 invocations of make, to generate the file and get it included. Maybe this will work, tho I doubt it (I expect the include to screw with th= e=20 beforedepend target): beforedepend: =2Eif !exists(${.CURDIR}/elements.mk) ${MAKE} ${MAKEFLAGS} -f ${MAKEFILE} genmk =2Eendif =2Eif exists(${.CURDIR}/elements.mk) =2Einclude "${.CURDIR}/elements.mk" =2Eendif genmk: # do whatever here to generate the mk file =2D-=20 Mel