Release new version 1:20210208+grml.5
[live-boot-grml.git] / manpages / Makefile
1 # Makefile
2
3 SHELL := sh -e
4
5 LANGUAGES = $(shell cd po && ls)
6
7 all: build
8
9 po4a.cfg:
10         echo "[po4a_langs] $(LANGUAGES)" > po4a.cfg
11         echo "[po4a_paths] pot/\$$master.pot \$$lang:po/\$$lang/\$$master.po" >> po4a.cfg
12
13         for MANPAGE in en/*; \
14         do \
15                 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
16                 echo "[type: man] $${MANPAGE} \$$lang:\$$lang/$$(basename $${MANPAGE} .$${SECTION}).\$$lang.$${SECTION}" >> po4a.cfg; \
17         done
18
19 update:
20         ./bin/update-version.sh
21
22 build: check po4a.cfg
23         @if [ ! -x "$$(which po4a 2>/dev/null)" ]; \
24         then \
25                 echo "E: po4a - command not found"; \
26                 echo "I: po4a can be obtained from https://po4a.org"; \
27                 echo "I: On Debian based systems, po4a can be installed with 'apt-get install po4a'."; \
28                 exit 1; \
29         fi
30
31         po4a --copyright-holder "Debian Live Project" --keep 0 --package-name live-boot --package-version $(shell cd ..;dpkg-parsechangelog -S Version) po4a.cfg
32
33 clean:
34         rm -rf $(LANGUAGES)
35
36 distclean: clean
37         rm -f po4a.cfg
38
39 rebuild: distclean update build
40
41 check:
42         @echo -n "Checking the integrity of .po files "
43
44         @if [ -x /usr/bin/msgfmt ]; \
45         then \
46                 for POFILE in po/*/*; \
47                 do \
48                         msgfmt --check --output-file=/dev/null $${POFILE}; \
49                         echo -n "."; \
50                 done; \
51         else \
52                 echo "WARNING: skipping po integrity check. You must install gettext."; \
53         fi
54         
55         @echo " done!"
56
57 .PHONY: po4a.cfg