Subject: Re: BSD .mk files and multiple programs
To: Harlan Stenn <Harlan.Stenn@pfcs.com>
From: Harlan Stenn <Harlan.Stenn@pfcs.com>
List: tech-userlevel
Date: 11/29/2002 19:57:12
> > >Too slow.  My goal (at the moment) is to have Makefile's contain informati
> on
> > >very similar to an automake's Makefile.am, which means:
> > >
> > > bin_PROGRAMS = foo1 foo1
> > > foo1_SOURCES = ...
> > > foo1_CFLAGS = ...
> > > foo2_SOURCES = ...
> > > foo2_LDADD = ...
> > >
> > > noinst_LTLIBRARIES = libabc.la libdef.la
> > > libabc_la_SOURCES = ...
> > > libdef_la_sources = ...	(Needs work - I don't want to require libtool)
> > >
> > > htmldir = ${Prefix}/share/html
> > > html_DATA = index.html
> > >
> > >and when I "make install" everything gets built and the _PROGRAMS and _DAT
> A
> > >targets are properly installed.
> > >
> > >I believe (but do not know) that using a shell loop to get the variables
> > >will be Slow; I suspect I will want to automate a loop that would do
> > >something like:
> > 
> > You don't need to know all the var names.  They are provided for you
> > in a couple of well know vars.  
> 
> I'm not so sure.  html_DATA, for example, is not known ahead of time.
> That's why the "htmldir=..." is needed.
> 
> While the primaries are know, the "prefix" says where it will be installed.
> And a single makefile may have {bin,sbin,noinst,XXX}_PROGRAMS specified.
> 
> XXX can be almost anything, as long as XXXdir=... has been specified.

OK, I guess it wouldn't be a horrible hack if one had to specify additional
"destinations" using +=, which would probably be a useful work-around.

IE:

DESTINATIONS += html

htmldir=whatever
html_DATA=...

> Furthermore, it is Difficult do define new PRIMARIES {PROGRAMS, DATA,
> SCRIPTS, etc.} in automake; I'm looking for a way to make this easier.

Perhaps the same could be done here:

PRIMARIES += KMODS
noinst_KMODS= kernelmodule1.o

.include kmods.mk

Much to chew on...

H