Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 1997 22:42:34 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        asami@vader.cs.berkeley.edu, bde@zeta.org.au
Cc:        ports@freebsd.org, pst@freebsd.org
Subject:   Re: yale-tftpd build failure in -current
Message-ID:  <199704251242.WAA29532@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
> * Seems unlikely.  Ports makefiles don't use bsd.prog.mk or bsd.lib.mk,
> * right?  I don't intend to merge anything except important bug fixes into
> * 2.2.
>
>This port does:

Urk.  I wonder what it thought of the obj changes.

>===
>## cat Makefile
>...
>classes/libclasses.a:
>        (cd classes ; make)
>
>SUBDIR= classes
>DPADD+= classes/libclasses.a
>LDADD=  classes/libclasses.a
>
>.include <bsd.prog.mk>
>===

The problems are that SUBDIR is misused and DPADD is no longer supported.

SUBDIR doesn't work right because ${PROG} is built in the top-level
(object) directory before the subdirectories are built.  Libraries should
be built first by putting the program directory in SUBDIR after the
library directories (this gives the worse wart that `make' won't know
how to build the library unless `make' is invoked at the top level, but
works well in practice).

DPADD is supposed to be no longer necessary.  dependencies on libraries
are generated automagically by `make depend'.  `make depend' wasn't run,
so there were no dependencies on libraries, so classes/libclasses.a
wasn't built.

Fix: just give the dependency explicitly:

${PROG}: classes/libclasses.a

There is one good reason why DPADD was used instead of giving dependencies
explicitly: dependencies such as

${PROG}: ${LIBUTIL}

don't work because LIBUTIL is defined in bsd.prog.mk which is normally
included last, so ${LIBUTIL} is normally null at the time when dependencies
are evaluated.

Bruce



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