Do not create .pacsave with -R, if the file is unchanged
[pacman-ng.git] / doc / Makefile.am
blob4703b63afb279d6efeb93f32a460dc02690672e3
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
31 HTML_DOCS = \
32         $(HTML_MANPAGES) \
33         $(HTML_OTHER)
35 EXTRA_DIST = \
36         asciidoc.conf \
37         pacman.8.txt \
38         makepkg.8.txt \
39         repo-add.8.txt \
40         PKGBUILD.5.txt \
41         PKGBUILD-example.txt \
42         makepkg.conf.5.txt \
43         pacman.conf.5.txt \
44         libalpm.3.txt \
45         footer.txt \
46         index.txt \
47         submitting-patches.txt \
48         translation-help.txt \
49         Doxyfile \
50         $(ASCIIDOC_MANS) \
51         $(DOXYGEN_MANS)
53 # Files that should be removed, but which Automake does not know.
54 MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8
56 # Ensure manpages are fresh when building a dist tarball
57 dist-hook:
58         $(MAKE) $(AM_MAKEFLAGS) clean
59         $(MAKE) $(AM_MAKEFLAGS) all
61 if USE_GIT_VERSION
62 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 | sed s/^v//')-dirty
63 REAL_PACKAGE_VERSION = $(GIT_VERSION)
64 else
65 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
66 endif
68 man_MANS =
69 dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
71 if USE_DOXYGEN
72 man_MANS += $(DOXYGEN_MANS)
74 all-local: doxygen.in
76 doxygen.in:
77         $(DOXYGEN) $(srcdir)/Doxyfile
78 endif
80 html: $(HTML_DOCS)
82 ASCIIDOC_OPTS = \
83         -f asciidoc.conf \
84         -a pacman_version="$(REAL_PACKAGE_VERSION)" \
85         -a pacman_date="`date +%Y-%m-%d`" \
86         -a sysconfdir=$(sysconfdir)
87 A2X_OPTS = \
88         --no-xmllint \
89         -d manpage \
90         -f manpage \
91         --xsltproc-opts='-param man.endnotes.list.enabled 0' \
92         --xsltproc-opts='-param man.endnotes.are.numbered 0'
94 # These rules are due to the includes and files of the asciidoc text
95 $(ASCIIDOC_MANS): asciidoc.conf footer.txt
96         a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS)" $@.txt
98 %.html: %.txt
99         asciidoc $(ASCIIDOC_OPTS) -a linkcss $*.txt
100         dos2unix $@
102 # Customizations for certain HTML docs
103 $(HTML_MANPAGES): asciidoc.conf footer.txt
104 $(HTML_OTHER): asciidoc.conf
105 %.8.html: ASCIIDOC_OPTS += -d manpage
106 %.5.html: ASCIIDOC_OPTS += -d manpage
107 %.3.html: ASCIIDOC_OPTS += -d manpage
109 # Dependency rules
110 pacman.8 pacman.8.html: pacman.8.txt
111 makepkg.8 makepkg.8.html: makepkg.8.txt
112 repo-add.8 repo-add.8.html: repo-add.8.txt
113 PKGBUILD.5 PKGBUILD.5.html: PKGBUILD.5.txt PKGBUILD-example.txt
114 makepkg.conf.5 makepkg.conf.5.html: makepkg.conf.5.txt
115 pacman.conf.5 pacman.conf.5.html: pacman.conf.5.txt
116 libalpm.3 libalpm.3.html: libalpm.3.txt
117 # this one is just a symlink
118 repo-remove.8: repo-add.8
119         rm -f repo-remove.8
120         $(LN_S) repo-add.8 repo-remove.8
122 # vim:set ts=2 sw=2 noet: