Am Montag, den 18.05.2020, 14:37 +0100 schrieb antlists: > On 18/05/2020 13:44, David Kastrup wrote: > > antlists <antli...@youngman.org.uk> writes: > > > > > On 15/05/2020 21:17, Fr. Samuel Springuel wrote: > > > > Now I just need to turn this list into something that can be > > > > used to > > > > figure out if the target needs to be recompiled. > > > > > > As Jacques said, "make". > > > > > > At the top of your directory structure you can have a makefile, > > > and it > > > just contains a list of all your targets, and the files they > > > depend > > > on. Okay, every time you add a new include, you need to update > > > it, > > > but... > > > > > > Then when you change something, you just go to your top > > > directory, > > > type "make", and watch everything affected by your recent changes > > > recompile. > > > > > > The really nice thing about it, is it will handle recursive > > > includes > > > by itself. Can't remember the syntax, but if an include file > > > pulls in > > > other includes, you can define that include file as a target, > > > which > > > then flags any other that targets that use it. So each target in > > > your > > > makefile only needs to include the includes that it depends > > > *directly* > > > upon. > > > > That's not how Makefile dependencies work. Dependencies track the > > relation of _output_ files to their _input_. They do not track the > > hierarchy of different input files that only refer to each other by > > name: for the purpose of Make, those are independent and > > equivalent. > > But the _output_ file(s) generated from them are dependent on all > > of the > > respective input files in use, and tracking those and generating > > the > > dependencies was what Fr. Samuel was asking about in the first > > place. > > > Yup. But he wanted to know "which files do I need to recompile". > Which > is exactly what makefiles do. > > so if trombone.pdf is compiled from trombone.ly, which includes > trombone-notes.ly, which includes dynamics.ly, then I know there is > some > sort of syntax which will: > > 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". > > So if dynamics.ly changes, it cascades up and causes trombone.pdf to > be > re-compiled, but this is the important bit - you don't need to > *ex*plicitly define trombone.pdf as relying on dynamics.ly > > > Just had a slight rethink - which affects things - namely what > exactly > is Fr. Samuel trying to achieve. Does he want a list of dependencies > as > a thing in its own right, or does he want to know which targets need > to > be recompiled as a result of changing a file. Because "make" is all > he > needs if the latter is what he's aiming for. If he really wants the > former, then yes he'll need all thse lily functions etc that people > have > pointed him to.
Sounds nice, but how can you tell Make what include files a given .ly file depends on? Without inside knowledge into the LilyPond way of recursing into the input files? Urs > > > Cheers, > Wol >