4 ms·
I like Makefiles, but just for me. Each time I create a new personal project, I add a Makefile at the root, even if the only target is the most basic of the cor
by Loic 2y ago
I like Makefiles, but just for me. Each time I create a new personal project, I add a Makefile at the root, even if the only target is the most basic of the corresponding language. This is because I can't remember all the variations of all the languages and frameworks build "sequences". But "$ make" is easy.
- choeger 2y agoYou're probably using the wrong tool and should consider a simple plain shell script (or a handful of them) for your tasks. test.sh, build.sh, etc.
- poincaredisk 2y agoI disagree. Make is - at it's simplest form - exactly a "simple plain shell script" for your tasks, with some very nice bonus features like dependency resolution. Not the parent, bit I usually start with a two line makefile and add new commands/variables/rules when necessary.
- nrclark 2y ago(not the parent) Make is - at its core - a tool for expressing and running short shell-scripts ("recipes", in Make parlance) with optional dependency relationships between each other. Why would I want to spread out my build logic across a bunch of shell scripts that I have to stitch together, when Make is a nicely integrated solution to this exact problem?
- dwaltrip 2y agoAny modern attempts to do this better than make? I often write small “infra” bash scripts in my projects, maybe I could use a tool like that.
- TheTaytay 2y agoI haven’t used them yet, but I keep seeing people touting alternatives, and in particular “just”: https://github.com/casey/just https://github.com/casey/just This is primarily aimed at a “task runner” replacement rather than a “compilation with automatic file timestamp comparison replacement” Others I stumbled across: Taskfile Mage XcFile None of them have tempted me enough to move away from a set of bash scripts or scripts written in the language of my repo (yet).
- ori_b 2y agoThat depends. Why do think make does this poorly?
- nrclark 2y ago`Just` is also popular in this space, but tbh I think Make is a better choice. Make is included in most Linux distros, including the ones available for WSL. It's also included with Apple's developer tools. It's been used for decades by millions of people, and is very mature. If you use it in a simple way, Make is almost identical to `Just`. And when/if you want Make's powerful features, they're there and ready for you. Make's documentation is also exceptional. I've used a bunch of these kinds of tools over the years, and I've never found one that I like more than Make.
- 1aqp 2y agoI'd say: you are absolutely using the right tool. :-)