3

I've this really simple make file:

run:
        test -f ./bin/alfred-proxy || wget "http://localhost:8081/1.0.26/my-binary-1.0.26.tar.gz
" -O /tmp/my-binary.tar.gz && tar xfvz /tmp/my-binary.tar.gz
        go build && ./my-awesome-binary

I want to move the version 1.0.26 to a variable so that I can change it easily in future and it's not part of the long command. How can I accomplish that?

1 Answer 1

5

Variables in makefiles are pretty straight forward:

version = 1.0.26
run:
        test -f ./bin/alfred-proxy || wget "http://localhost:8081/$(version)/my-binary-$(version).tar.gz
1
  • 1
    Thanks @Stephen, I was defining it under run: block and hence the issue. Mar 31, 2017 at 2:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .