5
PROJECT := github.com/altoros/gosigma
6
PROJECT_DIR := $(shell go list -e -f '{{.Dir}}' $(PROJECT))
8
ifeq ($(shell uname -p | sed -r 's/.*(x86|armel|armhf).*/golang/'), golang)
12
GO_C := gccgo-4.9 gccgo-go
13
INSTALL_FLAGS := -gccgoflags=-static-libgo
18
# Start of GOPATH-dependent targets. Some targets only make sense -
19
# and will only work - when this tree is found on the GOPATH.
20
ifeq ($(CURDIR),$(PROJECT_DIR))
23
go build $(PROJECT)/...
25
check test: check-license
26
go test $(PROJECT)/...
29
@(fgrep "Copyright 2014 ALTOROS" -rl | grep -v Makefile ; \
30
find -name "*.go" | cut -b3-) | sort | uniq -u | xargs -I {} echo FAIL: license missed: {}
33
go install $(INSTALL_FLAGS) -v $(PROJECT)/...
36
go clean $(PROJECT)/...
37
find -name "*.test" | xargs rm -f
38
find -name "*.out" | xargs rm -f
40
coverage.out: *.go data/*.go https/*.go
42
go test -coverprofile=data.cover.out -coverpkg=./,./data,./https ./data
43
go test -coverprofile=https.cover.out -coverpkg=./,./data,./https ./https
44
go test -coverprofile=gosigma.cover.out -coverpkg=./,./data,./https ./
45
echo "mode: set" > coverage.out && cat *.cover.out | grep -v mode: | sort -r | \
46
awk '{if($$1 != last) {print $$0;last=$$1}}' >> coverage.out
51
cover-html: coverage.out
52
go tool cover -html=$<
55
go tool cover -func=$<
60
else # --------------------------------
62
build check test install clean:
63
$(error Cannot $@; $(CURDIR) is not on GOPATH)
66
# End of GOPATH-dependent targets.
68
# Reformat source files.
73
find -name "*.go" | xargs cat | wc -l
75
.PHONY: build check test check-license install clean cover-html cover update