Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. VERSION = $(shell sed -ne 's/__version__\s*=\s*[\x22\x27]\([^\x22\x27]\+\)[\x22\x27].*/\1/p ' gitbuildsys/__init__.py)
  2. TAGVER = $(shell echo $(VERSION) | sed -e "s/\([0-9\.]*\).*/\1/")
  3. PKGNAME = gbs
  4. ifeq ($(VERSION), $(TAGVER))
  5. TAG = $(TAGVER)
  6. else
  7. TAG = "HEAD"
  8. endif
  9. TAG="HEAD"
  10. ifndef PREFIX
  11. PREFIX = "/usr/local"
  12. endif
  13. all:
  14. python setup.py build
  15. tag:
  16. git tag $(VERSION)
  17. dist-common: man
  18. git archive --format=tar --prefix=$(PKGNAME)-$(TAGVER)/ $(TAG) | tar xpf -
  19. git show $(TAG) --oneline | head -1 > $(PKGNAME)-$(TAGVER)/commit-id
  20. mkdir $(PKGNAME)-$(TAGVER)/doc; mv gbs.1 $(PKGNAME)-$(TAGVER)/doc
  21. dist-bz2: dist-common
  22. tar jcpf $(PKGNAME)-$(TAGVER).tar.bz2 $(PKGNAME)-$(TAGVER)
  23. rm -rf $(PKGNAME)-$(TAGVER)
  24. dist-gz: dist-common
  25. tar zcpf $(PKGNAME)-$(TAGVER).tar.gz $(PKGNAME)-$(TAGVER)
  26. rm -rf $(PKGNAME)-$(TAGVER)
  27. man:
  28. rst2man docs/GBS.rst >docs/gbs.1
  29. html:
  30. rst2html docs/GBS.rst >docs/gbs.html
  31. pdf:
  32. rst2pdf docs/GBS.rst -o docs/gbs.pdf
  33. docs: man html pdf
  34. install: all
  35. python setup.py install --prefix=${PREFIX}
  36. clean:
  37. rm -rf build/
  38. rm -rf dist/
  39. rm -rf *.egg-info/
  40. test:
  41. nosetests -v --with-coverage --with-xunit