Prototype disk space checking functionality
[pacman-ng.git] / doc / Makefile.am
blob748eb5fc4229828045c4a9fe6d6df390bb48d825
1 # We have to do some funny stuff here with the manpages. In order to ensure
2 # a dist tarball doesn't get put out there without manpages, we keep those
3 # files listed in EXTRA_DIST no matter what. However, we only add them to
4 # man_MANS if --enable-asciidoc and/or --enable-doxygen are used.
6 ASCIIDOC_MANS = \
7         pacman.8 \
8         makepkg.8 \
9         repo-add.8 \
10         PKGBUILD.5 \
11         makepkg.conf.5 \
12         pacman.conf.5 \
13         libalpm.3
15 DOXYGEN_MANS = $(wildcard man3/*.3)
17 HTML_MANPAGES = \
18         pacman.8.html \
19         makepkg.8.html \
20         repo-add.8.html \
21         PKGBUILD.5.html \
22         makepkg.conf.5.html \
23         pacman.conf.5.html \
24         libalpm.3.html
26 HTML_OTHER = \
27         index.html \
28         submitting-patches.html \
29         translation-help.html \
30         HACKING.html
32 HTML_DOCS = \
33         $(HTML_MANPAGES) \
34         $(HTML_OTHER)
36 EXTRA_DIST = \
37         asciidoc.conf \
38         pacman.8.txt \
39         makepkg.8.txt \
40         repo-add.8.txt \
41         PKGBUILD.5.txt \
42         PKGBUILD-example.txt \
43         makepkg.conf.5.txt \
44         pacman.conf.5.txt \
45         libalpm.3.txt \
46         footer.txt \
47         index.txt \
48         submitting-patches.txt \
49         translation-help.txt \
50         Doxyfile \
51         $(ASCIIDOC_MANS) \
52         $(DOXYGEN_MANS)
54 # Files that should be removed, but which Automake does not know.
55 MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8
57 # Ensure manpages are fresh when building a dist tarball
58 dist-hook:
59         $(MAKE) $(AM_MAKEFLAGS) clean
60         $(MAKE) $(AM_MAKEFLAGS) all
62 if USE_GIT_VERSION
63 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 | sed s/^v//')-dirty
64 REAL_PACKAGE_VERSION = $(GIT_VERSION)
65 else
66 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
67 endif
69 man_MANS =
70 dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
72 if USE_DOXYGEN
73 man_MANS += $(DOXYGEN_MANS)
75 all-local: doxygen.in
77 doxygen.in:
78         $(DOXYGEN) $(srcdir)/Doxyfile
79 endif
81 html: $(HTML_DOCS)
83 website: html
84         bsdtar czf website.tar.gz $(HTML_DOCS) \
85                 -C /etc/asciidoc/stylesheets/ \
86                 xhtml11.css xhtml11-manpage.css xhtml11-quirks.css \
87                 -C /etc/asciidoc/javascripts/ \
88                 asciidoc-xhtml11.js \
89                 -C /etc/asciidoc/ \
90                 images
92 pkgdatadir = ${datadir}/${PACKAGE}
94 ASCIIDOC_OPTS = \
95         -f asciidoc.conf \
96         -a pacman_version="$(REAL_PACKAGE_VERSION)" \
97         -a pacman_date="`date +%Y-%m-%d`" \
98         -a pkgdatadir=$(pkgdatadir) \
99         -a localstatedir=$(localstatedir) \
100         -a sysconfdir=$(sysconfdir)
102 A2X_OPTS = \
103         --no-xmllint \
104         -d manpage \
105         -f manpage \
106         --xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0'
108 # These rules are due to the includes and files of the asciidoc text
109 $(ASCIIDOC_MANS): asciidoc.conf footer.txt
110         a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS)" $@.txt
112 %.html: %.txt
113         asciidoc $(ASCIIDOC_OPTS) $*.txt
114         dos2unix $@
116 HACKING.html: ../HACKING
117         asciidoc $(ASCIIDOC_OPTS) -o $@ ../HACKING
118         dos2unix $@
120 # Customizations for certain HTML docs
121 $(HTML_MANPAGES): asciidoc.conf footer.txt
122 $(HTML_OTHER): asciidoc.conf
123 %.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons
124 %.8.html: ASCIIDOC_OPTS += -d manpage
125 %.5.html: ASCIIDOC_OPTS += -d manpage
126 %.3.html: ASCIIDOC_OPTS += -d manpage
128 # Dependency rules
129 pacman.8 pacman.8.html: pacman.8.txt
130 makepkg.8 makepkg.8.html: makepkg.8.txt
131 repo-add.8 repo-add.8.html: repo-add.8.txt
132 PKGBUILD.5 PKGBUILD.5.html: PKGBUILD.5.txt PKGBUILD-example.txt
133 makepkg.conf.5 makepkg.conf.5.html: makepkg.conf.5.txt
134 pacman.conf.5 pacman.conf.5.html: pacman.conf.5.txt
135 libalpm.3 libalpm.3.html: libalpm.3.txt
136 # this one is just a symlink
137 repo-remove.8: repo-add.8
138         rm -f repo-remove.8
139         $(LN_S) repo-add.8 repo-remove.8
141 # vim:set ts=2 sw=2 noet: