Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. PYTHON ?= python
  2. VERSION = $(shell cat VERSION)
  3. TAGVER = $(shell cat VERSION | sed -e "s/\([0-9\.]*\).*/\1/")
  4. ifeq ($(VERSION), $(TAGVER))
  5. TAG = $(TAGVER)
  6. else
  7. TAG = "HEAD"
  8. endif
  9. ifndef PREFIX
  10. PREFIX = "/usr"
  11. endif
  12. all: tmpls
  13. $(PYTHON) setup.py build
  14. tmpls:
  15. cd spectacle/spec; $(MAKE)
  16. cd spectacle/dsc; $(MAKE)
  17. tag:
  18. git tag $(VERSION)
  19. dist-bz2:
  20. git archive --format=tar --prefix=spectacle-$(VERSION)/ $(TAG) | \
  21. bzip2 > spectacle-$(VERSION).tar.bz2
  22. dist-gz:
  23. git archive --format=tar --prefix=spectacle-$(VERSION)/ $(TAG) | \
  24. gzip > spectacle-$(VERSION).tar.gz
  25. doc:
  26. markdown README.md > README.html
  27. test:
  28. cd tests/; $(PYTHON) alltest.py
  29. install: all install-data
  30. $(PYTHON) setup.py install --root=${DESTDIR} --prefix=${PREFIX}
  31. develop: all install-data
  32. $(PYTHON) setup.py develop
  33. install-data:
  34. install -d ${DESTDIR}/usr/share/spectacle/
  35. install -m 644 data/*csv ${DESTDIR}/usr/share/spectacle/
  36. install -m 644 data/GROUPS ${DESTDIR}/usr/share/spectacle/
  37. clean:
  38. rm -rf build/
  39. rm -f README.html */*~ */*/*~
  40. cd spectacle/spec; $(MAKE) clean
  41. cd spectacle/dsc; $(MAKE) clean