3 ms·
GNU Make now has a debugger (`apt install remake`) that eases your first pain point a lot
by dima55 2y ago
GNU Make now has a debugger (`apt install remake`) that eases your first pain point a lot
- bonzini 2y agoEven then the problem with doing complicated stuff in Make is that it's very hard to reproduce the environment that triggered the bug in the first place. I came to the conclusion that you need to treat all of the build system as a linear process, which in Make would mean for example not using "=" at all except to define functions, only use ":=". With this kind of discipline I never really needed a debugger, but really Make is not the right language to write complex logic. Personally I am a fan of (and contributor to) Meson. It's not perfect but it strikes a good balance between what is in the basic package and what you can do in your build script, and by keeping the build phases separate it really helps with keeping things understandable. The lack of functions can be annoying (and in general I wish it could use Starlark as the language), but it doesn't hurt if you follow the same principle and treat the build script as a data flow process, with each phase producing data structures for the next one. So I think it's generally a good principle to follow.