On 11/15/11 13:41, Paul Smith wrote:
On Tue, 2011-11-15 at 13:30 -0800, Bryan Ischo wrote:
.SECONDEXPANSION:
all: foo.a
%.a: $$(@:%.a=%.o)
An infinite loop is bad, sure; I'll check that out. But why don't you
just write:
all: foo.a
%.a: %.o
??? There's no need for secondary expansion here.
It's just a demonstration of the problem, and the most succinct one I
could find.
What I am really trying to do is something like this:
all: lib/libfoo.a lib/libfoo.so lib/libbar.a lib/libbar.so
%.o: %.c
gcc -o %@ -c $^
%.po: %.c
gcc -fPIC -o %@ -c $^
%.a: $$($$(basename $$(notdir $$@))_COMPONENTS)
ar crv $@ $^
%.so: $$($$(basename $$(notdir $$@))_COMPONENTS:%.o=%.po)
gcc -shared -o $@ $^
libfoo_COMPONENTS = foo.o foo2.o
libbar_COMPONENTS = bar.o
I have also tried this to get around the hang:
%.so: $$(patsubst %.o,%.po,$$($$(basename $$(notdir $$@))_COMPONENTS))
gcc -shared -o $@ $^
But the patsubst doesn't seem to work right; it doesn't substitute anything.
Thanks!
Bryan
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make