]> git.saurik.com Git - apt.git/blame_incremental - doc/makefile
* doc/makefile:
[apt.git] / doc / makefile
... / ...
CommitLineData
1# -*- make -*-
2BASE=..
3SUBDIR=doc
4SUBDIRS= $(dir $(wildcard */makefile))
5
6# Bring in the default rules
7include ../buildlib/defaults.mak
8
9# Debian Doc SGML Documents
10SOURCE = $(wildcard *.sgml)
11DEBIANDOC_HTML_OPTIONS=-l en.UTF-8
12include $(DEBIANDOC_H)
13
14MANPAGEPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po)))
15MANPAGEPOLIST = $(patsubst %,manpages-translation-%,$(MANPAGEPO))
16
17doc: manpages
18
19# Do not use XMLTO, build the manpages directly with XSLTPROC
20ifdef XSLTPROC
21# generate a list of accepted man page translations
22SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml))
23INCLUDES = apt.ent apt-verbatim.ent
24STYLESHEET=manpage-style.xsl
25
26LOCAL := manpage-$(firstword $(SOURCE))
27$(LOCAL)-LIST := $(SOURCE)
28
29# Install generation hooks
30manpages: $(MANPAGEPOLIST) $($(LOCAL)-LIST)
31
32$($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
33 echo Creating man page $@
34 $(XSLTPROC) -o $@ $(STYLESHEET) $<
35
36$(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a
37 $(MAKE) -C $(dir $<) doc
38
39.PHONY: manpages dirs-manpage-subdirs $(MANPAGEPOLIST)
40dirs: dirs-manpage-subdirs
41dirs-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 test -f $$i/manpage-style.xsl || sed "/<!-- LANGUAGE -->/ i\
46<xsl:param name=\"l10n.gentext.default.language\" select=\"'$$i'\" />" manpage-style.xsl > $$i/manpage-style.xsl; \
47 done
48
49# Clean rule
50.PHONY: veryclean/$(LOCAL)
51veryclean: veryclean/$(LOCAL)
52veryclean/$(LOCAL):
53 -rm -rf $($(@F)-LIST)
54
55endif
56
57# Chain to the manpage rule
58SOURCE = apt.8
59include $(MANPAGE_H)
60
61# Examples
62SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
63TO = $(DOC)
64TARGET = binary
65include $(COPY_H)
66
67.PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc
68
69clean: clean-subdirs
70veryclean: veryclean-subdirs
71
72clean-subdirs:
73 for dir in $(SUBDIRS); do\
74 $(MAKE) -C $$dir clean; \
75 done
76
77veryclean-subdirs:
78 for dir in $(SUBDIRS); do\
79 rm -rf $$dir; \
80 done
81
82.PHONY: update-po po4a stats
83
84ifdef PO4A
85doc: po4a
86
87update-po:
88 po4a --previous --no-backups --force --no-translations po4a.conf
89
90po4a:
91 po4a --previous --no-backups po4a.conf
92endif
93
94stats:
95 for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
96
97ifdef DOXYGEN
98DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
99
100clean: doxygen-clean
101
102doxygen-clean:
103 rm -fr $(BUILD)/doc/doxygen
104 rm -f $(BUILD)/doc/doxygen-stamp
105
106$(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
107 rm -fr $(BUILD)/doc/doxygen
108 mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
109 $(DOXYGEN) $(BUILD)/doc/Doxyfile
110 touch $(BUILD)/doc/doxygen-stamp
111
112doc: $(BUILD)/doc/doxygen-stamp
113endif