Commit 58c1938c authored by Adam Wujek's avatar Adam Wujek 💬

tools: print version in wrpc-dump

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 2b3cc5e4
......@@ -114,6 +114,8 @@ OUTPUT := $(OUTPUT-y)
GIT_VER = $(shell git describe --always --dirty | sed 's;^wr-switch-sw-;;')
GIT_USR = $(shell git config --get-all user.name)
export GIT_VER
export GIT_USR
# if user.name is not available from git use user@hostname
ifeq ($(GIT_USR),)
......
......@@ -45,7 +45,8 @@ sdb-wrpc.bin: sdbfs
wrpc-dump: wrpc-dump.c dump-info-host.o
$(CC) $(CFLAGS) -I../ppsi/include -I../ppsi/arch-wrpc/include \
-I ../softpll \
$^ -o $@
$^ -o $@ \
-D__GIT_VER__="\"$(GIT_VER)\"" -D__GIT_USR__="\"$(GIT_USR)\""
pfilter-builder: pfilter-builder.c
$(CC) $(CFLAGS) -include ../include/generated/autoconf.h \
......
......@@ -217,7 +217,11 @@ unsigned long wrpc_get_pointer(void *base, char *s_name, char *f_name)
return 0;
}
void print_version(void)
{
fprintf(stderr, "Built in wrpc-sw repo ver:%s, by %s on %s %s\n",
__GIT_VER__, __GIT_USR__, __TIME__, __DATE__);
}
/* all of these are 0 by default */
unsigned long spll_off, fifo_off, ppi_off, ppg_off, servo_off, ds_off;
......@@ -237,7 +241,8 @@ int main(int argc, char **argv)
fprintf(stderr,
"\"name\" is one of pll, fifo, ppg, ppi, servo_state"
" or ds for data-sets. \"ds\" gets a ppg offset\n");
fprintf(stderr, "But with a new binary, just pass <file>\n");
fprintf(stderr, "But with a new binary, just pass <file>\n\n");
print_version();
exit(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment