Go的Makefile

时间:2017-07-05 17:57:57

标签: go makefile

我在一个名为“newTest”的文件夹中添加了一个新的Go测试存根到我的项目的测试工具仓库中,该文件夹包含“newTest.go,util.go和util_test.go”。在父目录中有一个makefile,它可以自动构建所有测试工具,然后对其进行dockerize。已经存在一个单独的Go测试存根可执行文件,它在测试工具仓库中构建(existingTest)。这是当前的makefile(编辑):

// Set up and do other stuff  
existingTest:
    env GOPATH=${PWD}/../external_vendor go build existingTest.go

docker: 
    @if [ -n "$${CI_PIPE}" ]; then \
          //...other docker make stuff

我的新测试存根具有与$ {PWD} /../ external_vendor相同的外部依赖关系,并且构建过程本身与当前正在构建的内容完全相同。我可以这样做吗?

// Set up other stuff
GO_PROG=        existingTest  newTest/newTest

go: ${GO_PROG}

${GO_PROG}:
    env GOPATH=${PWD}/../external_vendor go build $@.go

docker: 
    @if [ -n "$${CI_PIPE}" ]; then \
          //...other docker make stuff

0 个答案:

没有答案