[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 1224e9f6ba7e2084a133f
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-03-20 04:15:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 1224e9f6ba7e2084a133f8a94f6013820045fbd7 (commit) from 5817096b00b64e30a19f000c879ec7fb913eeacf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1224e9f6ba7e2084a133f8a94f6013820045fbd7 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 19 23:14:13 2021 -0500 Move hamlibdatetime.h generation to src directory https://github.com/Hamlib/Hamlib/issues/617 diff --git a/src/Makefile.am b/src/Makefile.am index af836273..89fe5a06 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,10 @@ # src/Makefile.am -RIGSRC = rig.c serial.c serial.h misc.c misc.h register.c register.h event.c \ +BUILT_SOURCES = $(builddir)/hamlibdatetime.h + +DISTCLEANFILES = hamlibdatetime.h + +RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c register.h event.c \ event.h cal.c cal.h conf.c tones.c tones.h rotator.c locator.c rot_reg.c \ rot_conf.c rot_conf.h rot_settings.c rot_ext.c iofunc.c iofunc.h ext.c \ mem.c settings.c parallel.c parallel.h usb_port.c usb_port.h debug.c \ @@ -18,4 +22,28 @@ libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la \ libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) -EXTRA_DIST = Android.mk +EXTRA_DIST = Android.mk hamlibdatetime.h.in + +# If we have a .git directory then we will generate the hamlibdate.h +# file and replace it if it is different. Fall back to a copy of a +# generic hamlibdatetime.h.in in the source tree. Build looks in build +# directory before the source directory for the hamlibdatetime.h +# header. +hamlibdatetime.h: FORCE + @if test -x $(top_srcdir)/.git ; then \ + echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ + diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ + rm -f $(builddir)/$(@F).tmp ;\ + else \ + test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\ + fi + +FORCE: + +# If we are making a distribution out-of-source and we have generated +# a hamlibdatetime.h; then copy it to the tests directory of the +# source tarball so that downstream builds pick up the version +# information we know about. +dist-hook: + test ./ -ef $(srcdir)/ || test ! -f hamlibdatetime.h || cp -f hamlibdatetime.h $(srcdir)/ diff --git a/tests/hamlibdatetime.h.in b/src/hamlibdatetime.h.in similarity index 100% rename from tests/hamlibdatetime.h.in rename to src/hamlibdatetime.h.in diff --git a/src/rig.c b/src/rig.c index 1452d96f..163274af 100644 --- a/src/rig.c +++ b/src/rig.c @@ -72,7 +72,7 @@ #include "gpio.h" #include "misc.h" #include "sprintflst.h" -#include "../tests/hamlibdatetime.h" +#include "hamlibdatetime.h" /** * \brief Hamlib release number diff --git a/tests/Makefile.am b/tests/Makefile.am index 86381d7d..21a2b88a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,17 +4,15 @@ # AUTOMAKE_OPTIONS = dejagnu # DEJATOOL = testfreq testbcd testloc rigctl -BUILT_SOURCES = $(builddir)/hamlibdatetime.h - -DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum hamlibdatetime.h +DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom ampctl ampctld check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 -RIGCOMMONSRC = rigctl_parse.c rigctl_parse.h dumpcaps.c uthash.h hamlibdatetime.h -ROTCOMMONSRC = rotctl_parse.c rotctl_parse.h dumpcaps_rot.c uthash.h hamlibdatetime.h -AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h hamlibdatetime.h +RIGCOMMONSRC = rigctl_parse.c rigctl_parse.h dumpcaps.c uthash.h ../src/hamlibdatetime.h +ROTCOMMONSRC = rotctl_parse.c rotctl_parse.h dumpcaps_rot.c uthash.h ../src/hamlibdatetime.h +AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h ../src/hamlibdatetime.h rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC) rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC) @@ -73,8 +71,7 @@ rigmatrix.html: rigmatrix_head.html rigmatrix listrigs endif -EXTRA_DIST = rigmatrix_head.html rig_split_lst.awk testctld.pl testrotctld.pl \ - hamlibdatetime.h.in +EXTRA_DIST = rigmatrix_head.html rig_split_lst.awk testctld.pl testrotctld.pl # Support 'make check' target for simple tests check_SCRIPTS = testrig.sh testfreq.sh testbcd.sh testloc.sh testrigcaps.sh testcache.sh @@ -106,28 +103,4 @@ testcache.sh: echo './testcache 1' > testcache.sh chmod +x ./testcache.sh -# If we have a .git directory then we will generate the hamlibdate.h -# file and replace it if it is different. Fall back to a copy of a -# generic hamlibdatetime.h.in in the source tree. Build looks in build -# directory before the source directory for the hamlibdatetime.h -# header. -hamlibdatetime.h: FORCE - @if test -x $(top_srcdir)/.git ; then \ - echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ - echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ - diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ - rm -f $(builddir)/$(@F).tmp ;\ - else \ - test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\ - fi - -FORCE: - -# If we are making a distribution out-of-source and we have generated -# a hamlibdatetime.h; then copy it to the tests directory of the -# source tarball so that downstream builds pick up the version -# information we know about. -dist-hook: - test ./ -ef $(srcdir)/ || test ! -f hamlibdatetime.h || cp -f hamlibdatetime.h $(srcdir)/ - CLEANFILES = testrig.sh testfreq.sh testbcd.sh testloc.sh testrigcaps.sh testcache.sh ----------------------------------------------------------------------- Summary of changes: src/Makefile.am | 32 ++++++++++++++++++++++++++++++-- {tests => src}/hamlibdatetime.h.in | 0 src/rig.c | 2 +- tests/Makefile.am | 37 +++++-------------------------------- 4 files changed, 36 insertions(+), 35 deletions(-) rename {tests => src}/hamlibdatetime.h.in (100%) hooks/post-receive -- Hamlib -- Ham radio control libraries |