lilypond-user
[Top][All Lists]
Advanced

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

Re: Identify included files


From: antlists
Subject: Re: Identify included files
Date: Mon, 18 May 2020 17:22:35 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0



On 18/05/2020 15:29, Fr. Samuel Springuel wrote:
On 18 May, 2020, at 9:37 AM, antlists <address@hidden> wrote:

define trombone-notes.ly as a target, define it as changed if its dependencies change, 
and say "it doesn't exist as a file that can be created with a command".

Right, that’s the step I’m trying to automate.  Make itself cannot determine 
the list of prerequisites.  You either need to do that manually (a real pain) 
or provide a tool that can examine a file, determine what its prerequisites are 
and then write them out in a way that make understands.

 From the manual for GNU Make: 
https://www.gnu.org/software/make/manual/html_node/Automatic-Prerequisites.html#Automatic-Prerequisites

The example there uses the -M flag for a C compiler.  I’m looking to come up 
with an equivalent for LilyPond.

Okay, does that mean you want a list of all the lilypond include files, or just your own?

If you're digging into the internals of lilypond, then it'll be a big job, and makes it dangerous to upgrade lilypond. Because I assume that means you're actually modifying lilypond's internal structure. What I do, anything of lilypond's that I modify, I split it out into my directory structure, and then over-ride lilypond's version from within my source. That way, what happens to lilypond during an upgrade is no concern of mine (other than changes to syntax which mess up my source :-)

If it's just your own files you're concerned about, then grep will probably do the trick. I don't know how to recurse directories, but making it search all the files in a directory for "include", and tell you which file it found that line in, is pretty basic.

You can then read up on make for how to create those virtual objects, and use an editor to put them in your makefile. Not totally automated, I admit, but fairly simple grunt-work. The sort of thing I could have written a BASIC program to do in 10 minutes, except I don't have access to a BASIC I understand how to use any more - ironic - as computers have got easier to use, so the programming languages have got harder...

Cheers,
Wol



reply via email to

[Prev in Thread] Current Thread [Next in Thread]