]> git.saurik.com Git - apt.git/blame_incremental - buildlib/po4a_manpage.mak
dequote URL taken from Location in redirects as we will otherwise
[apt.git] / buildlib / po4a_manpage.mak
... / ...
CommitLineData
1# -*- make -*-
2
3# This handles man pages with po4a. We convert to the respective
4# output in the source directory then copy over to the final dest. This
5# means po4a is only needed if compiling from bzr
6
7# Input
8# $(LC) - The language code of the translation
9
10# See defaults.mak for information about LOCAL
11
12# generate a list of accepted man page translations
13SOURCE = $(patsubst %.xml,%,$(wildcard *.$(LC).?.xml))
14INCLUDES = apt.ent apt-verbatim.ent
15
16# Do not use XMLTO, build the manpages directly with XSLTPROC
17ifdef XSLTPROC
18
19STYLESHEET=../manpage-style.xsl
20
21LOCAL := po4a-manpage-$(firstword $(SOURCE))
22$(LOCAL)-LIST := $(SOURCE)
23
24# Install generation hooks
25doc: $($(LOCAL)-LIST)
26veryclean: veryclean/$(LOCAL)
27
28apt-verbatim.ent: ../apt-verbatim.ent
29 cp ../apt-verbatim.ent .
30
31$($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
32 echo Creating man page $@
33 $(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
34 test -f $(subst .$(LC),,$@) || echo FIXME: xsltproc respect the -o flag now, workaround can be removed
35 mv -f $(subst .$(LC),,$@) $@
36
37# Clean rule
38.PHONY: veryclean/$(LOCAL)
39veryclean/$(LOCAL):
40 -rm -rf $($(@F)-LIST) apt.ent apt-verbatim.ent apt.$(LC).8 \
41 $(addsuffix .xml,$($(@F)-LIST)) \
42 offline.$(LC).sgml guide.$(LC).sgml
43
44HAVE_PO4A=yes
45endif
46
47# take care of the rest
48SOURCE := $(SOURCE) $(wildcard apt.$(LC).8)
49INCLUDES :=
50
51ifndef HAVE_PO4A
52# Strip from the source list any man pages we dont have compiled already
53SOURCE := $(wildcard $(SOURCE))
54endif
55
56# Chain to the manpage rule
57ifneq ($(words $(SOURCE)),0)
58include $(MANPAGE_H)
59endif
60
61# Debian Doc SGML Documents
62SOURCE := $(wildcard *.$(LC).sgml)
63DEBIANDOC_HTML_OPTIONS=-l $(LC).UTF-8
64include $(DEBIANDOC_H)