|
1 |
| -PKG=github.com/mailru/easyjson |
2 |
| -GOPATH:=$(PWD)/.root:$(GOPATH) |
3 |
| -export GOPATH |
4 |
| - |
5 | 1 | all: test
|
6 | 2 |
|
7 |
| -.root/src/$(PKG): |
8 |
| - mkdir -p $@ |
9 |
| - for i in $$PWD/* ; do ln -s $$i $@/`basename $$i` ; done |
10 |
| - |
11 |
| -root: .root/src/$(PKG) |
12 |
| - |
13 | 3 | clean:
|
14 |
| - rm -rf .root |
| 4 | + rm -rf bin |
15 | 5 | rm -rf tests/*_easyjson.go
|
| 6 | + rm -rf benchmark/*_easyjson.go |
16 | 7 |
|
17 | 8 | build:
|
18 |
| - go build -i -o .root/bin/easyjson $(PKG)/easyjson |
19 |
| - |
20 |
| -generate: root build |
21 |
| - .root/bin/easyjson -stubs \ |
22 |
| - .root/src/$(PKG)/tests/snake.go \ |
23 |
| - .root/src/$(PKG)/tests/data.go \ |
24 |
| - .root/src/$(PKG)/tests/omitempty.go \ |
25 |
| - .root/src/$(PKG)/tests/nothing.go \ |
26 |
| - .root/src/$(PKG)/tests/named_type.go \ |
27 |
| - .root/src/$(PKG)/tests/custom_map_key_type.go \ |
28 |
| - .root/src/$(PKG)/tests/embedded_type.go \ |
29 |
| - .root/src/$(PKG)/tests/reference_to_pointer.go \ |
30 |
| - |
31 |
| - .root/bin/easyjson -all .root/src/$(PKG)/tests/data.go |
32 |
| - .root/bin/easyjson -all .root/src/$(PKG)/tests/nothing.go |
33 |
| - .root/bin/easyjson -all .root/src/$(PKG)/tests/errors.go |
34 |
| - .root/bin/easyjson -snake_case .root/src/$(PKG)/tests/snake.go |
35 |
| - .root/bin/easyjson -omit_empty .root/src/$(PKG)/tests/omitempty.go |
36 |
| - .root/bin/easyjson -build_tags=use_easyjson .root/src/$(PKG)/benchmark/data.go |
37 |
| - .root/bin/easyjson .root/src/$(PKG)/tests/nested_easy.go |
38 |
| - .root/bin/easyjson .root/src/$(PKG)/tests/named_type.go |
39 |
| - .root/bin/easyjson .root/src/$(PKG)/tests/custom_map_key_type.go |
40 |
| - .root/bin/easyjson .root/src/$(PKG)/tests/embedded_type.go |
41 |
| - .root/bin/easyjson .root/src/$(PKG)/tests/reference_to_pointer.go |
42 |
| - .root/bin/easyjson .root/src/$(PKG)/tests/key_marshaler_map.go |
43 |
| - .root/bin/easyjson -disallow_unknown_fields .root/src/$(PKG)/tests/disallow_unknown.go |
44 |
| - |
45 |
| -test: generate root |
| 9 | + go build -i -o ./bin/easyjson ./easyjson |
| 10 | + |
| 11 | +generate: build |
| 12 | + bin/easyjson -stubs \ |
| 13 | + ./tests/snake.go \ |
| 14 | + ./tests/data.go \ |
| 15 | + ./tests/omitempty.go \ |
| 16 | + ./tests/nothing.go \ |
| 17 | + ./tests/named_type.go \ |
| 18 | + ./tests/custom_map_key_type.go \ |
| 19 | + ./tests/embedded_type.go \ |
| 20 | + ./tests/reference_to_pointer.go \ |
| 21 | + |
| 22 | + bin/easyjson -all ./tests/data.go |
| 23 | + bin/easyjson -all ./tests/nothing.go |
| 24 | + bin/easyjson -all ./tests/errors.go |
| 25 | + bin/easyjson -snake_case ./tests/snake.go |
| 26 | + bin/easyjson -omit_empty ./tests/omitempty.go |
| 27 | + bin/easyjson -build_tags=use_easyjson ./benchmark/data.go |
| 28 | + bin/easyjson ./tests/nested_easy.go |
| 29 | + bin/easyjson ./tests/named_type.go |
| 30 | + bin/easyjson ./tests/custom_map_key_type.go |
| 31 | + bin/easyjson ./tests/embedded_type.go |
| 32 | + bin/easyjson ./tests/reference_to_pointer.go |
| 33 | + bin/easyjson ./tests/key_marshaler_map.go |
| 34 | + bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go |
| 35 | + |
| 36 | +test: generate |
46 | 37 | go test \
|
47 |
| - $(PKG)/tests \ |
48 |
| - $(PKG)/jlexer \ |
49 |
| - $(PKG)/gen \ |
50 |
| - $(PKG)/buffer |
51 |
| - go test -benchmem -tags use_easyjson -bench . $(PKG)/benchmark |
52 |
| - golint -set_exit_status .root/src/$(PKG)/tests/*_easyjson.go |
| 38 | + ./tests \ |
| 39 | + ./jlexer \ |
| 40 | + ./gen \ |
| 41 | + ./buffer |
| 42 | + cd benchmark && go test -benchmem -tags use_easyjson -bench . |
| 43 | + golint -set_exit_status ./tests/*_easyjson.go |
53 | 44 |
|
54 |
| -bench-other: generate root |
55 |
| - @go test -benchmem -bench . $(PKG)/benchmark |
56 |
| - @go test -benchmem -tags use_ffjson -bench . $(PKG)/benchmark |
57 |
| - @go test -benchmem -tags use_jsoniter -bench . $(PKG)/benchmark |
58 |
| - @go test -benchmem -tags use_codec -bench . $(PKG)/benchmark |
| 45 | +bench-other: generate |
| 46 | + cd benchmark && make |
59 | 47 |
|
60 | 48 | bench-python:
|
61 | 49 | benchmark/ujson.sh
|
62 | 50 |
|
63 | 51 |
|
64 |
| -.PHONY: root clean generate test build |
| 52 | +.PHONY: clean generate test build |
0 commit comments