CMake/Windows: Add resource files to xz.exe and xzdec.exe.
[xz.git] / Makefile.am
blobc4a461870e8362ff45240a03744e3c79ed93b5c1
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 ##
8 # Use -n to prevent gzip from adding a timestamp to the .gz headers.
9 GZIP_ENV = -9n
11 DIST_SUBDIRS = lib src po tests debug
12 SUBDIRS =
14 if COND_GNULIB
15 SUBDIRS += lib
16 endif
18 SUBDIRS += src po tests
20 if COND_DOC
21 dist_doc_DATA = \
22         AUTHORS \
23         COPYING \
24         COPYING.GPLv2 \
25         NEWS \
26         README \
27         THANKS \
28         TODO \
29         doc/faq.txt \
30         doc/history.txt \
31         doc/xz-file-format.txt \
32         doc/lzma-file-format.txt
34 examplesdir = $(docdir)/examples
35 dist_examples_DATA = \
36         doc/examples/00_README.txt \
37         doc/examples/01_compress_easy.c \
38         doc/examples/02_decompress.c \
39         doc/examples/03_compress_custom.c \
40         doc/examples/04_compress_easy_mt.c \
41         doc/examples/Makefile
43 examplesolddir = $(docdir)/examples_old
44 dist_examplesold_DATA = \
45         doc/examples_old/xz_pipe_comp.c \
46         doc/examples_old/xz_pipe_decomp.c
47 endif
49 EXTRA_DIST = \
50         po4a \
51         extra \
52         dos \
53         windows \
54         macosx \
55         cmake \
56         CMakeLists.txt \
57         autogen.sh \
58         Doxyfile.in \
59         COPYING.GPLv2 \
60         COPYING.GPLv3 \
61         COPYING.LGPLv2.1 \
62         INSTALL.generic \
63         PACKAGERS \
64         build-aux/manconv.sh \
65         build-aux/version.sh
67 ACLOCAL_AMFLAGS = -I m4
69 # List of man pages to convert to PDF and plain text in the dist-hook target.
70 manfiles = \
71         src/xz/xz.1 \
72         src/xzdec/xzdec.1 \
73         src/lzmainfo/lzmainfo.1 \
74         src/scripts/xzdiff.1 \
75         src/scripts/xzgrep.1 \
76         src/scripts/xzless.1 \
77         src/scripts/xzmore.1
79 # Create ChangeLog from output of "git log --date=iso --stat".
80 # Convert the man pages to PDF and plain text (ASCII only) formats.
81 dist-hook:
82         if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
83                 ( cd "$(srcdir)" && git log --date=iso --stat \
84                         6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6^..HEAD ) \
85                         > "$(distdir)/ChangeLog"; \
86         fi
87         if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
88                 dest="$(distdir)/doc/man" && \
89                 $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
90                 for FILE in $(manfiles); do \
91                         BASE=`basename $$FILE .1` && \
92                         sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
93                                 < "$(srcdir)/$$FILE" \
94                                 > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
95                         sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
96                                 < "$(srcdir)/$$FILE" \
97                                 > "$$dest/pdf-letter/$$BASE-letter.pdf" && \
98                         sh "$(srcdir)/build-aux/manconv.sh" ascii \
99                                 < "$(srcdir)/$$FILE" \
100                                 > "$$dest/txt/$$BASE.txt"; \
101                 done; \
102         fi
104 # This works with GNU tar and gives cleaner package than normal 'make dist'.
105 # This also ensures that the man page translations are up to date (dist-hook
106 # would be too late for that).
107 mydist:
108         sh "$(srcdir)/src/liblzma/validate_map.sh"
109         cd "$(srcdir)/po4a" && sh update-po
110         VERSION=$(VERSION); \
111         if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
112                 SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
113                 test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
114         fi; \
115         TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
116                 $(MAKE) VERSION="$$VERSION" dist-gzip