From 181c613814adf8e778c1b4b430bea8ba53e92582 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Tue, 9 Oct 2007 16:03:07 -0700 Subject: [PATCH] Generate version.c based on output of "hg id". --- .hgignore | 1 + src/Makefile.am | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.hgignore b/.hgignore index 482a36cb..9e6fcf9a 100644 --- a/.hgignore +++ b/.hgignore @@ -22,6 +22,7 @@ src/wget src/tags src/TAGS src/libunittest.a +src/version.c doc/stamp-vti doc/wget.1 doc/wget.pod diff --git a/src/Makefile.am b/src/Makefile.am index 257ed156..ac52ee60 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,14 @@ wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c ftp-basic.c \ EXTRA_wget_SOURCES = mswindows.c LDADD = $(ALLOCA) $(LIBOBJS) +# version.c's not really _phony_, but it does need to be generated each run. +HG_ID = $(shell hg id 2>/dev/null | cut -f 1 -d ' ') +.PHONY: version.c +version.c: + printf '%s' 'const char *version_string = "@VERSION@' > $@ + [ "$(HG_ID)" ] && printf '%s' ' ($(HG_ID))' >> $@ + printf '%s\n' '";' >> $@ + check_LIBRARIES = libunittest.a libunittest_a_SOURCES = $(wget_SOURCES) test.c test.h libunittest_a_CPPFLAGS = -DTESTING -- 2.39.2