Skip to main content

Posts

Showing posts from October, 2014

What the SHELL!?!?

Have you ever had that lingering question of: What else can I do with the SHELL environment variable in GNU/Make? Well, I did and tried a few different little tests and figured I'd share them with you. If you do much work with GNU/Make, you've probably seen some projects specifically use /bin/bash instead of /bin/sh. But outside of that, maybe you've never seen SHELL set to anything else. I have two new favorite features in GNU/Make 3.82: .SHELLFLAGS .ONESHELL:  .SHELLFLAGS The argument(s) passed to the shell are taken from the variable .SHELLFLAGS . The default value of .SHELLFLAGS is -c normally, or -ec in POSIX-conforming mode. .ONESHELL: Sometimes you would prefer that all the lines in the recipe be passed to a single invocation of the shell. Lets have some fun! Lets say instead of using a posix shell for our Makefile recipe, lets use Python instead! SHELL = /usr/bin/python .PHONY: all clea