]> git.saurik.com Git - apt.git/blame - doc/makefile
* apt-pkg/clean.cc:
[apt.git] / doc / makefile
CommitLineData
ac966541
AL
1# -*- make -*-
2BASE=..
3164dff9 3SUBDIR=doc
b01390ea 4SUBDIRS= $(dir $(wildcard */makefile))
ac966541
AL
5
6# Bring in the default rules
7include ../buildlib/defaults.mak
8
b2e465d6 9# Debian Doc SGML Documents
7652e03e 10SOURCE = $(wildcard *.sgml)
46e39c8e 11DEBIANDOC_HTML_OPTIONS=-l en.UTF-8
ac966541
AL
12include $(DEBIANDOC_H)
13
1098ae37 14doc: manpages debiandoc
e4bc41c7 15
e46a23a5
DK
16# Do not use XMLTO, build the manpages directly with XSLTPROC
17ifdef XSLTPROC
18# generate a list of accepted man page translations
19SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml))
fd4bd902 20INCLUDES = apt.ent apt-verbatim.ent
e46a23a5
DK
21STYLESHEET=manpage-style.xsl
22
23LOCAL := manpage-$(firstword $(SOURCE))
24$(LOCAL)-LIST := $(SOURCE)
25
26# Install generation hooks
1098ae37 27manpages: $($(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 35veryclean: veryclean/$(LOCAL)
e46a23a5
DK
36veryclean/$(LOCAL):
37 -rm -rf $($(@F)-LIST)
e46a23a5
DK
38endif
39
40# Chain to the manpage rule
41SOURCE = apt.8
42include $(MANPAGE_H)
c3c459fc 43
04e9cc08
DK
44examples/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 48SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
c3c459fc 49TO = $(DOC)
8319e9c3 50TARGET = binary
c3c459fc 51include $(COPY_H)
9975c278 52
1098ae37 53.PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc stats
9975c278 54
b01390ea
DK
55clean: clean-subdirs
56veryclean: veryclean-subdirs
f1813c1a 57
2a52e8c5
DK
58clean-subdirs:
59 for dir in $(SUBDIRS); do\
b01390ea
DK
60 $(MAKE) -C $$dir clean; \
61 done
62
63veryclean-subdirs:
64 for dir in $(SUBDIRS); do\
22d1b5c9 65 rm -rf $$dir; \
2a52e8c5 66 done
8667550d 67
1098ae37
DK
68stats:
69 for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done
a11afb9d 70
b01390ea 71ifdef PO4A
1098ae37
DK
72DOCUMENTATIONPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po)))
73MANPAGEPOLIST = $(addprefix manpages-translation-,$(DOCUMENTATIONPO))
74DEBIANDOCPOLIST = $(addprefix debiandoc-translation-,$(DOCUMENTATIONPO))
75
76MANPAGEDIRLIST = $(addsuffix /makefile,$(DOCUMENTATIONPO))
77
78.PHONY: update-po po4a $(MANPAGEPOLIST) $(MANPAGEDIRLIST)
79
80manpages: $(MANPAGEPOLIST)
81debiandoc: $(DEBIANDOCPOLIST)
82po4a: $(MANPAGEPOLIST) $(DEBIANDOCPOLIST)
b01390ea 83
b01390ea 84update-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
110dirs: $(MANPAGEDIRLIST)
111$(MANPAGEDIRLIST) :: %/makefile : lang.makefile
112 test -d $(dir $@) || mkdir $(dir $@)
113 sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@
114endif
b45fb8db 115
3174e150
MV
116ifdef DOXYGEN
117DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
118
119clean: doxygen-clean
120
121doxygen-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 131debiandoc: $(BUILD)/doc/doxygen-stamp
3174e150 132endif