[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with gmake.
From: |
Paul D. Smith |
Subject: |
Re: Help with gmake. |
Date: |
11 Jul 2002 00:50:05 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
%% address@hidden (Brian Bruinewoud) writes:
bb> LIB-NAMES = A B
bb> LIB-A-OBJS = a.o ma.o
bb> LIB-B-OBJS = b.o bl.o
bb> LIBS: $(patsubst %, lib%.a, $(LIB-NAMES))
bb> lib%.a: $(LIB-%-OBJS)
bb> When I discovered that this didn't work, I tried various other
bb> ways to get similar functionality, such as using $(foreach...) to
bb> generate the rules, etc.
If you get a newer version of GNU make and check out the manual section
on "How 'make' Reads A Makefile" you'll see why the above does not
work.
bb> None of them worked. Is there some way to get this functionality?
In the currently released versions (latest is 3.79.1), the only way to
do it is by including a makefile which defines these values. You can
write a make rule to construct the makefile, then make will
automatically build that makefile when it's out of date, and
automatically re-exec itself to read the new data.
In the next version of GNU make, to be released "RSN", there will be
direct support for a feature that will allow this. But it won't work as
you've tried it above.
bb> $ gmake --version
bb> GNU Make version 3.75, by Richard Stallman and Roland McGrath.
Ouch. That's old.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
- Help with gmake., Brian Bruinewoud, 2002/07/11
- Re: Help with gmake.,
Paul D. Smith <=