antlists <[email protected]> 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. -- David Kastrup
