xz/Makefile.am

123 lines
3.1 KiB
Makefile
Raw Permalink Normal View History

## SPDX-License-Identifier: 0BSD
## Author: Lasse Collin
2007-12-08 22:42:33 +00:00
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
GZIP_ENV = -9n
DIST_SUBDIRS = lib src po tests debug
2007-12-08 22:42:33 +00:00
SUBDIRS =
if COND_GNULIB
SUBDIRS += lib
endif
SUBDIRS += src po tests
2014-04-25 14:44:26 +00:00
if COND_DOC
2009-08-27 15:36:59 +00:00
dist_doc_DATA = \
AUTHORS \
COPYING \
COPYING.0BSD \
COPYING.GPLv2 \
NEWS \
README \
THANKS \
2009-08-17 21:30:09 +00:00
doc/faq.txt \
2009-07-24 10:15:06 +00:00
doc/history.txt \
doc/xz-file-format.txt \
doc/lzma-file-format.txt
examplesdir = $(docdir)/examples
dist_examples_DATA = \
doc/examples/00_README.txt \
doc/examples/01_compress_easy.c \
doc/examples/02_decompress.c \
doc/examples/03_compress_custom.c \
doc/examples/04_compress_easy_mt.c \
doc/examples/11_file_info.c \
doc/examples/Makefile
2014-04-25 14:44:26 +00:00
endif
2007-12-08 22:42:33 +00:00
EXTRA_DIST = \
cmake \
2009-08-27 12:34:45 +00:00
dos \
doxygen \
extra \
po4a \
windows \
CMakeLists.txt \
2007-12-08 22:42:33 +00:00
COPYING.GPLv2 \
COPYING.GPLv3 \
2009-08-27 13:36:40 +00:00
COPYING.LGPLv2.1 \
INSTALL.generic \
2010-09-28 07:59:53 +00:00
PACKAGERS \
2024-02-17 17:25:05 +00:00
TODO \
autogen.sh \
build-aux/license-check.sh \
build-aux/manconv.sh \
build-aux/version.sh \
po/xz.pot-header
2007-12-08 22:42:33 +00:00
ACLOCAL_AMFLAGS = -I m4
# List of man pages to convert to plain text in the dist-hook target
# or to PDF in the pdf-local target.
manfiles = \
src/xz/xz.1 \
src/xzdec/xzdec.1 \
src/lzmainfo/lzmainfo.1 \
src/scripts/xzdiff.1 \
src/scripts/xzgrep.1 \
src/scripts/xzless.1 \
src/scripts/xzmore.1
# Create ChangeLog from output of "git log --date=iso --stat".
# Convert the man pages to plain text (ASCII only) format.
dist-hook:
2009-08-27 15:36:59 +00:00
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
( cd "$(srcdir)" && git log --date=iso --stat \
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
2009-08-27 15:36:59 +00:00
> "$(distdir)/ChangeLog"; \
fi
if type groff > /dev/null 2>&1; then \
dest="$(distdir)/doc/man" && \
$(MKDIR_P) "$$dest/txt" && \
for FILE in $(manfiles); do \
BASE=`basename $$FILE .1` && \
$(SHELL) "$(srcdir)/build-aux/manconv.sh" ascii \
< "$(srcdir)/$$FILE" \
> "$$dest/txt/$$BASE.txt"; \
done; \
fi
cd "$(distdir)" && $(SHELL) "build-aux/license-check.sh"
# This works with GNU tar and gives cleaner package than normal 'make dist'.
Build: Update po/*.po files only when needed When po/xz.pot doesn't exist, running "make" or "make dist" will create it. Then the .po files will be updated but only if they actually would change more than the POT-Creation-Date line. Then the .gmo files would be generated from the .po files. This is the case before and after this commit. However, "make dist" and thus "make mydist" did a forced update to the files, updating them even if the only change was the POT-Creation-Date line. This had pros and cons: It made it clear that the .po file really is in sync with the recent strings in the package. On the other hand, it added noise in form of changed files in the source tree and distribution tarballs. It can be ignored with something like "diff -I'^"POT-Creation-Date: '" but it's still a minor annoyance *if* there's not enough value in having the most recent timestamp. Setting DIST_DEPENDS_ON_UPDATE_PO = no means that such forced update won't happen in "make dist" anymore. However, the "mydist" target will use xz.pot-update target which is the same target that is run when xz.pot doesn't exist at all yet. Thus "mydist" will ensure that the translations are up to date, without noise from changes that would affect only the POT-Creation-Date line. Note that po4a always uses msgmerge with --update, so POT-Creation-Date in the man page translations is never the only change in .po files. In that sense this commit makes the message translations behave more similarly to the man page translations. Distribution tarballs will still have non-reproducible POT-Creation-Date in po/xz.pot and po4a/xz-man.pot but those are just two files. Even they could be made reproducible from a Git timestamp if desired.
2024-05-29 13:33:24 +00:00
# This also ensures that the translations are up to date (dist-hook
# would be too late for that).
mydist:
$(SHELL) "$(srcdir)/src/liblzma/validate_map.sh"
Build: Update po/*.po files only when needed When po/xz.pot doesn't exist, running "make" or "make dist" will create it. Then the .po files will be updated but only if they actually would change more than the POT-Creation-Date line. Then the .gmo files would be generated from the .po files. This is the case before and after this commit. However, "make dist" and thus "make mydist" did a forced update to the files, updating them even if the only change was the POT-Creation-Date line. This had pros and cons: It made it clear that the .po file really is in sync with the recent strings in the package. On the other hand, it added noise in form of changed files in the source tree and distribution tarballs. It can be ignored with something like "diff -I'^"POT-Creation-Date: '" but it's still a minor annoyance *if* there's not enough value in having the most recent timestamp. Setting DIST_DEPENDS_ON_UPDATE_PO = no means that such forced update won't happen in "make dist" anymore. However, the "mydist" target will use xz.pot-update target which is the same target that is run when xz.pot doesn't exist at all yet. Thus "mydist" will ensure that the translations are up to date, without noise from changes that would affect only the POT-Creation-Date line. Note that po4a always uses msgmerge with --update, so POT-Creation-Date in the man page translations is never the only change in .po files. In that sense this commit makes the message translations behave more similarly to the man page translations. Distribution tarballs will still have non-reproducible POT-Creation-Date in po/xz.pot and po4a/xz-man.pot but those are just two files. Even they could be made reproducible from a Git timestamp if desired.
2024-05-29 13:33:24 +00:00
cd po && $(MAKE) xz.pot-update
cd "$(srcdir)/po4a" && $(SHELL) update-po
VERSION=$(VERSION); \
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
$(SHELL) "$(srcdir)/build-aux/license-check.sh" || exit 1; \
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
fi; \
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
$(MAKE) VERSION="$$VERSION" dist-gzip
# NOTE: This only creates the PDFs. The install rules are missing.
pdf-local:
dest="doc/man" && \
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" && \
for FILE in $(manfiles); do \
BASE=`basename $$FILE .1` && \
$(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf a4 \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
$(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf letter \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-letter/$$BASE-letter.pdf"; \
done