3 ms·
> Is make considered bad or something? Depends what you're using it for. Generated from CMake, Makefiles are OK I guess, although Ninja is strictly better thes
by dureuill 3y ago
> Is make considered bad or something?
Depends what you're using it for. Generated from CMake, Makefiles are OK I guess, although Ninja is strictly better these days.
Manually written, I would say make is bad.
1. It doesn't promote portability: since each target calls shell commands, it is very easy to accidentally create a non portable Makefile (something alleviated when using CMake that handles the portability before emitting the Makefile)
2. It is imperative and stateful in subtle ways, which is the wrong level of abstraction for a build system. Systems that are declarative and describe the desired state of the build are much easier to use and reliable
3. It is bare bone as far as build system functionality goes: it doesn't provide many of the useful things I expect from a modern build system: the concepts of library dependencies, build profiles, compiler flags, test, documentation or even project in general... are all orthogonal to make
4. It is ad-hoc: as a result of the previous points, the expected functionality of a build system is often re-created in the makefile, but in a non fully standard way (conventions exist, but must be manually enforced and are limited). This results in brittle and difficult to use build systems.
> What is an alternative
Language-specific package managers, notably Cargo.
If using rust, there's also a pattern called xtask[1] that's aiming at providing a standard interface in the form of a binary (since it is rust, it is portable, but most of the other points unfortunately apply).
Otherwise, CMake, meson, nix, bazel, buck2
[1]: https://github.com/matklad/cargo-xtask https://github.com/matklad/cargo-xtask
- lgkk 3y agoCool! What would you suggest for go? Fwiw I develop on a Ubuntu workstation. I build and deploy to mostly Ubuntu or bare bones Linux.