3 # Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software Foundation,
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 ALL_RECURSIVE_TARGETS =
23 ACLOCAL_AMFLAGS = -I m4
24 AM_CPPFLAGS = -I$(top_srcdir)/lib
25 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
27 # Tell the linker to omit references to unused shared libraries.
28 AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
30 man_MANS = gunzip.1 gzexe.1 gzip.1 \
31 zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
33 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
37 algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \
38 amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h \
39 gunzip.in gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
40 msdos/gzip.prj msdos/doturboc.bat msdos/Makefile.msc msdos/Makefile.bor \
41 msdos/Makefile.djg nt/Makefile.nt os2/gzip.def os2/Makefile.os2 \
42 os2/gzip16.def primos/include/errno.h primos/include/fcntl.h \
43 primos/include/stdlib.h primos/include/sysStat.h \
44 primos/include/sysTypes.h primos/build.cpl primos/readme \
45 primos/primos.c primos/ci.opts revision.h sample/makecrc.c \
46 sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \
47 tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c vms/Readme.vms \
48 vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zcat.in zcmp.in zdiff.in \
49 zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in \
53 bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \
54 zegrep zfgrep zforce zgrep zless zmore znew
56 bits.c crypt.c deflate.c gzip.c inflate.c lzw.c \
57 trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c
58 gzip_LDADD = lib/libgzip.a
59 gzip_LDADD += $(LIB_CLOCK_GETTIME)
62 $(AM_V_GEN)groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq > $@-t \
65 gzip.doc.gz: gzip.doc $(bin_PROGRAMS)
66 $(AM_V_GEN)./gzip < $(srcdir)/gzip.doc >$@-t && mv $@-t $@
71 -e 's|/bin/sh|$(SHELL)|g' \
72 -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
73 -e 's|[@]VERSION@|$(VERSION)|g' \
74 $(srcdir)/$@.in >$@-t \
78 # Arrange so that .tarball-version appears only in the distribution
79 # tarball, and never in a checked-out repository.
80 dist-hook: gen-ChangeLog
81 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
83 gen_start_date = 2008-01-01
86 $(AM_V_GEN)if test -d .git; then \
87 $(top_srcdir)/build-aux/gitlog-to-changelog \
88 --since=$(gen_start_date) > $(distdir)/cl-t; \
89 rm -f $(distdir)/ChangeLog; \
90 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
93 # A simple test, just of gzip -- more of a sanity check than anything else.
94 FILES_TO_CHECK = $(bin_SCRIPTS) \
95 $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c
96 check-local: $(FILES_TO_CHECK) $(bin_PROGRAMS) gzip.doc.gz
97 { test '$(srcdir)' != . || ./zdiff --__bindir . -c gzip.doc.gz; }
98 ./zdiff --__bindir . -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
99 ./zdiff --__bindir . $(srcdir)/gzip.doc gzip.doc.gz
100 ./zdiff --__bindir . -c - $(srcdir)/gzip.doc <gzip.doc.gz
101 ./zdiff --__bindir . -c gzip.doc.gz gzip.doc.gz
102 ./zgrep --__bindir . -iV >/dev/null
103 for file in $(FILES_TO_CHECK); do \
104 ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit 1; \
106 @echo 'Test succeeded.'
114 tests/null-suffix-clobber \
122 EXTRA_DIST += $(TESTS)
123 EXTRA_DIST += tests/init.cfg
125 install-exec-hook: remove-installed-links
126 install-exec-hook remove-installed-links:
127 @for prog_ext in $(bin_PROGRAMS) $(bin_SCRIPTS); do \
128 prog=`echo "$$prog_ext"|sed 's/$(EXEEXT)$$//'`; \
130 gunzip) aliases='uncompress';; \
133 transform='$(transform)'; \
134 test "X$$prog" = "X$$prog_ext" || \
135 transform="$$transform"';s/$$/$(EXEEXT)/'; \
136 destbindir=$(DESTDIR)$(bindir); \
137 source=`echo "$$prog"|sed "$$transform"`; \
138 for alias in $$aliases; do \
139 dest=`echo "$$alias"|sed "$$transform"`; \
141 cd "$$destbindir" && \
145 ln "$$source" "$$dest" || $(LN_S) "$$source" "$$dest";; \
151 uninstall-local: remove-installed-links
153 ALL_RECURSIVE_TARGETS += distcheck-hook
157 MAINTAINERCLEANFILES = gzip.doc
159 MOSTLYCLEANFILES = _match.i match_.s _match.S gzip.doc.gz \
160 gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew
162 # Note that the first lines are statements. They ensure that environment
163 # variables that can perturb tests are unset or set to expected values.
164 # The rest are envvar settings that propagate build-related Makefile
165 # variables to test scripts.
166 TESTS_ENVIRONMENT = \
167 tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
168 TMPDIR=$$tmp__; export TMPDIR; \
171 if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then \
172 if $(PERL) -e 'use warnings' > /dev/null 2>&1; then \
173 grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=; \
174 $(PERL) -w$$T_ -I$(srcdir) -MCoreutils \
175 -M"CuTmpdir qw($$f)" -- "$$1"; \
177 echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
178 "so skipping this test"; \
186 abs_top_builddir='$(abs_top_builddir)' \
187 abs_top_srcdir='$(abs_top_srcdir)' \
188 abs_srcdir='$(abs_srcdir)' \
189 built_programs='$(PROGRAMS) $(SCRIPTS)' \
191 top_srcdir='$(top_srcdir)' \
194 PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
195 PACKAGE_VERSION=$(PACKAGE_VERSION) \
197 PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
198 REPLACE_GETCWD=$(REPLACE_GETCWD) \
199 PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \