You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 828B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # General
  2. WORKDIR = $(PWD)
  3. # Go parameters
  4. GOCMD = go
  5. GOTEST = $(GOCMD) test
  6. # Git config
  7. GIT_VERSION ?=
  8. GIT_DIST_PATH ?= $(PWD)/.git-dist
  9. GIT_REPOSITORY = http://github.com/git/git.git
  10. # Coverage
  11. COVERAGE_REPORT = coverage.out
  12. COVERAGE_MODE = count
  13. build-git:
  14. @if [ -f $(GIT_DIST_PATH)/git ]; then \
  15. echo "nothing to do, using cache $(GIT_DIST_PATH)"; \
  16. else \
  17. git clone $(GIT_REPOSITORY) -b $(GIT_VERSION) --depth 1 --single-branch $(GIT_DIST_PATH); \
  18. cd $(GIT_DIST_PATH); \
  19. make configure; \
  20. ./configure; \
  21. make all; \
  22. fi
  23. test:
  24. @echo "running against `git version`"; \
  25. $(GOTEST) ./...
  26. test-coverage:
  27. @echo "running against `git version`"; \
  28. echo "" > $(COVERAGE_REPORT); \
  29. $(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./...
  30. clean:
  31. rm -rf $(GIT_DIST_PATH)