]>
Commit | Line | Data |
---|---|---|
1 | # -*- make -*- | |
2 | BASE=.. | |
3 | SUBDIR=doc | |
4 | SUBDIRS= $(dir $(wildcard */makefile)) | |
5 | ||
6 | # Bring in the default rules | |
7 | include ../buildlib/defaults.mak | |
8 | ||
9 | # Debian Doc SGML Documents | |
10 | SOURCE = $(wildcard *.sgml) | |
11 | DEBIANDOC_HTML_OPTIONS=-l en.UTF-8 | |
12 | include $(DEBIANDOC_H) | |
13 | ||
14 | doc: manpages debiandoc | |
15 | ||
16 | # Do not use XMLTO, build the manpages directly with XSLTPROC | |
17 | ifdef XSLTPROC | |
18 | # generate a list of accepted man page translations | |
19 | SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml)) | |
20 | INCLUDES = apt.ent apt-verbatim.ent | |
21 | STYLESHEET=manpage-style.xsl | |
22 | ||
23 | LOCAL := manpage-$(firstword $(SOURCE)) | |
24 | $(LOCAL)-LIST := $(SOURCE) | |
25 | ||
26 | # Install generation hooks | |
27 | manpages: $($(LOCAL)-LIST) | |
28 | ||
29 | $($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES) | |
30 | echo Creating man page $@ | |
31 | $(XSLTPROC) -o $@ $(STYLESHEET) $< | |
32 | ||
33 | # Clean rule | |
34 | .PHONY: veryclean/$(LOCAL) | |
35 | veryclean: veryclean/$(LOCAL) | |
36 | veryclean/$(LOCAL): | |
37 | -rm -rf $($(@F)-LIST) | |
38 | endif | |
39 | ||
40 | # Chain to the manpage rule | |
41 | SOURCE = apt.8 | |
42 | include $(MANPAGE_H) | |
43 | ||
44 | examples/sources.list: examples/sources.list.in apt-verbatim.ent | |
45 | 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 | |
46 | ||
47 | # Examples | |
48 | SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf | |
49 | TO = $(DOC) | |
50 | TARGET = binary | |
51 | include $(COPY_H) | |
52 | ||
53 | .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc stats | |
54 | ||
55 | clean: clean-subdirs | |
56 | veryclean: veryclean-subdirs | |
57 | ||
58 | clean-subdirs: | |
59 | for dir in $(SUBDIRS); do\ | |
60 | $(MAKE) -C $$dir clean; \ | |
61 | done | |
62 | ||
63 | veryclean-subdirs: | |
64 | for dir in $(SUBDIRS); do\ | |
65 | rm -rf $$dir; \ | |
66 | done | |
67 | ||
68 | stats: | |
69 | for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done | |
70 | ||
71 | ifdef PO4A | |
72 | DOCUMENTATIONPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po))) | |
73 | MANPAGEPOLIST = $(addprefix manpages-translation-,$(DOCUMENTATIONPO)) | |
74 | DEBIANDOCPOLIST = $(addprefix debiandoc-translation-,$(DOCUMENTATIONPO)) | |
75 | ||
76 | MANPAGEDIRLIST = $(addsuffix /makefile,$(DOCUMENTATIONPO)) | |
77 | ||
78 | .PHONY: update-po po4a $(MANPAGEPOLIST) $(MANPAGEDIRLIST) | |
79 | ||
80 | manpages: $(MANPAGEPOLIST) | |
81 | debiandoc: $(DEBIANDOCPOLIST) | |
82 | po4a: $(MANPAGEPOLIST) $(DEBIANDOCPOLIST) | |
83 | ||
84 | update-po: | |
85 | po4a --previous --no-backups --force --no-translations \ | |
86 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ | |
87 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf | |
88 | ||
89 | $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf | |
90 | # first line is for apt.8 (see Bug#696923) | |
91 | po4a --previous --no-backups --translate-only $(dir $<)apt.ent \ | |
92 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8,%.$(subst /,,$(dir $<)).8,$(wildcard *.8))) \ | |
93 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \ | |
94 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \ | |
95 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \ | |
96 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \ | |
97 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \ | |
98 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \ | |
99 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \ | |
100 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \ | |
101 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ | |
102 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf | |
103 | $(MAKE) -C $(dir $<) manpages | |
104 | ||
105 | $(DEBIANDOCPOLIST) :: debiandoc-translation-% : %/makefile po4a.conf | |
106 | po4a --previous --no-backups --translate-only $(dir $<)apt.ent \ | |
107 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.sgml,%.$(subst /,,$(dir $<)).sgml,$(wildcard *.sgml))) \ | |
108 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ | |
109 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf | |
110 | $(MAKE) -C $(dir $<) debiandoc | |
111 | ||
112 | dirs: $(MANPAGEDIRLIST) | |
113 | $(MANPAGEDIRLIST) :: %/makefile : lang.makefile | |
114 | test -d $(dir $@) || mkdir $(dir $@) | |
115 | sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@ | |
116 | endif | |
117 | ||
118 | ifdef DOXYGEN | |
119 | DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) ) | |
120 | ||
121 | clean: doxygen-clean | |
122 | ||
123 | doxygen-clean: | |
124 | rm -fr $(BUILD)/doc/doxygen | |
125 | rm -f $(BUILD)/doc/doxygen-stamp | |
126 | ||
127 | $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile | |
128 | rm -fr $(BUILD)/doc/doxygen | |
129 | mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799 | |
130 | $(DOXYGEN) $(BUILD)/doc/Doxyfile | |
131 | touch $(BUILD)/doc/doxygen-stamp | |
132 | ||
133 | debiandoc: $(BUILD)/doc/doxygen-stamp | |
134 | endif |