-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
31 lines (23 loc) · 1.08 KB
/
Makefile
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
PERL_SOURCES_ALL := $(wildcard *.pl)
PERL_SOURCES_SKIP := fritz.pl # no need for complete build & install of Net::Fritz in Travis CI build
PERL_SOURCES := $(filter-out $(PERL_SOURCES_SKIP), $(PERL_SOURCES_ALL))
BASH_SOURCES := $(wildcard *.sh)
all:
./make_html.pl
dump-all:
for RRD in *.rrd; do rrdtool dump $$RRD $$RRD.dump.xml; done
clean:
rm -f *~
test: test-perl test-bash
ci-install-deps: ci-install-perl-deps
ci-install-perl-deps:
@grep ^use $(PERL_SOURCES) | awk '{print $$2}' | sed 's/;$$//' | egrep -v '^(strict|warnings)$$' | sort | uniq | while read MOD; do perl -Itest/ -M"$$MOD" -e '1;' 2>/dev/null || echo "$$MOD" ; done | cpanm --skip-satisfied
test-perl:
@for FILE in $(PERL_SOURCES); do perl -Itest/ -c "$$FILE" || exit 1; done
test-bash:
@for FILE in $(BASH_SOURCES); do bash -n "$$FILE" && echo "$$FILE syntax OK" || exit 1; done
@if shellcheck -V >/dev/null 2>&1; then \
for FILE in $(BASH_SOURCES); do shellcheck "$$FILE" && echo "$$FILE no shellcheck warnings" || exit 1; done; \
else \
echo no further tests run, shellcheck binary is missing; \
fi