4 ms·
I agree that autotools is often overkill, but I don't think the answer for most project is to force users to have to manually edit Makefiles. Feature detection
by nanolith 3y ago
I agree that autotools is often overkill, but I don't think the answer for most project is to force users to have to manually edit Makefiles.
Feature detection is a good thing, but tools like CMake or Meson do a better job at this, in my opinion.
I have done minimal GNU Make builds for large software projects before. In these cases, the main Makefile will depend on a file that is created after a one-time dependency check is done just to ensure that the build environment is sane. This file will exist until `make mrproper` is run, like any other build config file. I'm not personally a fan of monorepos, so instead, project dependencies that aren't already installed on the build machine/vm/container or that aren't a supported version will be automatically downloaded, configured, and installed in the build directory as part of the build process. Even with this sort of complexity, I adamantly believe that the average developer / user should just be able to type `make` and get either a useful error message or a working build. Likewise, I believe that the build scripts should be human readable, well, assuming that one has read through the GNU Make manual at least.
These days, I have more or less standardized on one-shot CMake scripts for my personal projects. They will only check that the current build configuration has any dependencies already installed (e.g. via `PKG_CONFIG_PATH`), which allows for more intelligent scripting by downstream maintainers. The scripts themselves don't have any significant surprises and largely avoid patterns that can't be searched for using a search engine. This makes it easier for me to maintain cross-platform builds, at least across *nix. I haven't really tested Win10 / Win11 builds recently, but should.
- cryo 3y agoAfter a long period of rejecting CMake for "simple" build.sh and Makefile projects, nowadays CMake is my goto choice. Top features: - supports all kinds of compilers, even Watcom for DOS and Windows <all versions> projects. - cross platform compiliation inlc. MSVC - my #1 feature wide IDE support + usage from command line.
- viraptor 3y ago> but tools like CMake or Meson do a better job at this, in my opinion. Not much experience with Meson, but as a package maintainer, I really hate cmake. It's got the most of my "why isn't it calling it to pkg-config properly" debugging hours. Maybe it's easier to write, but finding what a specific option does through the forest of macros and pages of "this can do 10 different things" documentation and how it interacts with the rest of the system is not my favourite thing...