How to use $variable in conditional sentences?
Hello all
I am doing a Makefile but I can't return the value of $var to use it in conditional sentences:
Code:
#!/bin/sh
GO=$(shell) go
GOPATH=$(GO) env GOPATH
make:
@$(GOPATH)
@if [ ! -d "$(GOPATH)/bin" ]; then mkdir -p "$(GOPATH)/bin" ; fi
When I type "make", @$GOPATH returns
Code:
/home/icvallejo/go
so it's ok, but after, I don't know how to use it (I can't do it) with 'if' condition, make returns this:
Code:
if [ ! -d " go env GOPATH/bin" ] ; then mkdir -p " go env GOPATH/bin" ; fi
Can you help me please?