NetBSD/lib/Makefile.inc
lukem 124613b27e Implement DEPLIBS (in Makefile.inc for now), which adds all the listed
libraries to LDADD & DPADD for the current library, using -L OBJDIR-of-DEPLIB
so that the current library can link with the DEPLIB library built but
not installed.

Set DEPLIBS appropriately, rather than explictly adding LDADD/DPADD
for various libraries.

Reorder library build order so that libraries that depend upon any
other library are built at the end.


Whilst this change could be done in a more generic manner (and I
intend to work on that), it does remove the need to implement
top-level build targets such as "do-lib-des" (etc).
2004-07-30 07:02:53 +00:00

19 lines
436 B
Makefile

# $NetBSD: Makefile.inc,v 1.4 2004/07/30 07:02:53 lukem Exp $
WARNS?= 2
WFORMAT?= 2
.if ${MKPIC:Uno} != "no"
.if defined(DEPLIBS)
.for _lib in ${DEPLIBS}
.if !defined(DEPLIBOD.${_lib})
DEPLIBOD.${_lib}!= cd ${.CURDIR}/../lib${_lib} && ${PRINTOBJDIR}
.MAKEOVERRIDES+= DEPLIBOD.${_lib}
.endif
LDADD+= -L${DEPLIBOD.${_lib}} -l${_lib}
DPADD+= ${DEPLIBOD.${_lib}}/lib${_lib}.so
.endfor
.endif # defined(DEPLIBS)
.endif # MKPIC != no