]>
Commit | Line | Data |
---|---|---|
b01390ea DK |
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 | |
13 | SOURCE = $(patsubst %.xml,%,$(wildcard *.$(LC).?.xml)) | |
0c1a7101 | 14 | INCLUDES = apt.ent apt-verbatim.ent |
b01390ea DK |
15 | |
16 | # Do not use XMLTO, build the manpages directly with XSLTPROC | |
17 | ifdef XSLTPROC | |
18 | ||
bcf91c1b | 19 | STYLESHEET=../manpage-style.xsl |
b01390ea DK |
20 | |
21 | LOCAL := po4a-manpage-$(firstword $(SOURCE)) | |
22 | $(LOCAL)-LIST := $(SOURCE) | |
23 | ||
24 | # Install generation hooks | |
25 | doc: $($(LOCAL)-LIST) | |
26 | veryclean: veryclean/$(LOCAL) | |
27 | ||
0c1a7101 DK |
28 | apt-verbatim.ent: ../apt-verbatim.ent |
29 | cp ../apt-verbatim.ent . | |
30 | ||
b01390ea DK |
31 | $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES) |
32 | echo Creating man page $@ | |
b6d189ca | 33 | $(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here??? |
9cdb1aab | 34 | test -f $(subst .$(LC),,$@) || echo FIXME: xsltproc respect the -o flag now, workaround can be removed |
b01390ea DK |
35 | mv -f $(subst .$(LC),,$@) $@ |
36 | ||
37 | # Clean rule | |
38 | .PHONY: veryclean/$(LOCAL) | |
39 | veryclean/$(LOCAL): | |
0c1a7101 | 40 | -rm -rf $($(@F)-LIST) apt.ent apt-verbatim.ent apt.$(LC).8 \ |
93517da3 DK |
41 | $(addsuffix .xml,$($(@F)-LIST)) \ |
42 | offline.$(LC).sgml guide.$(LC).sgml | |
b01390ea DK |
43 | |
44 | HAVE_PO4A=yes | |
45 | endif | |
46 | ||
47 | # take care of the rest | |
7652e03e | 48 | SOURCE := $(SOURCE) $(wildcard apt.$(LC).8) |
b01390ea DK |
49 | INCLUDES := |
50 | ||
51 | ifndef HAVE_PO4A | |
52 | # Strip from the source list any man pages we dont have compiled already | |
53 | SOURCE := $(wildcard $(SOURCE)) | |
54 | endif | |
55 | ||
56 | # Chain to the manpage rule | |
57 | ifneq ($(words $(SOURCE)),0) | |
58 | include $(MANPAGE_H) | |
59 | endif | |
7652e03e DK |
60 | |
61 | # Debian Doc SGML Documents | |
62 | SOURCE := $(wildcard *.$(LC).sgml) | |
46e39c8e | 63 | DEBIANDOC_HTML_OPTIONS=-l $(LC).UTF-8 |
7652e03e | 64 | include $(DEBIANDOC_H) |