From 8d38c4d16b3858f06b36b935124403eb3bae8023 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Tue, 12 Oct 2021 10:02:35 -0700 Subject: [PATCH] Fix Makefile to build on alternative make implementations On some systems (notably FreeBSD), the make implementation makes a distinction between $(builddir)/ and , even when builddir is `.`. This commit removes $(builddir) from all references to generated files, so that these implementations don't fail. Keeping $(builddir) causes older versions automake (1.15 and older) to generate a broken Makefile. --- libx52/Makefile.am | 8 ++++++-- libx52util/Makefile.am | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libx52/Makefile.am b/libx52/Makefile.am index 22a3927..0e6cde0 100644 --- a/libx52/Makefile.am +++ b/libx52/Makefile.am @@ -49,8 +49,12 @@ libx52test_LDFLAGS = @CMOCKA_LIBS@ @LIBUSB_LIBS@ libx52test_LDADD = libx52.la CLEANFILES += libx52/test_libx52.c -$(builddir)/libx52/test_libx52.c: $(srcdir)/libx52/x52_test_gen.py $(srcdir)/libx52/x52_tests.json - $(AM_V_GEN) $(PYTHON) $(srcdir)/libx52/x52_test_gen.py $(srcdir)/libx52/x52_tests.json > $@ +test_libx52_c_DEPENDS = \ + $(srcdir)/libx52/x52_test_gen.py \ + $(srcdir)/libx52/x52_tests.json + +libx52/test_libx52.c: $(test_libx52_c_DEPENDS) + $(AM_V_GEN) $(PYTHON) $(test_libx52_c_DEPENDS) > $@ endif # Extra files that need to be in the distribution diff --git a/libx52util/Makefile.am b/libx52util/Makefile.am index d3f2694..efb4d8e 100644 --- a/libx52util/Makefile.am +++ b/libx52util/Makefile.am @@ -25,7 +25,7 @@ util_char_map_c_DEPENDS = \ $(srcdir)/libx52util/x52_char_map_gen.py \ $(srcdir)/libx52util/x52_char_map.cfg -$(builddir)/libx52util/util_char_map.c: $(util_char_map_c_DEPENDS) +libx52util/util_char_map.c: $(util_char_map_c_DEPENDS) $(AM_V_GEN) $(PYTHON) $(util_char_map_c_DEPENDS) $@ # Extra files that need to be in the distribution