From 8872ee50ad218526072d00ffabdf79674e40438a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 17 Oct 2020 01:45:15 +0100 Subject: [PATCH 1/2] Make version recording safe for parallel builds without breaking make dist, developer, builds, downstream builds whether in-source or out-of-source. Done by putting generated files in the build tree rather than the source tree. --- tests/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index b60a88aba..421cc06df 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,7 +27,7 @@ rigswr_SOURCES = rigswr.c rigsmtr_SOURCES = rigsmtr.c rigmem_SOURCES = rigmem.c memsave.c memload.c memcsv.c sprintflst.c sprintflst.h -rigctl_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)/tests $(AM_CPPFLAGS) +rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_srcdir) $(AM_CPPFLAGS) # all the programs need this LDADD = $(top_builddir)/src/libhamlib.la $(top_builddir)/lib/libmisc.la $(DL_LIBS) @@ -101,8 +101,8 @@ testloc.sh: # if not, then copy the placeholder. hamlibdatetime.h: FORCE echo "SHA=$(SHA)" - test ! -x $(top_builddir)/.git || echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(top_builddir)/tests/hamlibdatetime.h - test ! -x $(top_builddir)/.git || 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)\" >> $(top_builddir)/tests//hamlibdatetime.h + test ! -x $(top_srcdir)/.git || echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(top_builddir)/tests/hamlibdatetime.h + test ! -x $(top_srcdir)/.git || 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)\" >> $(top_builddir)/tests/hamlibdatetime.h test -f $(top_builddir)/tests/hamlibdatetime.h || cp $(top_srcdir)/tests/hamlibdatetime.h.in $(top_builddir)/tests/hamlibdatetime.h FORCE: ; From f38ee5c6f1805f74ea430c182c6f7259134ae1eb Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 17 Oct 2020 02:31:17 +0100 Subject: [PATCH 2/2] Ensure old hamlibdatetime.h headers in the source dir are ignored --- tests/ampctl.c | 2 +- tests/rigctl.c | 2 +- tests/rigctld.c | 2 +- tests/rotctl.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ampctl.c b/tests/ampctl.c index 9c54b0f4b..facb707e9 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -24,7 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ -#include "hamlibdatetime.h" +#include #ifdef HAVE_CONFIG_H # include "config.h" diff --git a/tests/rigctl.c b/tests/rigctl.c index 5c482ab74..a23d0696a 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -23,7 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ -#include "hamlibdatetime.h" +#include #ifdef HAVE_CONFIG_H # include "config.h" diff --git a/tests/rigctld.c b/tests/rigctld.c index 7d312944f..4d1e24957 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -71,7 +71,7 @@ #endif #include -#include "hamlibdatetime.h" +#include #include "misc.h" #include "iofunc.h" #include "serial.h" diff --git a/tests/rotctl.c b/tests/rotctl.c index dbcae7486..68f6b7a51 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -23,7 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ -#include "hamlibdatetime.h" +#include #ifdef HAVE_CONFIG_H # include "config.h"