Debian Codegraph @

doc/Makefile

raw
1 # Copyright © 2013-2022 Jakub Wilk <[email protected]>
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the “Software”), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12 #
13 # THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20
21 version = $(shell IFS='()' read _ v _ < changelog && echo $$v)
22
23 .PHONY: all
24 all: localehelper.1
25
26 localehelper.1: manpage.pod changelog
27 perl -p -e 's/L<([a-z_-]+)[(]([0-9]+)[)]>/B<\1>(\2)/g' $(<) \
28 | pod2man --utf8 -c '' -n LOCALEHELPER -r 'localehelper $(version)' \
29 > $(@).tmp
30 mv $(@).tmp $(@)
31
32 .PHONY: check
33 check: check-changelog check-pod check-rst
34
35 .PHONY: check-changelog
36 check-changelog: changelog
37 dpkg-parsechangelog -l$(<) --all 2>&1 >/dev/null | { ! grep .; }
38
39 .PHONY: check-pod
40 check-pod: manpage.pod
41 podchecker -warnings -warnings $(<)
42
43 rst2xml = $(notdir $(shell command -v rst2xml || echo rst2xml.py))
44
45 .PHONY: check-rst
46 check-rst:
47 $(rst2xml) --input-encoding=UTF-8 --strict README > /dev/null
48
49 .PHONY: clean
50 clean:
51 rm -f *.1 *.tmp
52
53 .error = GNU make is required
54
55 # vim:ts=4 sts=4 sw=4 noet