-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
41 lines (30 loc) · 814 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
BUILD=go build
CLEAN=go clean
INSTALL=go install
BUILDPATH=./_build
PACKAGES=$(shell go list ./... | grep -v /examples/)
EXAMPLES=$(shell find examples/* -maxdepth 0 -type d -exec basename {} \;)
examples: builddir
for example in $(EXAMPLES); do \
go build -o "$(BUILDPATH)/$$example" "examples/$$example/$$example.go"; \
done
all: dep check test examples
colors: builddir
go build -o "$(BUILDPATH)/colors" "examples/colors/colors.go"
fcps: builddir
go build -o "$(BUILDPATH)/fcps" "examples/fcps/fcps.go"
builddir:
mkdir -p $(BUILDPATH)
install:
$(INSTALL) ./$(EXDIR)/...
clean:
rm -rf $(BUILDPATH)
dep:
go get ./...
check:
go vet ./...
test:
for pkg in ${PACKAGES}; do \
go test -coverprofile="../../../$$pkg/coverage.txt" -covermode=atomic $$pkg || exit; \
done
.PHONY: clean examples