4 ms·
>but a neat, simple and portable makefile is a beautiful sight to behold and a pleasure to run. As someone who has had to hack those makefiles a lot, I can't r
by throwaway82652 4y ago
>but a neat, simple and portable makefile is a beautiful sight to behold and a pleasure to run.
As someone who has had to hack those makefiles a lot, I can't really agree. There's no such thing as a "simple and portable makefile". The real way to generate "portable makefiles" is to use autotools. Every handwritten "portable makefile" I've seen actually has a ton of system-specific and compiler-specific rules. And when porting from Linux you're lucky if some package shipping a handwritten makefile doesn't have an undocumented dependency on GNU make.
Even something simple like PREFIX support has to be manually implemented and tested if you write your own makefile, and often the upstream project doesn't bother testing it and wants the distro to do it. If you want distros to package your stuff without any troubles and without making them a guinea pig for some weird ad-hoc build system then it would be easiest to just use one of the standard buildsystems, those are mostly just cmake, meson, autotools. A small cmake or meson script is significantly shorter than a makefile and is a lot more portable.