Re: exec('make') Q
| From: | james at jwm-art dot net | Date: | Tue, 23 Jan 2007 18:35:28 +0000 |
| Subject: | Re: exec('make') Q | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247631@lists.php.net to get a copy of this message | ||
Roman,
On 23/1/2007, "Roman Neuhauser" <neuhauser@sigpipe.cz> 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.