| 1 |
VERSION := $(shell git describe --tags --always --dirty) |
| 2 |
COMMIT := $(shell git rev-parse --short HEAD) |
| 3 |
|
| 4 |
all: test |
| 5 |
|
| 6 |
clean: |
| 7 |
rm -rf bin |
| 8 |
rm -rf tests/*_easyjson.go |
| 9 |
rm -rf benchmark/*_easyjson.go |
| 10 |
|
| 11 |
build: |
| 12 |
go build -ldflags="-s -w -X 'main.Version=$(VERSION)' -X 'main.Commit=$(COMMIT)'" -o ./bin/easyjson ./easyjson |
| 13 |
|
| 14 |
|
| 15 |
generate: build |
| 16 |
bin/easyjson -stubs \ |
| 17 |
./tests/snake.go \ |
| 18 |
./tests/data.go \ |
| 19 |
./tests/omitempty.go \ |
| 20 |
./tests/nothing.go \ |
| 21 |
./tests/named_type.go \ |
| 22 |
./tests/custom_map_key_type.go \ |
| 23 |
./tests/embedded_type.go \ |
| 24 |
./tests/reference_to_pointer.go \ |
| 25 |
./tests/html.go \ |
| 26 |
./tests/unknown_fields.go \ |
| 27 |
./tests/type_declaration.go \ |
| 28 |
./tests/type_declaration_skip.go \ |
| 29 |
./tests/members_escaped.go \ |
| 30 |
./tests/members_unescaped.go \ |
| 31 |
./tests/intern.go \ |
| 32 |
./tests/nocopy.go \ |
| 33 |
./tests/escaping.go |
| 34 |
bin/easyjson -all \ |
| 35 |
./tests/data.go \ |
| 36 |
./tests/nothing.go \ |
| 37 |
./tests/errors.go \ |
| 38 |
./tests/html.go \ |
| 39 |
./tests/type_declaration_skip.go |
| 40 |
bin/easyjson \ |
| 41 |
./tests/nested_easy.go \ |
| 42 |
./tests/named_type.go \ |
| 43 |
./tests/custom_map_key_type.go \ |
| 44 |
./tests/embedded_type.go \ |
| 45 |
./tests/reference_to_pointer.go \ |
| 46 |
./tests/key_marshaler_map.go \ |
| 47 |
./tests/unknown_fields.go \ |
| 48 |
./tests/type_declaration.go \ |
| 49 |
./tests/members_escaped.go \ |
| 50 |
./tests/intern.go \ |
| 51 |
./tests/nocopy.go \ |
| 52 |
./tests/escaping.go \ |
| 53 |
./tests/nested_marshaler.go |
| 54 |
bin/easyjson -snake_case ./tests/snake.go |
| 55 |
bin/easyjson -omit_empty ./tests/omitempty.go |
| 56 |
bin/easyjson -build_tags=use_easyjson -disable_members_unescape ./benchmark/data.go |
| 57 |
bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go |
| 58 |
bin/easyjson -disable_members_unescape ./tests/members_unescaped.go |
| 59 |
|
| 60 |
test: generate |
| 61 |
go test \ |
| 62 |
./tests \ |
| 63 |
./jlexer \ |
| 64 |
./gen \ |
| 65 |
./buffer |
| 66 |
cd benchmark && go test -benchmem -tags use_easyjson -bench . |
| 67 |
golint -set_exit_status ./tests/*_easyjson.go |
| 68 |
|
| 69 |
bench-other: generate |
| 70 |
cd benchmark && make |
| 71 |
|
| 72 |
bench-python: |
| 73 |
benchmark/ujson.sh |
| 74 |
|
| 75 |
|
| 76 |
.PHONY: clean generate test build |