Skip to content

Instantly share code, notes, and snippets.

@toddlers
Created May 25, 2020 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddlers/d139d5e6c4aa33b02f834c0a3909b354 to your computer and use it in GitHub Desktop.
Save toddlers/d139d5e6c4aa33b02f834c0a3909b354 to your computer and use it in GitHub Desktop.
language interpreters in Makefiles
.ONESHELL:
.SILENT:
main: \
python \
ruby \
R \
bash \
docker
docker: .SHELLFLAGS = run --rm --entrypoint /bin/bash ubuntu -c
docker: SHELL := docker
docker:
echo "hello, $$(uname -a)!"
python: SHELL := python3
python:
greeting = "hello"
print(f"{greeting}, python!")
ruby: .SHELLFLAGS := -e
ruby: SHELL := ruby
ruby:
greeting = "labas"
puts "#{greeting}, ruby!"
R: .SHELLFLAGS := -e
R: SHELL := Rscript
R:
greeting = "bonjour"
message(paste0(greeting, ", R!"))
bash: .SHELLFLAGS := -euo pipefail -c
bash: SHELL := bash
bash:
export greeting="¡hola"
echo "$${greeting}, bash!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment