forked from contiv-experimental/objmodel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.05 KB
/
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
42
43
44
45
46
47
48
49
50
.PHONY: all build checks
TO_BUILD := ./tools/modelgen/ ./objdb/ ./objdb/client/ ./objdb/plugins/ ./objdb/plugins/etcdClient/ ./contivModel/ ./contivModel/cmExample/
all: build run-test
godep:
@if [ -z "`which godep`" ]; then go get -v github.com/kr/godep; fi
vet:
@(go tool | grep vet) || go get -v golang.org/x/tools/cmd/vet
checks: vet
./checks "$(TO_BUILD)"
generator:
cd tools/modelgen/generators && bash build.sh >templates.go && gofmt -w -s templates.go
generate:
cd contivModel && bash generate.sh
build: godep checks generator
make clean
godep go install -v ./...
make generate
etcd:
pkill etcd || exit 0
rm -rf /tmp/etcd
etcd --force-new-cluster --data-dir /tmp/etcd &
build-docker:
docker build -t objmodel .
test: build-docker
docker run --rm -v ${PWD}:/gopath/src/github.com/contiv/objmodel objmodel
clean:
rm -rf Godeps/_workspace/pkg
run-test:
godep go test -v ./...
host-test: etcd build
make run-test
make clean
reflex:
# go get github.com/cespare/reflex
reflex -r '.*\.go' -R tools/modelgen/generators/templates.go make test