This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile.am
54 lines (47 loc) · 2.26 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = . utils src
doc_DATA = AUTHORS ChangeLog NEWS README
if BUILD_DOCUMENTATION
SUBDIRS += doc
endif
# This is the only way with automake I know of to force 'check-git-hooks'
# to be evaluated before 'all'. If there is a nicer way, I'm all ears...
BUILT_SOURCES = install-git-hooks
###################################
# git hook management
#
install-git-hooks:
if test -d .git; then \
for hook in githooks/???*; do \
case $$hook in \
*.sample|*~|*.swp) continue;; \
esac; \
if test -x $$hook -a \
! -x .git/hooks/$${hook##*/}; then \
echo "Installing git hook $${hook##*/}..."; \
cp $$hook .git/hooks; \
chmod a+x .git/hooks/$${hook##*/}; \
fi \
done \
fi
check-git-hooks:
if test -d .git; then \
for hook in githooks/???*; do \
case $$hook in \
*.sample|*~|*.swp) continue;; \
esac; \
if test -x $$hook -a ! -e .git/hooks/$${hook##*/}; then \
echo ""; \
echo "WARNING:"; \
echo "WARNING: You have an uninstalled git hook $$hook"; \
echo "WARNING: Please, consider taking it into use by"; \
echo "WARNING: running 'make install-git-hooks'..."; \
echo "WARNING:"; \
echo ""; \
fi \
done \
fi
# cleanup
clean-local::
rm -f *~