Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # resolve DEB_VERSION
4 include /usr/share/dpkg/pkg-info.mk
5
6 # generate documentation unless nodoc requested
7 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
8 DOCS = README.html README.txt
9 CHANGELOGS = CHANGELOG.html CHANGELOG.txt
10 endif
11
12 ESLINT = eslint
13 MOCHA = mocha
14 # normalize output with TAP where possible unless terse requested
15 ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
16 ESLINT += --format tap
17 MOCHA += --reporter tap
18 else
19 ESLINT += --format unix
20 MOCHA += --reporter dot --no-colors
21 endif
22
23 override_dh_clean:
24 dh_clean -- $(DOCS) $(CHANGELOGS)
25
26 override_dh_auto_build: $(DOCS) $(CHANGELOGS)
27
28 override_dh_auto_test:
29 $(ESLINT) Xcomposer
30 $(ESLINT) . --ignore-pattern '.*'
31 $(MOCHA) --recursive Xcomposer/tests
32 $(MOCHA) --recursive tests
33
34 override_dh_installdocs:
35 dh_installdocs --all -- $(DOCS)
36
37 override_dh_installchangelogs:
38 dh_installchangelogs -- $(CHANGELOGS)
39
40 override_dh_gencontrol:
41 dh_gencontrol -- -V"composer:Version=$(shell jq --raw-output .version < Xcomposer/package.json)~$(DEB_VERSION)"
42
43 %.html: %.md
44 cmark-gfm $< > $@
45
46 %.txt: %.md
47 cmark-gfm --to plaintext $< > $@
48
49 %:
50 dh $@