mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
Make version output simpler/more user-friendly
This commit is contained in:
committed by
Rusty Russell
parent
b4db228aa1
commit
66fc0a047b
4
Makefile
4
Makefile
@@ -1,7 +1,5 @@
|
|||||||
#! /usr/bin/make
|
#! /usr/bin/make
|
||||||
NAME=Bitcoin Savings & Trust Daily Interest II
|
|
||||||
|
|
||||||
# TODO: Decide: c-lightning, lightningd, lightning?
|
|
||||||
PKGNAME = c-lightning
|
PKGNAME = c-lightning
|
||||||
|
|
||||||
# We use our own internal ccan copy.
|
# We use our own internal ccan copy.
|
||||||
@@ -291,7 +289,7 @@ ccan/config.h: ccan/tools/configurator/configurator Makefile
|
|||||||
if $< --configurator-cc="$(CONFIGURATOR_CC)" $(CC) $(CFLAGS) > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
|
if $< --configurator-cc="$(CONFIGURATOR_CC)" $(CC) $(CFLAGS) > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
|
||||||
|
|
||||||
gen_version.h: FORCE
|
gen_version.h: FORCE
|
||||||
@(echo "#define VERSION \"`git describe --always --dirty`\"" && echo "#define VERSION_NAME \"$(NAME)\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > $@.new
|
@(echo "#define VERSION \"`git describe --always --dirty=-with-local-modifications`\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > $@.new
|
||||||
@if cmp $@.new $@ >/dev/null 2>&2; then rm -f $@.new; else mv $@.new $@; echo Version updated; fi
|
@if cmp $@.new $@ >/dev/null 2>&2; then rm -f $@.new; else mv $@.new $@; echo Version updated; fi
|
||||||
|
|
||||||
# All binaries require the external libs, ccan
|
# All binaries require the external libs, ccan
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ const char *version(void)
|
|||||||
|
|
||||||
char *version_and_exit(const void *unused UNUSED)
|
char *version_and_exit(const void *unused UNUSED)
|
||||||
{
|
{
|
||||||
printf("%s\n"
|
printf("%s\n", VERSION);
|
||||||
"aka. %s\n"
|
if (BUILD_FEATURES[0]) {
|
||||||
"Built with: %s\n", VERSION, VERSION_NAME, BUILD_FEATURES);
|
printf("Built with features: %s\n", BUILD_FEATURES);
|
||||||
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user