I have a shell script with some variables w/ variable expansions:
$ cat version
#!/bin/bash
export GIT_TAG=`git describe --tags --always --dirty`
export BUILD_NUM=${TRAVIS_BUILD_NUMBER:-${GIT_TAG}}
export VERSION="0.1.${BUILD_NUM}"
Then I'm trying to import the variables into a Makefile:
$ cat Makefile
MAKEFLAGS += --warn-undefined-variables
include version
all:
@echo $(VERSION)
However it seems variable expansion isn't working:
$ make
Makefile:5: warning: undefined variable `TRAVIS_BUILD_NUMBER:-`git describe --tags --always --dirty`'
version:16: warning: undefined variable `TRAVIS_BUILD_NUMBER:-`git describe --tags --always --dirty`'
version:13: warning: undefined variable `TRAVIS_BUILD_NUMBER:-`git describe --tags --always --dirty`'
0.1.
Any suggestions?