]>
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 | ||
1098ae37 | 14 | doc: manpages debiandoc |
e4bc41c7 | 15 | |
e46a23a5 DK |
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)) | |
fd4bd902 | 20 | INCLUDES = apt.ent apt-verbatim.ent |
e46a23a5 DK |
21 | STYLESHEET=manpage-style.xsl |
22 | ||
23 | LOCAL := manpage-$(firstword $(SOURCE)) | |
24 | $(LOCAL)-LIST := $(SOURCE) | |
25 | ||
26 | # Install generation hooks | |
1098ae37 | 27 | manpages: $($(LOCAL)-LIST) |
e46a23a5 | 28 | |
75f37d7d | 29 | $($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES) |
e46a23a5 DK |
30 | echo Creating man page $@ |
31 | $(XSLTPROC) -o $@ $(STYLESHEET) $< | |
32 | ||
33 | # Clean rule | |
34 | .PHONY: veryclean/$(LOCAL) | |
e4bc41c7 | 35 | veryclean: veryclean/$(LOCAL) |
e46a23a5 DK |
36 | veryclean/$(LOCAL): |
37 | -rm -rf $($(@F)-LIST) | |
e46a23a5 DK |
38 | endif |
39 | ||
40 | # Chain to the manpage rule | |
41 | SOURCE = apt.8 | |
42 | include $(MANPAGE_H) | |
c3c459fc | 43 | |
04e9cc08 DK |
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 | ||
c3c459fc | 47 | # Examples |
fcdd9cdd | 48 | SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf |
c3c459fc | 49 | TO = $(DOC) |
8319e9c3 | 50 | TARGET = binary |
c3c459fc | 51 | include $(COPY_H) |
9975c278 | 52 | |
1098ae37 | 53 | .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc stats |
9975c278 | 54 | |
b01390ea DK |
55 | clean: clean-subdirs |
56 | veryclean: veryclean-subdirs | |
f1813c1a | 57 | |
2a52e8c5 DK |
58 | clean-subdirs: |
59 | for dir in $(SUBDIRS); do\ | |
b01390ea DK |
60 | $(MAKE) -C $$dir clean; \ |
61 | done | |
62 | ||
63 | veryclean-subdirs: | |
64 | for dir in $(SUBDIRS); do\ | |
22d1b5c9 | 65 | rm -rf $$dir; \ |
2a52e8c5 | 66 | done |
8667550d | 67 | |
1098ae37 DK |
68 | stats: |
69 | for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done | |
a11afb9d | 70 | |
b01390ea | 71 | ifdef PO4A |
1098ae37 DK |
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) | |
b01390ea | 83 | |
b01390ea | 84 | update-po: |
1c46aec4 | 85 | po4a --previous --no-backups --force --no-translations \ |
aec22160 | 86 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ |
1c46aec4 | 87 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf |
b01390ea | 88 | |
1098ae37 DK |
89 | $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf |
90 | po4a --previous --no-backups --translate-only $(dir $<)apt.ent \ | |
91 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \ | |
92 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \ | |
93 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \ | |
94 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \ | |
95 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \ | |
96 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \ | |
97 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \ | |
98 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \ | |
aec22160 | 99 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ |
1c46aec4 | 100 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf |
1098ae37 | 101 | $(MAKE) -C $(dir $<) manpages |
b45fb8db | 102 | |
1098ae37 DK |
103 | $(DEBIANDOCPOLIST) :: debiandoc-translation-% : %/makefile po4a.conf |
104 | po4a --previous --no-backups --translate-only $(dir $<)apt.ent \ | |
105 | $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.sgml,%.$(subst /,,$(dir $<)).sgml,$(wildcard *.sgml))) \ | |
106 | --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \ | |
107 | --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf | |
108 | $(MAKE) -C $(dir $<) debiandoc | |
109 | ||
110 | dirs: $(MANPAGEDIRLIST) | |
111 | $(MANPAGEDIRLIST) :: %/makefile : lang.makefile | |
112 | test -d $(dir $@) || mkdir $(dir $@) | |
113 | sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@ | |
114 | endif | |
b45fb8db | 115 | |
3174e150 MV |
116 | ifdef DOXYGEN |
117 | DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) ) | |
118 | ||
119 | clean: doxygen-clean | |
120 | ||
121 | doxygen-clean: | |
122 | rm -fr $(BUILD)/doc/doxygen | |
123 | rm -f $(BUILD)/doc/doxygen-stamp | |
124 | ||
3174e150 MV |
125 | $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile |
126 | rm -fr $(BUILD)/doc/doxygen | |
00c6e1a3 | 127 | mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799 |
3174e150 MV |
128 | $(DOXYGEN) $(BUILD)/doc/Doxyfile |
129 | touch $(BUILD)/doc/doxygen-stamp | |
130 | ||
1098ae37 | 131 | debiandoc: $(BUILD)/doc/doxygen-stamp |
3174e150 | 132 | endif |