Makefile 1.6 KB

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