ports makefile stuff (bsd.lib.mk)

Jim Stapleton stapleton.41 at gmail.com
Fri Feb 8 13:51:59 UTC 2008


> first of all, /usr/share/mk/bsd.lib.mk is part of the FreeBSD system make
> files, not just the ports. So if you change something there, you will almost
> certainly break your buildworld and buildkernel.

Depends on what you add, but for the most part, yes, I agree that is likely.

> On Wednesday 06 February 2008 16:49:46 Jim Stapleton wrote:
>
> > 1) Initially, this library will actually build several sublibraries.
> > To keep my code neat, each library has it's own source directory.
>
> So you set SUBDIR.

That was background not a question. I managed that part. (I think it
was from the zipped make tutoral suggested by the man page or ports).


> [...]
>
> Objects are put in OBJDIR. If you have not set MAKEOBJDIRPREFIX in the
> environment, this will default to ${.CURDIR} and give you a warning.

That is exactly what I was looking for. Thank you.

Roughly speaking, under src/, I had backends/[SHLIB_NAME]/,
frontends/[BIN_NAME], objs/, and include/. I wanted to build
everything into objs/, that way I only needs the ldflags to have
"-L../../objs", rather than "-L../foo -L../bar", where foo and bar
vary from app to app.

Thanks,
-Jim Stapleton


More information about the freebsd-questions mailing list