forked from sipwise/ngcpcfg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (55 loc) · 1.89 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# for syntax checks
BASH_SCRIPTS = scripts/* functions/* etc/ngcp-config/ngcpcfg.cfg helper/build_config sbin/ngcpcfg helper/tt2-wrapper
PERL_SCRIPTS = helper/sort-yml \
helper/sync-db \
helper/tt2-daemon \
helper/validate-yml helper/fileformat_version \
sbin/ngcp-network \
sbin/ngcp-network-validator \
sbin/ngcp-sync-constants \
sbin/ngcp-sync-grants
RESULTS ?= results
all: docs
docs: html pdf epub man
html:
asciidoc docs/ngcpcfg.txt
pdf:
a2x --icons -a toc -a toclevels=3 -a docinfo -f pdf docs/ngcpcfg.txt
epub:
a2x --icons -a toc -a toclevels=3 -a docinfo -f epub docs/ngcpcfg.txt
man:
asciidoc -d manpage -b docbook docs/ngcpcfg.txt
sed -i 's/<emphasis role="strong">/<emphasis role="bold">/' docs/ngcpcfg.xml
xsltproc --nonet /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl docs/ngcpcfg.xml
pod2man --section=8 sbin/ngcp-network > ngcp-network.8
pod2man --section=8 sbin/ngcp-sync-constants > ngcp-sync-constants.8
pod2man --section=8 sbin/ngcp-sync-grants > ngcp-sync-grants.8
clean:
rm -f docs/ngcpcfg.xml docs/ngcpcfg.epub docs/ngcpcfg.html docs/ngcpcfg.pdf
rm -f ngcpcfg.8 ngcp-network.8 ngcp-sync-constants.8 ngcp-sync-grants.8
rm -rf t/__pycache__ t/fixtures/__pycache__/ t/*.pyc
dist-clean: clean
rm -f docs/ngcpcfg.html docs/ngcpcfg.pdf
rm -f docs/ngcpcfg.epub ngcpcfg.8
rm -rf results
# check for syntax errors
syntaxcheck: shellcheck perlcheck
shellcheck:
@echo -n "Checking for shell syntax errors"; \
for SCRIPT in $(BASH_SCRIPTS); do \
test -r $${SCRIPT} || continue ; \
bash -n $${SCRIPT} || exit ; \
echo -n "."; \
done; \
echo " done."; \
perlcheck:
@echo "Checking for perl syntax errors:"; \
for SCRIPT in $(PERL_SCRIPTS); do \
test -r $${SCRIPT} || continue ; \
perl -CSD -w -c $${SCRIPT} || exit ; \
done; \
echo "-> perl check done."; \
test:
mkdir -p $(RESULTS)
cd t ; py.test-3 --junit-xml=../$(RESULTS)/pytest.xml -v
# EOF