1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Generate version.c based on output of "hg id".

This commit is contained in:
Micah Cowan 2007-10-09 16:03:07 -07:00
parent 0b0893fabe
commit 181c613814
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,7 @@ src/wget
src/tags src/tags
src/TAGS src/TAGS
src/libunittest.a src/libunittest.a
src/version.c
doc/stamp-vti doc/stamp-vti
doc/wget.1 doc/wget.1
doc/wget.pod doc/wget.pod

View File

@ -47,6 +47,14 @@ wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c ftp-basic.c \
EXTRA_wget_SOURCES = mswindows.c EXTRA_wget_SOURCES = mswindows.c
LDADD = $(ALLOCA) $(LIBOBJS) 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 check_LIBRARIES = libunittest.a
libunittest_a_SOURCES = $(wget_SOURCES) test.c test.h libunittest_a_SOURCES = $(wget_SOURCES) test.c test.h
libunittest_a_CPPFLAGS = -DTESTING libunittest_a_CPPFLAGS = -DTESTING