* apt-pkg/deb/debrecords.cc:
[ntk/apt.git] / doc / makefile
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 # Do not use XMLTO, build the manpages directly with XSLTPROC
15 ifdef XSLTPROC
16 # generate a list of accepted man page translations
17 SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml))
18 INCLUDES = apt.ent
19 STYLESHEET=manpage-style.xsl
20
21 LOCAL := manpage-$(firstword $(SOURCE))
22 $(LOCAL)-LIST := $(SOURCE)
23
24 # Install generation hooks
25 doc: $($(LOCAL)-LIST)
26 veryclean: veryclean/$(LOCAL)
27
28 $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
29 echo Creating man page $@
30 $(XSLTPROC) -o $@ $(STYLESHEET) $<
31
32 # Clean rule
33 .PHONY: veryclean/$(LOCAL)
34 veryclean/$(LOCAL):
35 -rm -rf $($(@F)-LIST)
36
37 endif
38
39 # Chain to the manpage rule
40 SOURCE = apt.8
41 include $(MANPAGE_H)
42
43 # Examples
44 SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
45 TO = $(DOC)
46 TARGET = binary
47 include $(COPY_H)
48
49 .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc
50 doc:
51 for i in $(shell ls po/*.po | sed -r 's#po/([a-z]+[A-Z_]*).po#\1#'); do \
52 test -d $$i || mkdir $$i; \
53 test -f $$i/makefile || sed "s#@@LANG@@#$$i#" lang.makefile > $$i/makefile; \
54 $(MAKE) -C $$i $@; \
55 done
56
57 clean: clean-subdirs
58 veryclean: veryclean-subdirs
59
60 clean-subdirs:
61 for dir in $(SUBDIRS); do\
62 $(MAKE) -C $$dir clean; \
63 done
64
65 veryclean-subdirs:
66 for dir in $(SUBDIRS); do\
67 rm -rf $$dir; \
68 done
69
70 ifdef PO4A
71 doc: po4a
72
73 clean: po4a-clean
74
75 .PHONY: update-po po4a stats
76 update-po:
77 po4a --previous --no-backups --force --no-translations po4a.conf
78
79 po4a-clean:
80 po4a --previous --rm-backups --rm-translations po4a.conf
81
82 po4a:
83 po4a --previous --no-backups po4a.conf
84
85 stats:
86 for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
87
88 endif
89
90 ifdef DOXYGEN
91 DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
92
93 clean: doxygen-clean
94
95 doxygen-clean:
96 rm -fr $(BUILD)/doc/doxygen
97 rm -f $(BUILD)/doc/doxygen-stamp
98
99 $(BUILD)/doc/Doxyfile: Doxyfile.in
100 (cd $(BUILD) && ./config.status doc/Doxyfile)
101
102 $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
103 rm -fr $(BUILD)/doc/doxygen
104 $(DOXYGEN) $(BUILD)/doc/Doxyfile
105 touch $(BUILD)/doc/doxygen-stamp
106
107 doc: $(BUILD)/doc/doxygen-stamp
108 endif