Skip to content

Instantly share code, notes, and snippets.

@insaneinside
Last active July 22, 2017 02:28
Show Gist options
  • Save insaneinside/bbc2f9c980af42fd8a05 to your computer and use it in GitHub Desktop.
Save insaneinside/bbc2f9c980af42fd8a05 to your computer and use it in GitHub Desktop.
Ruby as a shell in GNU Make
# Example of using Ruby as the command interpreter for GNU Make
# Set shell to ruby...
SHELL:=ruby
# ...and implicitly pass `-e` (Ruby's "eval" option) prior to the
# command string.
.SHELLFLAGS:=-e
# Tell GNU Make to use a single shell process for all lines in a given recipe.
# Requires GNU Make 3.82 (~August 2010).
.ONESHELL:
all:
puts 'Hello, World!'
# Yes, blocks work!
5.times do
puts 'Bye!'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment