Makefile 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. CMD = jpgo
  2. help:
  3. @echo "Please use \`make <target>' where <target> is one of"
  4. @echo " test to run all the tests"
  5. @echo " build to build the library and jp executable"
  6. @echo " generate to run codegen"
  7. generate:
  8. go generate ./...
  9. build:
  10. rm -f $(CMD)
  11. go build ./...
  12. rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./...
  13. mv cmd/$(CMD)/$(CMD) .
  14. test:
  15. go test -v ./...
  16. check:
  17. go vet ./...
  18. @echo "golint ./..."
  19. @lint=`golint ./...`; \
  20. lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \
  21. echo "$$lint"; \
  22. if [ "$$lint" != "" ]; then exit 1; fi
  23. htmlc:
  24. go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov
  25. buildfuzz:
  26. go-fuzz-build github.com/jmespath/go-jmespath/fuzz
  27. fuzz: buildfuzz
  28. go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata
  29. bench:
  30. go test -bench . -cpuprofile cpu.out
  31. pprof-cpu:
  32. go tool pprof ./go-jmespath.test ./cpu.out