Debian Codegraph @

share/man/Makefile

raw
1 # dehydrated-tools-extra
2 # Copyright (C) 2014-2026 Daniel Baumann <[email protected]>
3 #
4 # SPDX-License-Identifier: GPL-3.0+
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19 # Depends: python3-docutils
20
21 RST2MAN = rst2man \
22 --no-datestamp \
23 --no-generator \
24 --strict \
25 --strip-comments \
26 --tab-width=4 \
27 --verbose
28
29 VERSION := $(shell cat ../../VERSION.txt)
30
31 SHELL := sh -e
32
33 all: build
34
35 build: man
36
37 man: man.in *.rst
38 @echo -n "Creating manpages... "
39
40 @for FILE in *.rst; \
41 do \
42 cp man.in $$(basename $${FILE} .rst); \
43 $(RST2MAN) $${FILE} | \
44 sed -e '/^.\\" Man page generated/d' \
45 -e '/^.\\" Generated by/d' \
46 -e "s|^\(.TH .*\) \(\"\" \"\"\) |\1 $${VERSION} dehydrated-tools-extra |" \
47 >> $$(basename $${FILE} .rst); \
48 echo -n "."; \
49 done
50
51 @echo " done."
52
53 clean:
54 rm -f *.[0-9]
55
56 distclean: clean
57
58 rebuild: clean build