FreeBSD packages are built from the FreeBSD Ports Collection, which is mostly bmake makefiles. We have a pretty decent autoformater (portfmt) and a linter (portclippy). There is even portedit, which lets you edit See https://github.com/t6/portfmt for more details.
Perhaps this codebase could be adapted for GNU makefile as well.
I’m doing a little side project that involves linting Makefiles and one thing I could use is a Makefile parser. The linked project has a simple parser, but I’ve been unable to find anything more comprehensive.
Have you looked here?
That one is new to me; thanks!
I also found this small parser in JS: https://github.com/kba/makefile-parser
A few more finds:
I have not tried this, but it might be just the thing we were asking for in the discussion yesterday