Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2008 12:31:51 +0100
From:      Mel <fbsd.hackers@rachie.is-a-geek.net>
To:        freebsd-hackers@freebsd.org
Cc:        Nikola =?utf-8?q?Kne=C5=BEevi=C4=87?= <laladelausanne@gmail.com>
Subject:   Re: How to build kernel module spread on subdirectories?
Message-ID:  <200812011231.52262.fbsd.hackers@rachie.is-a-geek.net>
In-Reply-To: <D6756955-6E0B-429A-9216-2CF223D503D7@gmail.com>
References:  <711D7381-D852-4B6B-991A-84BA6DEFB679@gmail.com> <49332E5C.9020303@freebsd.org> <D6756955-6E0B-429A-9216-2CF223D503D7@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <bsd.kmod.mk>
> >> --->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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812011231.52262.fbsd.hackers>