File: Makefile

package info (click to toggle)
golang-github-mailru-easyjson 0.0~git20161103.0.159cdb8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 744 kB
  • sloc: makefile: 45; sh: 4
file content (52 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download | duplicates (2)
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
PKG=github.com/mailru/easyjson
GOPATH:=$(shell pwd)/obj-$(DEB_BUILD_GNU_TYPE)
export GOPATH
PATH:=$(PATH):$(shell pwd)/obj-$(DEB_BUILD_GNU_TYPE)/bin
export PATH

all: test

.root/src/$(PKG): 	
	mkdir -p $@
	for i in $$PWD/* ; do ln -s $$i $@/`basename $$i` ; done 

root: .root/src/$(PKG)

clean:
	rm -rf .root

build:
	go build -i -o .root/bin/easyjson $(PKG)/easyjson

generate:
	easyjson -stubs \
		$(GOPATH)/src/$(PKG)/tests/snake.go \
		$(GOPATH)/src/$(PKG)/tests/data.go \
		$(GOPATH)/src/$(PKG)/tests/omitempty.go \
		$(GOPATH)/src/$(PKG)/tests/nothing.go

	easyjson -all $(GOPATH)/src/$(PKG)/tests/data.go 
	easyjson -all $(GOPATH)/src/$(PKG)/tests/nothing.go
	easyjson -snake_case $(GOPATH)/src/$(PKG)/tests/snake.go
	easyjson -omit_empty $(GOPATH)/src/$(PKG)/tests/omitempty.go
	easyjson -build_tags=use_easyjson $(GOPATH)/src/$(PKG)/benchmark/data.go

test: generate root
	go test \
		$(PKG)/tests \
		$(PKG)/jlexer \
		$(PKG)/gen \
		$(PKG)/buffer
	go test -benchmem -tags use_easyjson -bench . $(PKG)/benchmark
	golint -set_exit_status .root/src/$(PKG)/tests/*_easyjson.go

bench-other: generate root
	@go test -benchmem -bench . $(PKG)/benchmark
	@go test -benchmem -tags use_ffjson -bench . $(PKG)/benchmark
	@go test -benchmem -tags use_codec -bench . $(PKG)/benchmark

bench-python:
	benchmark/ujson.sh


.PHONY: root clean generate test build