diff --git a/tests/Makefile.am b/tests/Makefile.am index 9b51f6a53..9a0400a25 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,15 +4,17 @@ # AUTOMAKE_OPTIONS = dejagnu # DEJATOOL = testfreq testbcd testloc rigctl -DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum +BUILT_SOURCES = hamlibdatetime.h + +DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum datebuilt.h bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom ampctl ampctld check_PROGRAMS = dumpmem testrig testtrn testbcd testfreq listrigs testloc rig_bench cachetest cachetest2 -RIGCOMMONSRC = rigctl_parse.c rigctl_parse.h dumpcaps.c sprintflst.c sprintflst.h uthash.h -ROTCOMMONSRC = rotctl_parse.c rotctl_parse.h dumpcaps_rot.c uthash.h -AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c sprintflst.c sprintflst.h uthash.h +RIGCOMMONSRC = rigctl_parse.c rigctl_parse.h dumpcaps.c sprintflst.c sprintflst.h uthash.h datebuilt.h +ROTCOMMONSRC = rotctl_parse.c rotctl_parse.h dumpcaps_rot.c uthash.h datebuilt.h +AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c sprintflst.c sprintflst.h uthash.h datebuilt.h rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC) rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC) @@ -94,5 +96,11 @@ testloc.sh: echo './testloc EM79UT96LW 5' > testloc.sh chmod +x ./testloc.sh +# If we have a .git directory then we will update the hamlibdate.h file +hamlibdatetime.h: FORCE + test ! -x ../.git || echo // This date time is from the last commit to hamlib > hamlibdatetime.h + test ! -x ../.git || echo "#define HAMLIBDATETIME "\"`git log -n 1 | grep Date:|cut -c9-`"\"" >> hamlibdatetime.h + +FORCE: ; CLEANFILES = testrig.sh testfreq.sh testbcd.sh testloc.sh diff --git a/tests/ampctl.c b/tests/ampctl.c index 8da1925b9..eb9f4da76 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -24,6 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ +#include "hamlibdatetime.h" #ifdef HAVE_CONFIG_H # include "config.h" @@ -272,7 +273,7 @@ int main(int argc, char *argv[]) rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "ampctl, %s\n", hamlib_version); + rig_debug(RIG_DEBUG_VERBOSE, "ampctl %s\nLast commit was %s\n", hamlib_version, HAMLIBDATETIME); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to \n\n"); diff --git a/tests/rigctl.c b/tests/rigctl.c index a47c8efbd..fedb0405b 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ +#include "hamlibdatetime.h" #ifdef HAVE_CONFIG_H # include "config.h" @@ -428,8 +429,8 @@ int main(int argc, char *argv[]) rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "rigctl, %s %s\n", hamlib_version, - __DATE__ " " __TIME__); + rig_debug(RIG_DEBUG_VERBOSE, "rigctl %s\nLast commit was %s\n", hamlib_version, + HAMLIBDATETIME); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to \n\n"); diff --git a/tests/rotctl.c b/tests/rotctl.c index b565502b1..d0d16f21a 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ +#include "hamlibdatetime.h" #ifdef HAVE_CONFIG_H # include "config.h" @@ -298,7 +299,7 @@ int main(int argc, char *argv[]) rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "rotctl, %s\n", hamlib_version); + rig_debug(RIG_DEBUG_VERBOSE, "rotctl %s\nLast commit was %s\n", hamlib_version, HAMLIBDATETIME); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to \n\n");