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.

62 lines
1.7 KiB

9 years ago
9 years ago
9 years ago
9 years ago
  1. NAME=zsh-syntax-highlighting
  2. INSTALL?=install -c
  3. PREFIX?=/usr/local
  4. SHARE_DIR?=$(DESTDIR)$(PREFIX)/share/$(NAME)
  5. DOC_DIR?=$(DESTDIR)$(PREFIX)/share/doc/$(NAME)
  6. ZSH?=zsh # zsh binary to run tests with
  7. all:
  8. cd docs && \
  9. cp highlighters.md all.md && \
  10. printf '\n\nIndividual highlighters documentation\n=====================================' >> all.md && \
  11. for doc in highlighters/*.md; do printf '\n\n'; cat "$$doc"; done >> all.md
  12. install: all
  13. $(INSTALL) -d $(SHARE_DIR)
  14. $(INSTALL) -d $(DOC_DIR)
  15. cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)
  16. cp COPYING.md README.md changelog.md $(DOC_DIR)
  17. if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
  18. git rev-parse HEAD; \
  19. else \
  20. cat .revision-hash; \
  21. fi > $(SHARE_DIR)/.revision-hash
  22. :
  23. # The [ -e ] check below is to because sh evaluates this with (the moral
  24. # equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
  25. for dirname in highlighters highlighters/*/ ; do \
  26. $(INSTALL) -d $(SHARE_DIR)/"$$dirname"; \
  27. for fname in "$$dirname"/*.zsh ; do [ -e "$$fname" ] && cp "$$fname" $(SHARE_DIR)"/$$dirname"; done; \
  28. done
  29. cp -R docs/* $(DOC_DIR)
  30. clean:
  31. rm -f docs/all.md
  32. test:
  33. @result=0; \
  34. for test in highlighters/*; do \
  35. if [ -d $$test/test-data ]; then \
  36. echo "Running test $${test##*/}"; \
  37. $(ZSH) -f tests/test-highlighting.zsh "$${test##*/}"; \
  38. : $$(( result |= $$? )); \
  39. fi \
  40. done; \
  41. exit $$result
  42. quiet-test:
  43. $(MAKE) test QUIET=y
  44. perf:
  45. @result=0; \
  46. for test in highlighters/*; do \
  47. if [ -d $$test/test-data ]; then \
  48. echo "Running test $${test##*/}"; \
  49. $(ZSH) -f tests/test-perfs.zsh "$${test##*/}"; \
  50. : $$(( result |= $$? )); \
  51. fi \
  52. done; \
  53. exit $$result
  54. .PHONY: all install clean test perf