]>
Commit | Line | Data |
---|---|---|
ac966541 AL |
1 | # -*- make -*- |
2 | BASE=.. | |
3164dff9 | 3 | SUBDIR=doc |
b01390ea | 4 | SUBDIRS= $(dir $(wildcard */makefile)) |
ac966541 AL |
5 | |
6 | # Bring in the default rules | |
7 | include ../buildlib/defaults.mak | |
8 | ||
b2e465d6 | 9 | # Debian Doc SGML Documents |
7652e03e | 10 | SOURCE = $(wildcard *.sgml) |
46e39c8e | 11 | DEBIANDOC_HTML_OPTIONS=-l en.UTF-8 |
ac966541 AL |
12 | include $(DEBIANDOC_H) |
13 | ||
e4bc41c7 DK |
14 | MANPAGEPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po))) |
15 | MANPAGEPOLIST = $(patsubst %,manpages-translation-%,$(MANPAGEPO)) | |
16 | ||
17 | doc: manpages | |
18 | ||
e46a23a5 DK |
19 | # Do not use XMLTO, build the manpages directly with XSLTPROC |
20 | ifdef XSLTPROC | |
21 | # generate a list of accepted man page translations | |
22 | SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml)) | |
fd4bd902 | 23 | INCLUDES = apt.ent apt-verbatim.ent |
e46a23a5 DK |
24 | STYLESHEET=manpage-style.xsl |
25 | ||
26 | LOCAL := manpage-$(firstword $(SOURCE)) | |
27 | $(LOCAL)-LIST := $(SOURCE) | |
28 | ||
29 | # Install generation hooks | |
e4bc41c7 | 30 | manpages: $(MANPAGEPOLIST) $($(LOCAL)-LIST) |
e46a23a5 DK |
31 | |
32 | $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES) | |
33 | echo Creating man page $@ | |
34 | $(XSLTPROC) -o $@ $(STYLESHEET) $< | |
35 | ||
e4bc41c7 DK |
36 | $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a |
37 | $(MAKE) -C $(dir $<) doc | |
38 | ||
39 | .PHONY: manpages dirs-manpage-subdirs $(MANPAGEPOLIST) | |
40 | dirs: dirs-manpage-subdirs | |
41 | dirs-manpage-subdirs: | |
42 | for i in $(MANPAGEPO); do \ | |
43 | test -d $$i || mkdir $$i; \ | |
44 | test -f $$i/makefile || sed "s#@@LANG@@#$$i#" lang.makefile > $$i/makefile; \ | |
1c8754c2 DK |
45 | test -f $$i/manpage-style.xsl || sed "/<!-- LANGUAGE -->/ i\ |
46 | <xsl:param name=\"l10n.gentext.default.language\" select=\"'$$i'\" />" manpage-style.xsl > $$i/manpage-style.xsl; \ | |
e4bc41c7 DK |
47 | done |
48 | ||
e46a23a5 DK |
49 | # Clean rule |
50 | .PHONY: veryclean/$(LOCAL) | |
e4bc41c7 | 51 | veryclean: veryclean/$(LOCAL) |
e46a23a5 DK |
52 | veryclean/$(LOCAL): |
53 | -rm -rf $($(@F)-LIST) | |
54 | ||
55 | endif | |
56 | ||
57 | # Chain to the manpage rule | |
58 | SOURCE = apt.8 | |
59 | include $(MANPAGE_H) | |
c3c459fc AL |
60 | |
61 | # Examples | |
fcdd9cdd | 62 | SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf |
c3c459fc | 63 | TO = $(DOC) |
8319e9c3 | 64 | TARGET = binary |
c3c459fc | 65 | include $(COPY_H) |
9975c278 | 66 | |
b45fb8db | 67 | .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc |
9975c278 | 68 | |
b01390ea DK |
69 | clean: clean-subdirs |
70 | veryclean: veryclean-subdirs | |
f1813c1a | 71 | |
2a52e8c5 DK |
72 | clean-subdirs: |
73 | for dir in $(SUBDIRS); do\ | |
b01390ea DK |
74 | $(MAKE) -C $$dir clean; \ |
75 | done | |
76 | ||
77 | veryclean-subdirs: | |
78 | for dir in $(SUBDIRS); do\ | |
22d1b5c9 | 79 | rm -rf $$dir; \ |
2a52e8c5 | 80 | done |
8667550d | 81 | |
a11afb9d DK |
82 | .PHONY: update-po po4a stats |
83 | ||
b01390ea DK |
84 | ifdef PO4A |
85 | doc: po4a | |
86 | ||
b01390ea DK |
87 | update-po: |
88 | po4a --previous --no-backups --force --no-translations po4a.conf | |
89 | ||
2a52e8c5 DK |
90 | po4a: |
91 | po4a --previous --no-backups po4a.conf | |
a11afb9d | 92 | endif |
b45fb8db DK |
93 | |
94 | stats: | |
95 | for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done | |
96 | ||
3174e150 MV |
97 | ifdef DOXYGEN |
98 | DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) ) | |
99 | ||
100 | clean: doxygen-clean | |
101 | ||
102 | doxygen-clean: | |
103 | rm -fr $(BUILD)/doc/doxygen | |
104 | rm -f $(BUILD)/doc/doxygen-stamp | |
105 | ||
3174e150 MV |
106 | $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile |
107 | rm -fr $(BUILD)/doc/doxygen | |
00c6e1a3 | 108 | mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799 |
3174e150 MV |
109 | $(DOXYGEN) $(BUILD)/doc/Doxyfile |
110 | touch $(BUILD)/doc/doxygen-stamp | |
111 | ||
112 | doc: $(BUILD)/doc/doxygen-stamp | |
3174e150 | 113 | endif |