Major documentation update.
[icculus/xz.git] / Makefile.am
1 ##
2 ## Author: Lasse Collin
3 ##
4 ## This file has been put into the public domain.
5 ## You can do whatever you want with this file.
6 ##
7
8 DIST_SUBDIRS = lib src po tests debug
9 SUBDIRS =
10
11 if COND_GNULIB
12 SUBDIRS += lib
13 endif
14
15 SUBDIRS += src po tests
16
17 doc_DATA = \
18         AUTHORS \
19         COPYING \
20         COPYING.GPLv2 \
21         NEWS \
22         README \
23         THANKS \
24         TODO \
25         doc/xz-file-format.txt \
26         doc/lzma-file-format.txt
27
28 EXTRA_DIST = \
29         version.sh \
30         Doxyfile.in \
31         extra \
32         doc \
33         windows \
34         COPYING.GPLv2 \
35         COPYING.GPLv3 \
36         COPYING.LGPLv2.1
37
38 ACLOCAL_AMFLAGS = -I m4
39
40 # List of man pages to conver to PDF and plain text in the dist-hook target.
41 manfiles = \
42         src/xzdec/xzdec.1 \
43         src/scripts/xzdiff.1 \
44         src/scripts/xzgrep.1 \
45         src/scripts/xzless.1 \
46         src/scripts/xzmore.1
47
48 # Create ChangeLog from output of "git log --date=iso --stat".
49 # Convert the man pages to PDF and plain text (ASCII only) formats.
50 dist-hook:
51         test -d "$(srcdir)/.git" && type git > /dev/null 2>&1 \
52                 && ( cd "$(srcdir)" && git log --date=iso --stat ) \
53                         > "$(distdir)/ChangeLog"
54         if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
55                 dest="$(distdir)/doc/man" && \
56                 mkdir "$$dest" && \
57                 mkdir "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
58                 for FILE in $(manfiles); do \
59                         BASE=`basename $$FILE .1` && \
60                         groff -man -t -Tps -P-pa4 < "$(srcdir)/$$FILE" \
61                                 | ps2pdf - - \
62                                 > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
63                         groff -man -t -Tps -P-pletter < "$(srcdir)/$$FILE" \
64                                 | ps2pdf - - \
65                                 > "$$dest/pdf-letter/$$BASE-letter.pdf" && \
66                         groff -man -t -Tascii < "$(srcdir)/$$FILE" \
67                                 | col -bx > "$$dest/txt/$$BASE.txt"; \
68                 done; \
69         fi
70
71 # This works with GNU tar and gives cleaner package than normal 'make dist'.
72 mydist:
73         TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
74                 $(MAKE) dist-gzip