CI: update FreeBSD, NetBSD, OpenBSD, Solaris actions
[xz.git] / Makefile.am
blob56f3141d3c494104d55239deed0509ba5c5f49e5
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
39 endif
41 EXTRA_DIST = \
42         cmake \
43         dos \
44         doxygen \
45         extra \
46         po4a \
47         windows \
48         CMakeLists.txt \
49         COPYING.GPLv2 \
50         COPYING.GPLv3 \
51         COPYING.LGPLv2.1 \
52         INSTALL.generic \
53         PACKAGERS \
54         TODO \
55         autogen.sh \
56         build-aux/license-check.sh \
57         build-aux/manconv.sh \
58         build-aux/version.sh \
59         po/xz.pot-header
61 ACLOCAL_AMFLAGS = -I m4
63 # List of man pages to convert to plain text in the dist-hook target
64 # or to PDF in the pdf-local target.
65 manfiles = \
66         src/xz/xz.1 \
67         src/xzdec/xzdec.1 \
68         src/lzmainfo/lzmainfo.1 \
69         src/scripts/xzdiff.1 \
70         src/scripts/xzgrep.1 \
71         src/scripts/xzless.1 \
72         src/scripts/xzmore.1
74 # Create ChangeLog from output of "git log --date=iso --stat".
75 # Convert the man pages to plain text (ASCII only) format.
76 dist-hook:
77         if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
78                 ( cd "$(srcdir)" && git log --date=iso --stat \
79                         b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
80                         > "$(distdir)/ChangeLog"; \
81         fi
82         if type groff > /dev/null 2>&1; then \
83                 dest="$(distdir)/doc/man" && \
84                 $(MKDIR_P) "$$dest/txt" && \
85                 for FILE in $(manfiles); do \
86                         BASE=`basename $$FILE .1` && \
87                         $(SHELL) "$(srcdir)/build-aux/manconv.sh" ascii \
88                                 < "$(srcdir)/$$FILE" \
89                                 > "$$dest/txt/$$BASE.txt"; \
90                 done; \
91         fi
92         cd "$(distdir)" && $(SHELL) "build-aux/license-check.sh"
94 # This works with GNU tar and gives cleaner package than normal 'make dist'.
95 # This also ensures that the translations are up to date (dist-hook
96 # would be too late for that).
97 mydist:
98         $(SHELL) "$(srcdir)/src/liblzma/validate_map.sh"
99         cd po && $(MAKE) xz.pot-update
100         cd "$(srcdir)/po4a" && $(SHELL) update-po
101         VERSION=$(VERSION); \
102         if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
103                 $(SHELL) "$(srcdir)/build-aux/license-check.sh" || exit 1; \
104                 SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
105                 test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
106         fi; \
107         TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
108                 $(MAKE) VERSION="$$VERSION" dist-gzip
110 # NOTE: This only creates the PDFs. The install rules are missing.
111 pdf-local:
112         dest="doc/man" && \
113         $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" && \
114         for FILE in $(manfiles); do \
115                 BASE=`basename $$FILE .1` && \
116                 $(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf a4 \
117                         < "$(srcdir)/$$FILE" \
118                         > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
119                 $(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf letter \
120                         < "$(srcdir)/$$FILE" \
121                         > "$$dest/pdf-letter/$$BASE-letter.pdf"; \
122         done