Roman,

On 23/1/2007, "Roman Neuhauser" <[EMAIL PROTECTED]> wrote:

>> KEYLIST := keylist.txt
>> DEPS := $(wildcard *.txt)
>> FILES := *.txt
>>
>> $(KEYLIST): $(DEPS)
>> grep ^keywords $(FILES) > $@
>
>Why is it so roundabout about $(DEPS)/$(FILES)? The target *actuall*
>depends on different files than those declared in the sources list!
>What does $(DEPS) (and $(FILES)) contain?
>This is what your Makefile does, BTW:
>  grep ^keywords keylist.txt ... > keylist.txt

Sorry my fault, I decided to change the filename extensions of DEPS+FILES
to *.txt before posting without noticing they became same as KEYLIST.

$(DEPS) !== $(FILES) as wanted pass '*.txt' to grep rather than every
individual filename.

>Try it with this instead (rename keylist.txt to key.list), but make sure
>you have at least one file ending in .txt in that directory first!):
>
>KEYLIST := key.list
>FILES := $(wildcard *.txt)
>
>$(KEYLIST): $(FILES) ; grep '^keywords' $^ > $@

Ok, tried that, still same problem. it works running make from
commandline, but not from PHP using exec, or shell_exec, or system.
It's the redirection which does not work for some reason. I'm
temporarily displaying output in PHP from make, so can see that
grep is grepping, but not redirecting to the target.

Cheers,
James.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to