Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Nov 2013 00:32:29 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        "freebsd-hackers@freebsd.org" <hackers@freebsd.org>
Subject:   Re: Using bsd.prog.mk in a project with multiple binaries
Message-ID:  <20131106233229.GA44585@onelab2.iet.unipi.it>
In-Reply-To: <20131106230636.GG91063@lor.one-eyed-alien.net>
References:  <20131106164526.GV11443@kiwi.coupleofllamas.com> <20131106222531.GF91063@lor.one-eyed-alien.net> <CA%2BhQ2%2Bi24Jtn05gF8wjNNXNs-whBtcR8MPbBaG6VpXzEijE7eg@mail.gmail.com> <20131106230636.GG91063@lor.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 06, 2013 at 05:06:36PM -0600, Brooks Davis wrote:
> On Wed, Nov 06, 2013 at 02:33:01PM -0800, Luigi Rizzo wrote:
> > On Wed, Nov 6, 2013 at 2:25 PM, Brooks Davis <brooks@freebsd.org> wrote:
> > 
> > > 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.prog.mk
> > > > inside of a project with multiple binaries that need to get created. I'm
> > > able
> > > ...
> > > 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.
> > >
> > 
> > Since I have had a similar problem in the past...
> > i am also under the impression that those Makefile must be
> > in different directories -- am i wrong ?
> > (in this case having all the sources in a single place does
> > not help too much; and I'd rather have a single Makefile
> > to handle a small set of closely related programs)
> 
> The Makefiles do need to be in different directories since they need to
> be called Makefile.  I suppose you could hand roll a toplevel Makefile
> that called a series of Makefile.prog1, Makefile.prog2, etc files, but
> that seems not very useful.

right.
I was hoping that someday we could have support in bsd.prog.mk
to handle multiple program names in ${PROG}, perhaps expanding
the dependencies using OBJS.prog1 OBJS.prog2 ... etc

.for i in ${PROG}
${i}:	${OBJS}.$i
.endfor

(i know it is more complex than this, with PROG_FULL and LDADD,
LDFLAGS and CFLAGS which may also be per-program)

cheers
luigi





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