Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 2013 16:25:31 -0600
From:      Brooks Davis <brooks@freebsd.org>
To:        hackers@FreeBSD.org
Subject:   Re: Using bsd.prog.mk in a project with multiple binaries
Message-ID:  <20131106222531.GF91063@lor.one-eyed-alien.net>
In-Reply-To: <20131106164526.GV11443@kiwi.coupleofllamas.com>
References:  <20131106164526.GV11443@kiwi.coupleofllamas.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--oFbHfjnMgUMsrGjO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 06, 2013 at 08:45:26AM -0800, R. Tyler Croy wrote:
> Howdy, I'm trying to find some documentation or examples of using bsd.pro=
g.mk
> inside of a project with multiple binaries that need to get created. I'm =
able
> to shuffle the manpages and source code into directories to where each bi=
nary
> can have a Makefile, but I cannot find anything in the Developer's Handbo=
ok
> discussing such a project layout. E.g.:
>=20
>   -daemon.git/
>     -daemon/
>       daemon.man.1
>       daemon.c
>     -daemontool/
>       daemontool.man.1
>       daemontool.c
>=20
>=20
> Does one simply use a parent Makefile which calls into each directory? Or=
 is
> there some other .mk file with helpers for this?

You can use bsd.subdir.mk.  See usr.bin/clang for a somewhat complicated
example.

> A related question would be, does this even make snese as far as a
> project layout is concerned? This project I intend on creating a port
> for once it's further along, and I'd like to avoid painting myself
> into any cornners with the makefiles now if I can avoid it.

This seems plusable as a layout.  Note that while you need one Makefile
per program, you don't necessicairly need to spread the code out if you
don't want to.  If you'd rather keep the source files in one place you
can use .PATH: directives to access them from a central location.

-- Brooks

--oFbHfjnMgUMsrGjO
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iD8DBQFSesHaXY6L6fI4GtQRAh8iAKDJ04pNf+UQC+CM83KVRgJGfSoZnwCeKDqR
NEa0W0QkHicSWPZFe/aFuyg=
=9bxp
-----END PGP SIGNATURE-----

--oFbHfjnMgUMsrGjO--



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