Re: Equivalent of recursive make with meson/ninja?

On Sat, Feb 11, 2017 at 07:03:01PM +0530, Nirbheek Chauhan wrote:
On 11-Feb-2017 18:32, "Sébastien Wilmet" <swilmet gnome org> wrote:
It'll also relink all the tests and rebuild the docs (GTK-Doc is very

Fwiw, it won't rebuild the docs since that is done at install time, not at
compile time.

That is a strange thing to do, building something at install time.

I often do:
$ cd docs/
$ make clean
$ make

to see if there are any warnings. If it's mixed up with install output,
it's far less convenient.

And thanks to builddir == srcdir, I often do:
$ cd docs/reference/
$ vi -o <gtk-doc-section-file> <gtk-doc-unused-file>

to move the symbols from the 'unused' file to the section file.

<gtk-doc-section-file> is in scrdir while <gtk-doc-unused-file> is in
builddir. The names of those files are different for each project
(although it's probably possible to use globs).

But these are just examples, `touch file.c && make` was another example.
I probably do other similar things (more rarely, without even being
aware of it) thanks to recursive make and builddir == srcdir. Basically
each time I want to open a built file, I'm usually already in the good

It also won't relink all the tests if you specify a target
(an executable, library, etc) to build. You can also rebuild a specific
file by specifying the corresponding .o file, and I'm sure that can be made
more convenient with a wrapper tool.

I think your use-case can even be improved by writing such a tool that will
rebuild only a specific file. This would actually be faster than make even
because it wouldn't relink anything in that directory unless you want it

Would you like to take a shot at it? It's really simpler than it might
seem. Just a matter of reading the compiler db (json file) and calling
ninja with the right argument. :)

IMO this is one of the major advantages of Meson. It actually provides an
API that you can use to support and even improve your custom workflows.

Mmh, yes, maybe.


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