forked from milosgajdos/gopfield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 771 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
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: examples
mnist: builddir
go build -o "$(BUILDPATH)/mnist" "examples/mnist/mnist.go"
builddir:
mkdir -p $(BUILDPATH)
install:
$(INSTALL) ./$(EXDIR)/...
clean:
rm -rf $(BUILDPATH)
dep:
go get ./...
check:
for pkg in ${PACKAGES}; do \
go vet $$pkg || exit ; \
done
test:
for pkg in ${PACKAGES}; do \
go test -coverprofile="../../../$$pkg/coverage.txt" -covermode=atomic $$pkg || exit; \
done
.PHONY: clean examples