Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Oct 2011 09:11:43 -0700
From:      mdf@FreeBSD.org
To:        lev@freebsd.org
Cc:        hackers@freebsd.org
Subject:   Re: How to express inter-directory dependencies in <bsd.*.mk> infrastructure?
Message-ID:  <CAMBSHm_%2B4C33Ej_SxEF19RmAchMebnU%2BtYp6-TaNXWwp4B6CDg@mail.gmail.com>
In-Reply-To: <627176903.20111030200150@serebryakov.spb.ru>
References:  <627176903.20111030200150@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/10/30 Lev Serebryakov <lev@freebsd.org>:
> Hello, Hackers.
>
> =A0(SORRY FOR SENDING INCOMPLETE MESSAGE)
>
> =A0How to express inter-directory dependencies in <bsd.*.mk> infrastructu=
re?
>
> =A0I have project, which has two subdirectories: "lib" and "bin".
> =A0Top-level Makefile is simple one, looks like this:
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> SUBDIR=3D lib \
> =A0 =A0 =A0 =A0bin
>
> .include <bsd.subdir.mk>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> =A0"lib" subdirectory has Makefile with "<bsd.lib.mk>" included, and
> =A0"bin" -- with <bsd.prog.mk> included.
>
> =A0But how could I express, that PROG in bin depends on LIB from lib, to
> cause rebuilding of PROG when LIB is changed (when I call "make" on
> top level)?

Normally I'd expect the dependency to be handled by make depend; that
is, the source for the binary should be #including header files from
the library.  If the interfaces change, make depend will handle this.

I guess the problem comes if you are using static linking and just
implementation details internal to the library change.

There is a DPADD makefile variable that seems to be used; I'm not sure
though if this handles the type of dependency you're wanting.

Cheers,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMBSHm_%2B4C33Ej_SxEF19RmAchMebnU%2BtYp6-TaNXWwp4B6CDg>