mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-12 17:27:50 +08:00
f9cdd8db20
When comping the stub, $(GOPATH)/bin is assumed to exist. This breaks `make -j2`, where `get` and `$(STUB)` may be built in parallel.
34 lines
760 B
Makefile
34 lines
760 B
Makefile
PKGS := $(filter-out main,$(shell go list -f '{{.Name}}' ./...))
|
|
PKG_COVERS := $(addprefix cover/,$(PKGS))
|
|
|
|
STUB := $(GOPATH)/bin/elvish-stub
|
|
|
|
all: get $(STUB) test
|
|
|
|
get:
|
|
go get .
|
|
|
|
$(STUB): ./stubimpl/main.c
|
|
mkdir -p $(GOPATH)/bin
|
|
$(CC) ./stubimpl/main.c -o $@
|
|
|
|
test: $(STUB)
|
|
go test ./...
|
|
: ./stubimpl/test.sh
|
|
|
|
cover/%: %
|
|
mkdir -p cover
|
|
go test -coverprofile=$@ ./$<
|
|
|
|
cover: $(PKG_COVERS)
|
|
|
|
generate:
|
|
go generate ./...
|
|
|
|
# The target to run on Travis-CI.
|
|
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
|
|
|
|
.PHONY: all get test cover generate travis
|