2015-09-25 09:28:27 -04:00
|
|
|
NAME=zsh-syntax-highlighting
|
|
|
|
|
2015-10-19 02:44:02 -04:00
|
|
|
INSTALL?=install -c
|
2015-09-25 09:28:27 -04:00
|
|
|
PREFIX?=/usr/local
|
|
|
|
SHARE_DIR=$(DESTDIR)$(PREFIX)/share/$(NAME)
|
|
|
|
|
2015-10-19 03:08:21 -04:00
|
|
|
# Have the default target do nothing.
|
|
|
|
all:
|
|
|
|
@ :
|
|
|
|
|
2015-09-25 09:28:27 -04:00
|
|
|
install:
|
|
|
|
$(INSTALL) -d $(SHARE_DIR)
|
2015-10-19 03:35:12 -04:00
|
|
|
cp -r .version zsh-syntax-highlighting.zsh highlighters $(SHARE_DIR)
|
|
|
|
if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
|
|
|
|
git rev-parse HEAD; \
|
|
|
|
else \
|
|
|
|
cat .revision-hash; \
|
|
|
|
fi > $(SHARE_DIR)/.revision-hash
|
2015-09-25 22:29:51 -04:00
|
|
|
|
|
|
|
test:
|
2015-10-19 02:36:42 -04:00
|
|
|
@result=0
|
2015-09-25 22:29:51 -04:00
|
|
|
@for test in highlighters/*; do \
|
|
|
|
if [ -d $$test/test-data ]; then \
|
|
|
|
echo "Running test $${test##*/}"; \
|
2015-10-19 10:26:01 -04:00
|
|
|
zsh -f tests/test-highlighting.zsh "$${test##*/}"; \
|
2015-10-19 02:36:42 -04:00
|
|
|
: $$(( result |= $$? )); \
|
2015-09-25 22:29:51 -04:00
|
|
|
fi \
|
|
|
|
done
|
2015-10-19 02:36:42 -04:00
|
|
|
@exit $$result
|