> > Try the following test case:> > testrule:> touch test> echo $(wildcard
> > test)> > The echo command will not output anything (at least, if 'test'
> > didn't> exist when make started.
That's because, when deciding to make a rule, make expands ALL variables in ALL
commands for that rule prior to executing the first command. Not as you have
thought: expand variables in first command, execute first command, then go on
for next command.
However, I have no idea why the make author chose the first way instead of
"expand one command, execute one command". The official make manual seems not
to have explained this.
> > > testrule:> touch test> if [ -f test ] ;\> then \> echo "test exists" ;\>
> > > fi>
Yes, I'm now working around like this, thanks again.
> Does anyone else know a better way of handling this?> > Regards,> Kristof
_________________________________________________________________
Windows Live Spaces 中最年轻的成员!
http://miaomiaogarden2007.spaces.live.com/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make