Skip to content

Instantly share code, notes, and snippets.

@raine
Created May 14, 2013 20:03
Show Gist options
  • Select an option

  • Save raine/5579022 to your computer and use it in GitHub Desktop.

Select an option

Save raine/5579022 to your computer and use it in GitHub Desktop.
$ cat Makefile
.PHONY: all clean
all: check-env
echo $(ENV)
clean:
echo "clean"
check-env:
ifndef ENV
$(error ENV is undefined)
endif
$ make clean
Makefile:11: *** ENV is undefined. Stop.
$ make clean ENV=foo
echo "clean"
clean
$ make
Makefile:11: *** ENV is undefined. Stop.
$ make ENV=foo
echo foo
foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment