Subject: Re: BSD .mk files and multiple programs
To: Simon J. Gerraty <sjg@crufty.net>
From: Harlan Stenn <Harlan.Stenn@pfcs.com>
List: tech-userlevel
Date: 11/29/2002 18:09:39
> >Could I snarf you stuff/chagnes? The amount of stuff I found on google was
>
> My changes are in NetBSD's make.
As in "already committed to NetBSD's make"? If not, could I get a copy?
> 700 makefiles written using automake? presumably so the project can be
> build on multiple disparate systems? Interesting...
"Interesting" does not even begin to describe this project...
> >On a related topic, I could automate this better if "make" had a way to tell
> >me the names of all of the global variables, and if there was a way to
> >select (based on either regexp or glob/fnmatch) names from that list.
>
> Not sure how that would help, but you can use
> `make -ndv | grep Global:` to get a list.
Too slow. My goal (at the moment) is to have Makefile's contain information
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 _DATA
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:
.for v in fnmatch("*_PROGRAMS",names())
# grab the prefix, look up XXXdir for the destination directory
# create the rules for the target
.endfor
and then the same for other "primaries" (like SCRIPTS, DATA, MANS, INCLUDES,
LIBRARIES, ...).
Yes, it will be Lots more complicated...
H