3 ms·
Even beyond that I don't really understand the criticism. Like, I don't remember the last machine I had to do serious work on that didn't come with GNU Make eit
by eropple 4y ago
Even beyond that I don't really understand the criticism. Like, I don't remember the last machine I had to do serious work on that didn't come with GNU Make either out of the box or added as part of some very basic bootstrapping scripts. (I don't know what a Mac comes with because my bootstrap for every new machine has coreutils in it and every project has a Brewfile with it too.)
I definitely don't remember the last machine I saw that didn't have bash on it.
- dllthomas 4y agoAnd in this case we're concerned about computers that do have GNU make but don't have bash...
- eqvinox 4y agoIf you write Makefiles for your own personal use — sure. If you're working in a team with other people, or are publishing things for a broader public to use… no. Especially since things like .ONESHELL don't just flat-out cause errors, but rather introduce subtle and insidious distinctions in behavior.
- eropple 4y agoEhh. If I'm writing a Makefile, team context or no, it's almost certainly because I don't expect other people to be more familiar with Make than I am. If anything, I would expect ONESHELL to map to how most programmers think Make already works, even though it doesn't. I know I have to go look up the various Make-isms whenever I need to do anything complex. And a Make supergenius, should I ever meet one, surely will look at the top of the file or derive from "incorrect" code that something is nonstandard. I'd love better tools that take the good parts of Make (around file transformations, mostly) and expose them more effectively in shells (because doing so in a more fully featured programming language often results in different and worse hacks--hi, Rake) but using Make to do things more people will find predictable seems fine to me.
- eqvinox 4y agoI guess I should've been more clear. My point is other people /using/ your Makefile, not editing it. You know what you're running. You don't know what everyone else is running. I've singled out ONESHELL because it will be silently ignored by non-GNU make, and it will behave ever so slightly different enough to cause extremely hard to find bugs. Example: .ONESHELL: sometarget: someinput ␉BASEDIR=other_expression ␉SHELLVAR=complicated_expression ␉rm -rf $$BASEDIR/$$SHELLVAR (obviously extreme to illustrate the point, but you get the idea.)
- eqvinox 4y agobtw. On the BSDs, GNU make is "gmake" while plain "make" is POSIX-compliant BSD make. Better hope you never make the easy mistake of forgetting that "g"… (If you use any of these features — please rename your Makefile to GNUmakefile. Please. I beg you.)
- aldonius 4y agoAt least on my machine, it's a GNU Make... version 3.81. I can only assume that's the last of the GPLv2 licensed ones. Classic Apple.