]>
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 | 31 | |
75f37d7d | 32 | $($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES) |
e46a23a5 DK |
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; \ | |
45 | done | |
46 | ||
e46a23a5 DK |
47 | # Clean rule |
48 | .PHONY: veryclean/$(LOCAL) | |
e4bc41c7 | 49 | veryclean: veryclean/$(LOCAL) |
e46a23a5 DK |
50 | veryclean/$(LOCAL): |
51 | -rm -rf $($(@F)-LIST) | |
52 | ||
53 | endif | |
54 | ||
55 | # Chain to the manpage rule | |
56 | SOURCE = apt.8 | |
57 | include $(MANPAGE_H) | |
c3c459fc | 58 | |
04e9cc08 DK |
59 | examples/sources.list: examples/sources.list.in apt-verbatim.ent |
60 | sed -e 's#&stable-codename;#$(shell grep --max-count=1 '^<!ENTITY stable-codename "' apt-verbatim.ent | cut -d'"' -f 2)#g' examples/sources.list.in > examples/sources.list | |
61 | ||
c3c459fc | 62 | # Examples |
fcdd9cdd | 63 | SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf |
c3c459fc | 64 | TO = $(DOC) |
8319e9c3 | 65 | TARGET = binary |
c3c459fc | 66 | include $(COPY_H) |
9975c278 | 67 | |
b45fb8db | 68 | .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc |
9975c278 | 69 | |
b01390ea DK |
70 | clean: clean-subdirs |
71 | veryclean: veryclean-subdirs | |
f1813c1a | 72 | |
2a52e8c5 DK |
73 | clean-subdirs: |
74 | for dir in $(SUBDIRS); do\ | |
b01390ea DK |
75 | $(MAKE) -C $$dir clean; \ |
76 | done | |
77 | ||
78 | veryclean-subdirs: | |
79 | for dir in $(SUBDIRS); do\ | |
22d1b5c9 | 80 | rm -rf $$dir; \ |
2a52e8c5 | 81 | done |
8667550d | 82 | |
a11afb9d DK |
83 | .PHONY: update-po po4a stats |
84 | ||
b01390ea DK |
85 | ifdef PO4A |
86 | doc: po4a | |
87 | ||
b01390ea | 88 | update-po: |
1c46aec4 | 89 | po4a --previous --no-backups --force --no-translations \ |
aec22160 | 90 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ |
1c46aec4 | 91 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf |
b01390ea | 92 | |
2a52e8c5 | 93 | po4a: |
1c46aec4 | 94 | po4a --previous --no-backups \ |
aec22160 | 95 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ |
1c46aec4 | 96 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf |
a11afb9d | 97 | endif |
b45fb8db DK |
98 | |
99 | stats: | |
1c46aec4 | 100 | for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done |
b45fb8db | 101 | |
3174e150 MV |
102 | ifdef DOXYGEN |
103 | DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) ) | |
104 | ||
105 | clean: doxygen-clean | |
106 | ||
107 | doxygen-clean: | |
108 | rm -fr $(BUILD)/doc/doxygen | |
109 | rm -f $(BUILD)/doc/doxygen-stamp | |
110 | ||
3174e150 MV |
111 | $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile |
112 | rm -fr $(BUILD)/doc/doxygen | |
00c6e1a3 | 113 | mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799 |
3174e150 MV |
114 | $(DOXYGEN) $(BUILD)/doc/Doxyfile |
115 | touch $(BUILD)/doc/doxygen-stamp | |
116 | ||
117 | doc: $(BUILD)/doc/doxygen-stamp | |
3174e150 | 118 | endif |