3 ms·
> If I wanted ancient sh-isms and bash-isms So don't, set make's shell to something else instead. It doesn't understand the recipes, it just dumps them to a f
by Izkata 2y ago
> If I wanted ancient sh-isms and bash-isms
So don't, set make's shell to something else instead. It doesn't understand the recipes, it just dumps them to a file and runs $(SHELL) on them.
For a more extreme example, just to show what's possible:
SHELL := python3
.ONESHELL:
foo.csv:
import csv
with open("$@", "w") as f:
writer = csv.writer(f)
writer.writerows([
['Test1', 'Test2'],
['Test3', 'Test4'],
])
- pdimitar 2y agoNot a bad idea, thanks. I did this a few times as well but when I analyzed the ROI I figured that just writing a simple-ish Golang program is just less confusing and more consistent in its totality when you ask yourself "do I really have to use Make and Python and, and, and...?". So yeah, thanks for bringing visibility to this pretty decent compromising approach. It worked for me for a while but eventually I just went all-in to either use `just`, some _very_ short bash/zsh scripts, or jump all the way to Golang.
- thechao 2y agoI'm this years old when my life was revolutionized.