Process all file from current directory

26 views
Skip to first unread message

xancorreu

unread,
Apr 26, 2012, 8:21:43 AM4/26/12
to ninja...@googlegroups.com
Hi another time,

I read the manual, but I can't find how to process a set of files with
specific matching name. I'm interested in all files with .o extension in
the directory mydirectory.

Something like:

rule cc
command = clang++ -o $out $in
description = Execuciᅵ de clang++ (thanks for the patch ;)

build mydirectory/[file].out: cc mydirectory/[file].cpp


Is it possible? How can I do that?

Thanks in advance,
Xan.

Elazar Leibovich

unread,
Apr 26, 2012, 9:31:19 AM4/26/12
to ninja...@googlegroups.com
It is not possible by design, the "ninja-way" is to write a script that generate ninja build file with all files in the directory. See  http://martine.github.com/ninja/manual.html 

On Thu, Apr 26, 2012 at 2:21 PM, xancorreu <xanc...@gmail.com> wrote:
Hi another time,

I read the manual, but I can't find how to process a set of files with specific matching name. I'm interested in all files with .o extension in the directory mydirectory.

Something like:

rule cc
 command = clang++ -o $out $in
 description = Execució de clang++ (thanks for the patch ;)

xancorreu

unread,
Apr 26, 2012, 10:49:30 AM4/26/12
to ninja...@googlegroups.com
Al 26/04/12 15:31, En/na Elazar Leibovich ha escrit:
A pain for me, so.

Thanks,
Xan.

Elazar Leibovich

unread,
Apr 26, 2012, 11:15:16 AM4/26/12
to ninja...@googlegroups.com
Look at gyp or CMake, both have ninja output, and both can describe "compile all files that matches the glob expression to a binary".

Evan Martin

unread,
Apr 26, 2012, 11:15:19 AM4/26/12
to ninja...@googlegroups.com
If it helps any, look at the build.ninja used by Ninja itself:
http://martine.github.com/ninja/build.ninja.html

As Elazar said, you should generate it with a script.

On Thu, Apr 26, 2012 at 5:21 AM, xancorreu <xanc...@gmail.com> wrote:
> Hi another time,
>
> I read the manual, but I can't find how to process a set of files with
> specific matching name. I'm interested in all files with .o extension in the
> directory mydirectory.
>
> Something like:
>
> rule cc
>  command = clang++ -o $out $in
>  description = Execució de clang++ (thanks for the patch ;)
Reply all
Reply to author
Forward
0 new messages