# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ALL_RECURSIVE_TARGETS =
+BUILT_SOURCES =
SUBDIRS = lib doc . tests
ACLOCAL_AMFLAGS = -I m4
# Tell the linker to omit references to unused shared libraries.
AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
+noinst_LIBRARIES = libver.a
+nodist_libver_a_SOURCES = version.c version.h
+DISTCLEANFILES = version.c version.h
+
man_MANS = gunzip.1 gzexe.1 gzip.1 \
zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
gzip_SOURCES = \
bits.c crypt.c deflate.c gzip.c inflate.c lzw.c \
trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c
-gzip_LDADD = lib/libgzip.a
+gzip_LDADD = libver.a lib/libgzip.a
gzip_LDADD += $(LIB_CLOCK_GETTIME)
+BUILT_SOURCES += version.c
+version.c: Makefile
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)printf '#include <config.h>\n' > $@t
+ $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+
+BUILT_SOURCES += version.h
+version.h: Makefile
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)printf 'extern char const *Version;\n' > $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+
gzip.doc: gzip.1
$(AM_V_GEN)groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq > $@-t \
&& mv $@-t $@
#include "getopt.h"
#include "ignore-value.h"
#include "stat-time.h"
+#include "version.h"
/* configuration */
{
char const *const *p = license_msg;
- printf ("%s %s\n", program_name, VERSION);
+ printf ("%s %s\n", program_name, Version);
while (*p) printf ("%s\n", *p++);
}