> Le 15 mai 2020 à 18:03, Fr. Samuel Springuel <address@hidden> a écrit :
>
>> On 15 May, 2020, at 3:43 AM, Valentin Villenave <address@hidden> wrote:
>>
>> On 5/15/20, Fr. Samuel Springuel <address@hidden> wrote:
>>> Before I start writing a script to do this, is there an existing
tool which
>>> will identify all the `\include` files that a LilyPond file depends on?
>>> Even better, one that will work in a recursive fashion?
>>
>> Since 2.19.39, you can simply use this:
>>
>> #(display (ly:source-files))
That's good! I didn't know you could do that.
>>
>
> I’m hoping for something that doesn’t require actually typesetting the
> document. My end goal is a script which will somewhat intelligently
> determine which files in a project have changed and re-typeset them as
> needed. Having to typeset the document in order to determine which
files it
> depends on means I’ve already done the typesetting. Is there a way
to pass
> that and \set Score.skipTypesetting = ##t at the command line?
Elsewhere in this thread, there are useful comparisons between C/C++
source and Lilypond source. Also there's the suggestion of using 'make'
to express dependencies.
For C/C++, there is an excellent discussion of the issues about
automatically producing dependencies and dealing with them in make:
http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
I think much of this is relevant to lilypond too. There's even a section
entitled "Dependencies for non C files".
With regard to wanting to avoid typesetting when you want to produce
only the dependencies, this section discusses how to set up a makefile
to use dependency information that is created as a side-effect of
compilation:
http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#combine
I know I would find it useful if some of the dependency generation flags
(-MMD, -MF, -MP, -MF , see
https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html) available
on C/C++ preprocessor were implemented in lilypond. The work discussed
in this thread might be paving a path towards that.
Lilypond can produce multiple output files:
One difference between C/C++ compilers and lilypond is that where a C
compiler produces exactly one .o file for each .c file, lilypond can
generate several output files e.g. .pdf and .midi, but there are other
examples too - I sometimes produce a separate .png for each page of a
score. And I expect that the set of output files may depend on the
lilypond command line options, and not just on the .ly file on which it
is being run.
Is there a way to get lilypond to output this list of targets, analogous
to the ly:source-files capability?
I think in most cases, the issues around multiple targets can be ignored
but there may be some cases where a full solution would need to handle
them ... more thought required.
Matt