Update .gitignore
[xz.git] / Makefile.am
blobe32eb4c308dc7a3e545432e2aefd2d6d26091c2e
1 ## SPDX-License-Identifier: 0BSD
2 ## Author: Lasse Collin
4 # Use -n to prevent gzip from adding a timestamp to the .gz headers.
5 GZIP_ENV = -9n
7 DIST_SUBDIRS = lib src po tests debug
8 SUBDIRS =
10 if COND_GNULIB
11 SUBDIRS += lib
12 endif
14 SUBDIRS += src po tests
16 if COND_DOC
17 dist_doc_DATA = \
18         AUTHORS \
19         COPYING \
20         COPYING.0BSD \
21         COPYING.GPLv2 \
22         NEWS \
23         README \
24         THANKS \
25         doc/faq.txt \
26         doc/history.txt \
27         doc/xz-file-format.txt \
28         doc/lzma-file-format.txt
30 examplesdir = $(docdir)/examples
31 dist_examples_DATA = \
32         doc/examples/00_README.txt \
33         doc/examples/01_compress_easy.c \
34         doc/examples/02_decompress.c \
35         doc/examples/03_compress_custom.c \
36         doc/examples/04_compress_easy_mt.c \
37         doc/examples/11_file_info.c \
38         doc/examples/Makefile
40 # Install the Doxygen generated documentation if they were built.
41 install-data-local:
42         if test -d "$(srcdir)/doc/api" ; then \
43                 $(MKDIR_P) "$(DESTDIR)$(docdir)/api" && \
44                 $(INSTALL_DATA) "$(srcdir)"/doc/api/* \
45                         "$(DESTDIR)$(docdir)/api"; \
46         fi
48 # Remove the Doxygen generated documentation when uninstalling.
49 uninstall-local:
50         rm -rf "$(DESTDIR)$(docdir)/api"
51 endif
53 EXTRA_DIST = \
54         cmake \
55         dos \
56         doxygen \
57         extra \
58         po4a \
59         windows \
60         CMakeLists.txt \
61         COPYING.GPLv2 \
62         COPYING.GPLv3 \
63         COPYING.LGPLv2.1 \
64         INSTALL.generic \
65         PACKAGERS \
66         TODO \
67         autogen.sh \
68         build-aux/manconv.sh \
69         build-aux/version.sh \
70         po/xz.pot-header
72 ACLOCAL_AMFLAGS = -I m4
74 # List of man pages to convert to PDF and plain text in the dist-hook target.
75 manfiles = \
76         src/xz/xz.1 \
77         src/xzdec/xzdec.1 \
78         src/lzmainfo/lzmainfo.1 \
79         src/scripts/xzdiff.1 \
80         src/scripts/xzgrep.1 \
81         src/scripts/xzless.1 \
82         src/scripts/xzmore.1
84 # Create ChangeLog from output of "git log --date=iso --stat".
85 # Convert the man pages to PDF and plain text (ASCII only) formats.
86 dist-hook:
87         if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
88                 ( cd "$(srcdir)" && git log --date=iso --stat \
89                         b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
90                         > "$(distdir)/ChangeLog"; \
91         fi
92         if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
93                 dest="$(distdir)/doc/man" && \
94                 $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
95                 for FILE in $(manfiles); do \
96                         BASE=`basename $$FILE .1` && \
97                         sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
98                                 < "$(srcdir)/$$FILE" \
99                                 > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
100                         sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
101                                 < "$(srcdir)/$$FILE" \
102                                 > "$$dest/pdf-letter/$$BASE-letter.pdf" && \
103                         sh "$(srcdir)/build-aux/manconv.sh" ascii \
104                                 < "$(srcdir)/$$FILE" \
105                                 > "$$dest/txt/$$BASE.txt"; \
106                 done; \
107         fi
108         if test -d "$(srcdir)/doc/api" ; then \
109                 $(MKDIR_P) "$(distdir)/doc/api" && \
110                 $(INSTALL_DATA) "$(srcdir)"/doc/api/* \
111                         "$(distdir)/doc/api"; \
112         fi
114 # This works with GNU tar and gives cleaner package than normal 'make dist'.
115 # This also ensures that the man page translations are up to date (dist-hook
116 # would be too late for that).
117 mydist:
118         sh "$(srcdir)/src/liblzma/validate_map.sh"
119         cd "$(srcdir)/po4a" && sh update-po
120         cd "$(srcdir)/doxygen" && sh update-doxygen
121         VERSION=$(VERSION); \
122         if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
123                 SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
124                 test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
125         fi; \
126         TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
127                 $(MAKE) VERSION="$$VERSION" dist-gzip