]> git.saurik.com Git - apt.git/blame - doc/makefile
* apt-pkg/deb/debversion.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 89$(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf
34c2a164 90 # first line is for apt.8 (see Bug#696923)
1098ae37 91 po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
34c2a164 92 $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8,%.$(subst /,,$(dir $<)).8,$(wildcard *.8))) \
1098ae37
DK
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))) \
aec22160 101 --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
1c46aec4 102 --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
1098ae37 103 $(MAKE) -C $(dir $<) manpages
b45fb8db 104
1098ae37
DK
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
112dirs: $(MANPAGEDIRLIST)
113$(MANPAGEDIRLIST) :: %/makefile : lang.makefile
114 test -d $(dir $@) || mkdir $(dir $@)
115 sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@
116endif
b45fb8db 117
3174e150
MV
118ifdef DOXYGEN
119DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
120
121clean: doxygen-clean
122
123doxygen-clean:
124 rm -fr $(BUILD)/doc/doxygen
125 rm -f $(BUILD)/doc/doxygen-stamp
126
3174e150
MV
127$(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
128 rm -fr $(BUILD)/doc/doxygen
00c6e1a3 129 mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
3174e150
MV
130 $(DOXYGEN) $(BUILD)/doc/Doxyfile
131 touch $(BUILD)/doc/doxygen-stamp
132
1098ae37 133debiandoc: $(BUILD)/doc/doxygen-stamp
3174e150 134endif