From cf277971aece65ebb2cc0f1b0cca1586a776a5a2 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Sun, 21 Feb 2016 18:34:40 +0000 Subject: [PATCH] Revise Makefile. --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ee59d130..9806465b 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,17 @@ PKGS := $(filter-out main,$(shell go list -f '{{.Name}}' ./...)) PKG_COVERS := $(addprefix cover/,$(PKGS)) -all: get test +STUB := $(GOPATH)/bin/elvish-stub + +all: get $(STUB) test get: go get . - cc ./stubimpl/main.c -o $(GOPATH)/bin/elvish-stub -test: +$(STUB): ./stubimpl/main.c + $(CC) $< -o $@ + +test: $(STUB) go test ./... : ./stubimpl/test.sh @@ -21,7 +25,7 @@ generate: go generate ./... # The target to run on Travis-CI. -travis: get test +travis: all tar cfJ elvish.tar.xz -C $(GOPATH)/bin elvish elvish-stub curl http://dl.elvish.io:6060/ -F name=elvish-$(if $(filter-out master,$(TRAVIS_BRANCH)),$(TRAVIS_BRANCH)-,)$(TRAVIS_OS_NAME).tar.xz -F token=$$UPLOAD_TOKEN -F file=@./elvish.tar.xz