Skip to content

Commit

Permalink
Fix Makefile $(REBAR) variable handling on Illumos
Browse files Browse the repository at this point in the history
On solaris flavors, `which` has: sometimes poor behavior of
not returning proper exit codes or printing errors to STDOUT
rather than STDERR.  All of this is to say, the makefile didn't
behave correctly on Solaris. $(REBAR) ended up being set to
"rebar not found" which made the compile target less than happy.

I added a print-* target to test this easier.  Simply
`make print-VAR` to see the value.  So `make print-REBAR`
will show you the value of $REBAR.
  • Loading branch information
Jared Morrow committed May 13, 2015
1 parent 5a4be10 commit cc55bb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REBAR=$(shell which rebar || echo ./rebar)
REBAR = $(shell test -e `which rebar` 2>/dev/null && which rebar || echo "./rebar")
DEPSOLVER_PLT=$(CURDIR)/.depsolver_plt

all: dirs compile
Expand Down Expand Up @@ -43,3 +43,5 @@ typer: $(DEPSOLVER_PLT)

distclean: clean
@rm $(DEPSOLVER_PLT)

print-%: ; @echo $*=$($*)

0 comments on commit cc55bb9

Please sign in to comment.