Re: exec('make') Q

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roman,

On 23/1/2007, "Roman Neuhauser" <neuhauser@xxxxxxxxxx> 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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux