anonymoussuperuser wrote:
> I do have the make file to extract libraries into a
temporary folder but I
> can't read the directory listing into a variable to
include that in the
> final archive command?
When make runs a rule, it first expands all variables and
then runs the
command. What you've written is the equivalent of telling
make to run
this:
sh -c "cd ../bins; ls > ; ar cru libtarget.a "
That's nonsensical. In the context of the command being
executed there
is no means to access or modify any make variables --
they've already
been expanded at that point. But that's not a problem as
there's no
need to assign the object filenames to a variable. You
don't need any
"ls" here, just let the shell do it. If you had
typed "cd ../bins; ar
-cru libtarget.a *.o" at a regular shell prompt it
would have worked, so
just put that in your rule:
$: $
cd $;
ar -cru $ *.o
If for some reason you really need to get a list of
filenames from a
glob into a make variable then you can't do it by executing
commands in
a recipe, you have to use the make function $(wildcard).
Brian
_______________________________________________
Help-make mailing list
Help-make gnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
|