On Mon, Jul 30, 2018 at 11:26 AM, Paul Smith <psm...@gnu.org> wrote: > On Mon, 2018-07-30 at 10:44 +1200, Duane Griffin wrote: >> I am not a GNU make developer but I am pretty sure that it is not >> possible to do this generically within make itself. Make does not >> work at that level. It just runs shell code, it doesn't understand >> that a particular command is, for example, invoking clang and should >> be added to a compilation database. > > Is it really critical that only compilation commands be added to > compile_commands.json? What would be the impact if other commands > (that had recipes) were also added?
Actually that would probably be fine: the tools seem to just ignore the dummy entry we add at the end (I don't use this tooling myself, but I haven't heard any complaints from the devs that do). However, as you say, all the other stuff that happens in recipes is more problematic. Anyway, as I said, in order for makefiles to know what needs to be recompiled when (e.g.) compiler flags change it has to be storing the full compile command, or functional equivalent, somewhere already. That is the same information you need to write to the database, so from there it is just a matter of collecting it up and writing it out. Cheers, Duane. -- "I never could learn to drink that blood and call it wine" - Bob Dylan _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make