2016-09-15 22:18:03 +08:00
|
|
|
PKGS := $(shell go list ./... | grep -v /vendor/)
|
|
|
|
PKG_COVERS := $(shell go list ./... | grep -v /vendor/ | grep "^github.com/elves/elvish/" | sed "s|^github.com/elves/elvish/|cover/|")
|
2013-09-18 16:58:51 +08:00
|
|
|
|
2016-10-13 16:03:16 +08:00
|
|
|
FIRST_GOPATH=$(shell go env GOPATH | cut -d: -f1)
|
|
|
|
STUB := $(FIRST_GOPATH)/bin/elvish-stub
|
2016-02-22 02:34:40 +08:00
|
|
|
|
2016-02-22 21:49:21 +08:00
|
|
|
all: get stub test
|
2014-01-31 21:08:56 +08:00
|
|
|
|
2015-02-27 09:29:40 +08:00
|
|
|
get:
|
2016-02-21 18:59:46 +08:00
|
|
|
go get .
|
2013-09-18 16:58:51 +08:00
|
|
|
|
2016-02-22 21:49:21 +08:00
|
|
|
stub: $(STUB)
|
|
|
|
|
2016-02-22 02:34:40 +08:00
|
|
|
$(STUB): ./stubimpl/main.c
|
2016-10-13 16:03:16 +08:00
|
|
|
test -n $(FIRST_GOPATH)
|
|
|
|
mkdir -p $(FIRST_GOPATH)/bin
|
2016-02-22 02:44:36 +08:00
|
|
|
$(CC) ./stubimpl/main.c -o $@
|
2016-02-22 02:34:40 +08:00
|
|
|
|
2016-02-22 21:49:21 +08:00
|
|
|
test: stub
|
2016-09-15 22:18:03 +08:00
|
|
|
go test $(PKGS)
|
2016-02-21 19:49:24 +08:00
|
|
|
: ./stubimpl/test.sh
|
2014-01-25 21:15:54 +08:00
|
|
|
|
2014-09-25 05:56:12 +08:00
|
|
|
cover/%: %
|
|
|
|
mkdir -p cover
|
2014-01-25 21:15:54 +08:00
|
|
|
go test -coverprofile=$@ ./$<
|
|
|
|
|
2014-09-28 17:22:28 +08:00
|
|
|
cover: $(PKG_COVERS)
|
2016-09-15 22:18:03 +08:00
|
|
|
echo $(PKG_COVERS)
|
2014-01-25 21:15:54 +08:00
|
|
|
|
2015-02-27 09:29:40 +08:00
|
|
|
generate:
|
|
|
|
go generate ./...
|
2013-09-18 16:58:51 +08:00
|
|
|
|
2016-02-10 06:10:26 +08:00
|
|
|
# The target to run on Travis-CI.
|
2016-02-22 02:34:40 +08:00
|
|
|
travis: all
|
2016-10-13 16:03:16 +08:00
|
|
|
tar cfz elvish.tar.gz -C $(FIRST_GOPATH)/bin elvish elvish-stub
|
2016-10-08 11:27:25 +08:00
|
|
|
test "$(TRAVIS_GO_VERSION)" = 1.7 -a "$(TRAVIS_PULL_REQUEST)" = false && test -n "$(TRAVIS_TAG)" -o "$(TRAVIS_BRANCH)" = master && curl http://ul.elvish.io:6060/ -F name=elvish-$(TRAVIS_OS_NAME).tar.gz -F token=$$UPLOAD_TOKEN -F file=@./elvish.tar.gz || echo "not uploading"
|
2016-02-10 06:10:26 +08:00
|
|
|
|
2016-02-22 21:49:21 +08:00
|
|
|
.PHONY: all get stub test cover generate travis
|