-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
78 lines (57 loc) · 1.94 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# NOTE: This Makefile is only necessary if you
# plan on developing the msgp tool and library.
# Installation can still be performed with a
# normal `go install`.
# generated integration test files
GGEN = ./_generated/generated.go ./_generated/generated_test.go
# generated unit test files
MGEN = ./msgp/defgen_test.go ./msgp/nestedgen_test.go
# generated zebra layer above msgp
ZGEN = ./zebra/zebra_gen.go
SHELL := /bin/bash
BIN = $(GOBIN)/zebrapack
.PHONY: clean wipe install get-deps bench all dev
dev: clean install test
$(BIN): */*.go *.go
@go install && (cd ./cmd/addzid && make)
install:
go install && (cd ./cmd/addzid && make)
$(GGEN): ./_generated/def.go
go generate ./_generated
$(MGEN): ./msgp/defs_test.go
go generate ./msgp
$(ZGEN): ./zebra/zebra.go
go install
go generate ./zebra
zebrapack -method-prefix Zebra -o zebra/zebra_zebra.go -file zebra/zebra.go
test: all
go test -v ./parse
go test -v ./msgp
go test -v ./_generated
go test -v ./zebra
# and test addzid
go test -v ./cmd/addzid
# build and run on testdata/
go build -o ./zebrapack && ./zebrapack -write-schema testdata/my.z -file testdata/my.go && go test -v ./testdata
cd testdata && go generate && go test -v
./zebrapack -file testdata/my.go && go test -v ./testdata/my_gen_test.go ./testdata/my.go ./testdata/my_gen.go
./zebrapack -file testdata/my.go -msgp -o testdata/my_msgp_gen.go -method-prefix=MSGP -tests=false -io=false # test the -method-prefix flag
./zebrapack -schema-to-go testdata/my.z > /tmp/remy.go && echo "func main() {}" >> /tmp/remy.go && go run /tmp/remy.go && rm /tmp/remy.go
bench: all
go test -bench . ./msgp
go test -bench . ./_generated
clean:
$(RM) $(GGEN) $(MGEN)
wipe: clean
$(RM) $(BIN)
get-deps:
go get -d -t ./...
all: install $(GGEN) $(MGEN) $(ZGEN)
# travis CI enters here
travis:
go get -d -t ./...
go build -o "$${GOPATH%%:*}/bin/msgp" .
go generate ./msgp
go generate ./_generated
go test ./msgp
go test ./_generated