3 ms·
I just don't get the hype around make/CMake/autotools. I usually implement the build tool in the language I am working on (build.py for Python, etc.). It seems
by StreamBright 4y ago
I just don't get the hype around make/CMake/autotools. I usually implement the build tool in the language I am working on (build.py for Python, etc.). It seems that Zig[1] also follows this.
What am I missing?
1. https://ziglearn.org/chapter-3/ https://ziglearn.org/chapter-3/
- Izkata 4y agoI don't know about the other two, but the recent resurgence of "make" seems to be around using it as a standard interface for running tasks. For example, "make build" would run build.py in a python project, webpack in a javascript project, etc. Similarly there's things that have been ad-hoc standards forever, like "make clean" to remove all build and test artifacts, or "make test" for running tests. Many of my coworkers only use it in this way and are unaware make looks at files/timestamps.
- catiopatio 4y ago> What am I missing? The irony of using “hype” to describe make/CMake/autotools while referencing Zig as an alternative example. Building a build tool written in C or C++ requires a build tool — hence the existence of make/CMake/autotools, which can bootstrap themselves from a minimal environment.
- StreamBright 4y agoIf I was referencing Zig az the __only__ alternative I would agree. What I wanted to say is to use the same language / tool that your projects uses. Maybe it is impossible for C/C++ as some comments pointed out.
- Koshkin 4y agoThis is the sanest idea of all, it seems. C++ could easily have a library of build and dependency-tracking classes with a sensible API. Then you could use anything you want in your build "script" that C++ has to offer and not have to jump through hoops to accommodate the most complicated use cases. (And no, you would not be needing a build script for your build tool.)
- palata 4y agoThe way it works is that if you ship an executable, then you can do whatever you want as long as it ends up building it. If you ship a library, then you need to provide a way to install it somewhere, and ideally a way to find it (e.g. pkg-config, at least on Linux). If you need to use CMake because your dependencies use CMake, you are doing something wrong. I typically build dependencies with all sorts of build systems, I just don't mind. I just need them to be installed somewhere such that CMake can find them.
- UncleEntity 4y ago> What am I missing? C/C++ compilers don’t have a scripting language built in to construct your build system on top of? I mostly use distools to build python modules but I have a couple projects where there is code generation, building static libs, &etc… and I find it easier to use cmake to just pop out a python module. Cmake can also be convinced to make distro packages, like rpms and debs, without too much trouble — not sure how to do that in any other build system.