]> git.ipfire.org Git - thirdparty/xz.git/blob - Makefile.am
CMake: Simplify symlink creation and install translated man pages.
[thirdparty/xz.git] / Makefile.am
1 ## SPDX-License-Identifier: 0BSD
2 ## Author: Lasse Collin
3
4 # Use -n to prevent gzip from adding a timestamp to the .gz headers.
5 GZIP_ENV = -9n
6
7 DIST_SUBDIRS = lib src po tests debug
8 SUBDIRS =
9
10 if COND_GNULIB
11 SUBDIRS += lib
12 endif
13
14 SUBDIRS += src po tests
15
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
29
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
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
47
48 # Remove the Doxygen generated documentation when uninstalling.
49 uninstall-local:
50 rm -rf "$(DESTDIR)$(docdir)/api"
51 endif
52
53 EXTRA_DIST = \
54 cmake \
55 dos \
56 doxygen \
57 extra \
58 po4a \
59 windows \
60 CMakeLists.txt \
61 COPYING.CC-BY-SA-4.0 \
62 COPYING.GPLv2 \
63 COPYING.GPLv3 \
64 COPYING.LGPLv2.1 \
65 INSTALL.generic \
66 PACKAGERS \
67 TODO \
68 autogen.sh \
69 build-aux/manconv.sh \
70 build-aux/version.sh \
71 doc/xz-logo.png \
72 po/xz.pot-header
73
74 ACLOCAL_AMFLAGS = -I m4
75
76 # List of man pages to convert to PDF and plain text in the dist-hook target.
77 manfiles = \
78 src/xz/xz.1 \
79 src/xzdec/xzdec.1 \
80 src/lzmainfo/lzmainfo.1 \
81 src/scripts/xzdiff.1 \
82 src/scripts/xzgrep.1 \
83 src/scripts/xzless.1 \
84 src/scripts/xzmore.1
85
86 # Create ChangeLog from output of "git log --date=iso --stat".
87 # Convert the man pages to PDF and plain text (ASCII only) formats.
88 dist-hook:
89 if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
90 ( cd "$(srcdir)" && git log --date=iso --stat \
91 b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
92 > "$(distdir)/ChangeLog"; \
93 fi
94 if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
95 dest="$(distdir)/doc/man" && \
96 $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
97 for FILE in $(manfiles); do \
98 BASE=`basename $$FILE .1` && \
99 sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
100 < "$(srcdir)/$$FILE" \
101 > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
102 sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
103 < "$(srcdir)/$$FILE" \
104 > "$$dest/pdf-letter/$$BASE-letter.pdf" && \
105 sh "$(srcdir)/build-aux/manconv.sh" ascii \
106 < "$(srcdir)/$$FILE" \
107 > "$$dest/txt/$$BASE.txt"; \
108 done; \
109 fi
110 if test -d "$(srcdir)/doc/api" ; then \
111 $(MKDIR_P) "$(distdir)/doc/api" && \
112 $(INSTALL_DATA) "$(srcdir)"/doc/api/* \
113 "$(distdir)/doc/api"; \
114 fi
115
116 # This works with GNU tar and gives cleaner package than normal 'make dist'.
117 # This also ensures that the man page translations are up to date (dist-hook
118 # would be too late for that).
119 mydist:
120 sh "$(srcdir)/src/liblzma/validate_map.sh"
121 cd "$(srcdir)/po4a" && sh update-po
122 cd "$(srcdir)/doxygen" && sh update-doxygen
123 VERSION=$(VERSION); \
124 if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
125 SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
126 test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
127 fi; \
128 TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
129 $(MAKE) VERSION="$$VERSION" dist-gzip