use only one xsl file (and therefore utf-8) for all languages
[ntk/apt.git] / buildlib / po4a_manpage.mak
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))
14 INCLUDES = apt.ent
15
16 # Do not use XMLTO, build the manpages directly with XSLTPROC
17 ifdef XSLTPROC
18
19 STYLESHEET=../manpage-style.xsl
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
28 $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
29 echo Creating man page $@
30 $(XSLTPROC) -o $@ $(STYLESHEET) $< # why xsltproc doesn't respect the -o flag here???
31 mv -f $(subst .$(LC),,$@) $@
32
33 # Clean rule
34 .PHONY: veryclean/$(LOCAL)
35 veryclean/$(LOCAL):
36 -rm -rf $($(@F)-LIST) apt.ent apt.$(LC).8 \
37 $(addsuffix .xml,$($(@F)-LIST))
38
39 HAVE_PO4A=yes
40 endif
41
42 # take care of the rest
43 SOURCE := $(SOURCE) apt.$(LC).8
44 INCLUDES :=
45
46 ifndef HAVE_PO4A
47 # Strip from the source list any man pages we dont have compiled already
48 SOURCE := $(wildcard $(SOURCE))
49 endif
50
51 # Chain to the manpage rule
52 ifneq ($(words $(SOURCE)),0)
53 include $(MANPAGE_H)
54 endif