zsh completion for makepkg
[pacman-ng.git] / doc / Makefile.am
blobe6ed29c01be4858048752bed99c874bc9205112b
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         vercmp.8 \
11         pkgdelta.8 \
12         pacman-key.8 \
13         PKGBUILD.5 \
14         makepkg.conf.5 \
15         pacman.conf.5 \
16         libalpm.3
18 DOXYGEN_MANS = $(wildcard man3/*.3)
20 HTML_MANPAGES = \
21         pacman.8.html \
22         makepkg.8.html \
23         repo-add.8.html \
24         vercmp.8.html \
25         pkgdelta.8.html \
26         pacman-key.8.html \
27         PKGBUILD.5.html \
28         makepkg.conf.5.html \
29         pacman.conf.5.html \
30         libalpm.3.html
32 HTML_OTHER = \
33         index.html \
34         submitting-patches.html \
35         translation-help.html \
36         HACKING.html
38 HTML_DOCS = \
39         $(HTML_MANPAGES) \
40         $(HTML_OTHER)
42 EXTRA_DIST = \
43         asciidoc.conf \
44         asciidoc-override.css \
45         pacman.8.txt \
46         makepkg.8.txt \
47         repo-add.8.txt \
48         vercmp.8.txt \
49         pkgdelta.8.txt \
50         pacman-key.8.txt \
51         PKGBUILD.5.txt \
52         PKGBUILD-example.txt \
53         makepkg.conf.5.txt \
54         pacman.conf.5.txt \
55         libalpm.3.txt \
56         footer.txt \
57         index.txt \
58         submitting-patches.txt \
59         translation-help.txt \
60         Doxyfile \
61         $(ASCIIDOC_MANS) \
62         $(DOXYGEN_MANS)
64 # Files that should be removed, but which Automake does not know.
65 MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8 website.tar.gz
67 # Ensure manpages are fresh when building a dist tarball
68 dist-hook:
69         $(MAKE) $(AM_MAKEFLAGS) clean
70         $(MAKE) $(AM_MAKEFLAGS) all
72 if USE_GIT_VERSION
73 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
74 REAL_PACKAGE_VERSION = $(GIT_VERSION)
75 else
76 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
77 endif
79 man_MANS =
80 dist_man_MANS = $(ASCIIDOC_MANS)
82 if USE_DOXYGEN
83 man_MANS += $(DOXYGEN_MANS)
85 all-local: doxygen.in
87 doxygen.in:
88         $(DOXYGEN) $(srcdir)/Doxyfile
89 endif
91 html: $(HTML_DOCS)
93 website: website.tar.gz
95 .PHONY: html website
97 website.tar.gz: html
98         $(AM_V_GEN)bsdtar czf $@ $(HTML_DOCS) \
99                 asciidoc-override.css \
100                 -C /etc/asciidoc/stylesheets/ \
101                 asciidoc.css \
102                 -C /etc/asciidoc/javascripts/ \
103                 asciidoc.js \
104                 -C /etc/asciidoc/ \
105                 images
107 pkgdatadir = ${datadir}/${PACKAGE}
109 ASCIIDOC_OPTS = \
110         -f $(srcdir)/asciidoc.conf \
111         -a pacman_version="$(REAL_PACKAGE_VERSION)" \
112         -a pacman_date="`date +%Y-%m-%d`" \
113         -a pkgdatadir=$(pkgdatadir) \
114         -a localstatedir=$(localstatedir) \
115         -a sysconfdir=$(sysconfdir)
117 A2X_OPTS = \
118         --no-xmllint \
119         -d manpage \
120         -f manpage \
121         --xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0' \
122         --destination-dir='./'
124 # These rules are due to the includes and files of the asciidoc text
125 $(ASCIIDOC_MANS): asciidoc.conf footer.txt Makefile.am
126         $(AM_V_GEN)a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@.xml" $(srcdir)/$@.txt
128 %.html: %.txt
129         $(AM_V_GEN)asciidoc $(ASCIIDOC_OPTS) -o - $*.txt | \
130                 sed -e 's/\r$$//' > $@
132 HACKING.html: ../HACKING
133         $(AM_V_GEN)asciidoc $(ASCIIDOC_OPTS) -o - ../HACKING | \
134                 sed -e 's/\r$$//' > $@
136 # Customizations for certain HTML docs
137 $(HTML_MANPAGES): asciidoc.conf footer.txt Makefile.am
138 $(HTML_OTHER): asciidoc.conf Makefile.am
139 %.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons -a max-width=960px -a stylesheet=asciidoc-override.css
140 %.8.html: ASCIIDOC_OPTS += -d manpage
141 %.5.html: ASCIIDOC_OPTS += -d manpage
142 %.3.html: ASCIIDOC_OPTS += -d manpage
144 # Dependency rules
145 pacman.8 pacman.8.html: pacman.8.txt
146 makepkg.8 makepkg.8.html: makepkg.8.txt
147 repo-add.8 repo-add.8.html: repo-add.8.txt
148 vercmp.8 vercmp.8.html: vercmp.8.txt
149 pkgdelta.8 pkgdelta.8.html: pkgdelta.8.txt
150 pacman-key.8 pacman-key.8.html: pacman-key.8.txt
151 PKGBUILD.5 PKGBUILD.5.html: PKGBUILD.5.txt PKGBUILD-example.txt
152 makepkg.conf.5 makepkg.conf.5.html: makepkg.conf.5.txt
153 pacman.conf.5 pacman.conf.5.html: pacman.conf.5.txt
154 libalpm.3 libalpm.3.html: libalpm.3.txt
155 # this one is just a symlink
156 repo-remove.8: repo-add.8
157         $(RM) repo-remove.8
158         $(LN_S) repo-add.8 repo-remove.8
160 install-data-hook:
161         cd $(DESTDIR)$(mandir)/man8 && \
162                 $(RM) repo-remove.8 && \
163                 ( $(LN_S) repo-add.8 repo-remove.8 || \
164                 ln repo-add.8 repo-remove.8 || \
165                 cp repo-add.8 repo-remove.8 )
167 uninstall-hook:
168         $(RM) $(DESTDIR)$(mandir)/man8/repo-remove.8
170 # vim:set ts=2 sw=2 noet: