How to express inter-directory dependencies in <bsd.*.mk>
infrastructure?
mdf at FreeBSD.org
mdf at FreeBSD.org
Sun Oct 30 16:11:45 UTC 2011
2011/10/30 Lev Serebryakov <lev at freebsd.org>:
> Hello, Hackers.
>
> (SORRY FOR SENDING INCOMPLETE MESSAGE)
>
> How to express inter-directory dependencies in <bsd.*.mk> infrastructure?
>
> I have project, which has two subdirectories: "lib" and "bin".
> Top-level Makefile is simple one, looks like this:
>
> ===================================
> SUBDIR= lib \
> bin
>
> .include <bsd.subdir.mk>
> ===================================
>
> "lib" subdirectory has Makefile with "<bsd.lib.mk>" included, and
> "bin" -- with <bsd.prog.mk> included.
>
> But 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
More information about the freebsd-hackers
mailing list