Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. LDFLAGS += -X "gitote/gitote/pkg/setting.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S %Z')"
  2. LDFLAGS += -X "gitote/gitote/pkg/setting.BuildGitHash=$(shell git rev-parse HEAD)"
  3. DATA_FILES := $(shell find conf | sed 's/ /\\ /g')
  4. LESS_FILES := $(wildcard public/less/gitote.less public/less/_*.less)
  5. LESS_FILES := $(wildcard public/less/gitote.night.less public/less/_*.less)
  6. GENERATED := pkg/bindata/bindata.go public/css/gitote.min.css public/css/gitote.night.min.css
  7. OS := $(shell uname)
  8. TAGS = ""
  9. BUILD_FLAGS = "-v"
  10. NOW = $(shell date -u '+%Y%m%d%I%M%S')
  11. GOVET = go tool vet -composites=false -methods=false -structtags=false
  12. .PHONY: build bindata clean
  13. .IGNORE: public/css/gitote.min.css public/css/gitote.night.min.css
  14. all: build
  15. check: test
  16. web: build
  17. ./gitote web
  18. govet:
  19. $(GOVET) gitote.go
  20. $(GOVET) models pkg routes
  21. build: $(GENERATED)
  22. go install $(BUILD_FLAGS) -ldflags '$(LDFLAGS)' -tags '$(TAGS)'
  23. cp '$(GOPATH)/bin/gitote' .
  24. build-dev: $(GENERATED) govet
  25. go install $(BUILD_FLAGS) -tags '$(TAGS)'
  26. cp '$(GOPATH)/bin/gitote' .
  27. build-dev-race: $(GENERATED) govet
  28. go install $(BUILD_FLAGS) -race -tags '$(TAGS)'
  29. cp '$(GOPATH)/bin/gitote' .
  30. bindata: pkg/bindata/bindata.go
  31. pkg/bindata/bindata.go: $(DATA_FILES)
  32. ./go-bindata -o=$@ -ignore="\\.DS_Store|README.md|TRANSLATORS|auth.d" -pkg=bindata conf/...
  33. less: public/css/gitote.min.css public/css/gitote.night.min.css
  34. public/css/gitote.min.css: $(LESS_FILES)
  35. @type lessc >/dev/null 2>&1 && lessc -x $< >$@ || echo "lessc command not found, skipped."
  36. public/css/gitote.night.min.css: $(LESS_FILES)
  37. @type lessc >/dev/null 2>&1 && lessc -x $< >$@ || echo "lessc command not found, skipped."
  38. clean:
  39. go clean -i ./...
  40. clean-mac: clean
  41. find . -name ".DS_Store" -print0 | xargs -0 rm
  42. test:
  43. go test -cover -race ./...
  44. alpha:
  45. grep -rnw "WIP - Alpha" templates
  46. beta:
  47. grep -rnw "WIP - Beta" templates
  48. todo:
  49. grep -rnw "WIP - ToDo" templates