]> icculus.org git repositories - icculus/xz.git/blob - Makefile.am
Add dist-hook to create ChangeLog from the commit log,
[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 EXTRA_DIST = \
18         version.sh \
19         config.rpath \
20         Doxyfile.in \
21         extra \
22         doc \
23         windows \
24         COPYING.GPLv2 \
25         COPYING.GPLv3 \
26         COPYING.LGPLv2.1
27
28 ACLOCAL_AMFLAGS = -I m4
29
30 # List of man pages to conver to PDF and plain text in the dist-hook target.
31 manfiles = \
32         src/xzdec/xzdec.1 \
33         src/scripts/xzdiff.1 \
34         src/scripts/xzgrep.1 \
35         src/scripts/xzless.1 \
36         src/scripts/xzmore.1
37
38 # Create ChangeLog from output of "git log --date=iso --stat".
39 # Convert the man pages to PDF and plain text (ASCII only) formats.
40 dist-hook:
41         test -d "$(srcdir)/.git" && type git > /dev/null 2>&1 \
42                 && ( cd "$(srcdir)" && git log --date=iso --stat ) \
43                         > "$(distdir)/ChangeLog"
44         if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
45                 dest="$(distdir)/doc/man" && \
46                 mkdir "$$dest" && \
47                 mkdir "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
48                 for FILE in $(manfiles); do \
49                         BASE=`basename $$FILE .1` && \
50                         groff -man -t -Tps -P-pa4 < "$(srcdir)/$$FILE" \
51                                 | ps2pdf - - \
52                                 > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
53                         groff -man -t -Tps -P-pletter < "$(srcdir)/$$FILE" \
54                                 | ps2pdf - - \
55                                 > "$$dest/pdf-letter/$$BASE-letter.pdf" && \
56                         groff -man -t -Tascii < "$(srcdir)/$$FILE" \
57                                 | col -bx > "$$dest/txt/$$BASE.txt"; \
58                 done; \
59         fi
60
61 # This works with GNU tar and gives cleaner package than normal 'make dist'.
62 mydist:
63         TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
64                 $(MAKE) dist-gzip