3 ms·
> If you add a new source file, you must rerun autoreconf to regenerate your Makefile No you don't: automake generates rules for `Makefile.am -> Makefile.in` (
by _jackdk_ 3y ago
> If you add a new source file, you must rerun autoreconf to regenerate your Makefile
No you don't: automake generates rules for `Makefile.am -> Makefile.in` (`automake`) and `Makefile.in -> Makefile` (`config.status`). You should just be able to edit `Makefile.am` and run `make`.
> Is it really less effort to write Makefile.am than to write a straight Makefile? Wouldn't that be simpler?
I don't think so. Not if you want to get DESTDIR support right, and proper dependency tracking (dep info as a side-effect of compilation, so you get all the headers and don't slow down one-off builds), and support for all the standard Makefile targets, etc.
As for your "which build tool to actually use?" question, I wrote a longer post about that in the context of bootstrappable software: http://jackkelly.name/blog/archives/2024/04/01/which_build_tool_for_a_bootstrappable_project/index.html http://jackkelly.name/blog/archives/2024/04/01/which_build_t...
It really does seem like autotools remain one of the least bad options, but maybe muon (C99!meson) and samurai (C99!ninja) might be a workable option.
- foul 3y ago>I don't think so. Not if you want to get DESTDIR support right, and proper dependency tracking (dep info as a side-effect of compilation, so you get all the headers and don't slow down one-off builds), and support for all the standard Makefile targets, etc. With any make, yes. With modern GNU make you can embed sh code inside a makefile with the define hack, so no, ugly, but no.