From 41eb098d64f2d29dac0b1391172f7372c07fa2a0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 4 Nov 2021 17:40:09 +0000 Subject: [PATCH 1/6] */Makefile.am: define dependencies on out-of-dir *.la helper libs: use AM_MAKEFLAGS (follows-up to PR #1151) --- clients/Makefile.am | 2 +- common/Makefile.am | 2 +- drivers/Makefile.am | 2 +- server/Makefile.am | 2 +- tests/Makefile.am | 4 ++-- tools/nut-scanner/Makefile.am | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clients/Makefile.am b/clients/Makefile.am index d77db3f765..26473f1da8 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -10,7 +10,7 @@ AM_CXXFLAGS = -DHAVE_NUTCOMMON=1 -I$(top_srcdir)/include $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libcommonclient.la \ $(top_builddir)/common/libparseconf.la: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # by default, link programs in this directory with libcommon.a LDADD = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS) diff --git a/common/Makefile.am b/common/Makefile.am index 3917a80039..2fccd679fc 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -12,7 +12,7 @@ libparseconf_la_SOURCES = parseconf.c common.c: $(top_builddir)/include/nut_version.h $(top_builddir)/include/nut_version.h: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) libcommon_la_SOURCES = common.c state.c str.c upsconf.c libcommonclient_la_SOURCES = common.c state.c str.c diff --git a/drivers/Makefile.am b/drivers/Makefile.am index c4a045d959..551d38625c 100644 --- a/drivers/Makefile.am +++ b/drivers/Makefile.am @@ -4,7 +4,7 @@ $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libparseconf.la \ $(top_builddir)/clients/libupsclient.la: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # by default, link programs in this directory with libcommon.la # (libtool version of the static lib, in order to access LTLIBOBJS) diff --git a/server/Makefile.am b/server/Makefile.am index 76f15e6c7a..a6bc29cef9 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -3,7 +3,7 @@ # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libparseconf.la: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # Avoid per-target CFLAGS, because this will prevent re-use of object # files. In any case, CFLAGS are only -I options, so there is no harm, diff --git a/tests/Makefile.am b/tests/Makefile.am index dd2b60f11b..1cb40daaf0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,7 +19,7 @@ getvaluetest_LDADD = $(top_builddir)/common/libcommon.la # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) ### Optional tests which can not be built everywhere # List of src files for CppUnit tests @@ -50,7 +50,7 @@ cppunittest_SOURCES = $(CPPUNITTESTSRC) $(CPPUNITTESTERSRC) # Make sure out-of-dir C++ dependencies exist (especially when dev-building # only some parts of NUT): $(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) else !HAVE_CPPUNIT # Just redistribute test source into tarball diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index 680703eb85..d3b8eeba69 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -15,7 +15,7 @@ $(NUT_SCANNER_DEPS): # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # do not hard depend on '../include/nut_version.h', since it blocks # 'dist', and is only required for actual build, in which case @@ -24,7 +24,7 @@ $(top_builddir)/common/libcommon.la: $(top_srcdir)/common/common.c nut-scanner.c: $(top_builddir)/include/nut_version.h $(top_builddir)/include/nut_version.h: - @cd $(@D) && $(MAKE) -s $(@F) + @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # Only build nut-scanner, and its library, if libltdl was found (required!) if WITH_LIBLTDL From cf5f84ccf42e1d5c432bc7d4d53bf73dadf0be1a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 4 Nov 2021 20:07:57 +0000 Subject: [PATCH 2/6] tools/nut-scanner/Makefile.am: fix rule for NUT_SCANNER_DEPS to be sure --- tools/nut-scanner/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index d3b8eeba69..e426073c23 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = $(NUT_SCANNER_DEPS) # Make sure we have the freshest files (no-op if built earlier and then # no driver sources and other dependencies were edited by a developer) $(NUT_SCANNER_DEPS): - cd ..; $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps + @cd .. && $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la: From 756c7d786e673bfd63fc51988f2d06ff29a06b31 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 4 Nov 2021 20:18:28 +0000 Subject: [PATCH 3/6] tools/nut-scanner/Makefile.am: do not build common.c into nut-scanner (avoid double-definition of nut_debug_level among other things) --- tools/nut-scanner/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index e426073c23..6905612777 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -21,7 +21,7 @@ $(top_builddir)/common/libcommon.la: # 'dist', and is only required for actual build, in which case # BUILT_SOURCES (in ../include) will ensure nut_version.h will # be built before anything else -$(top_srcdir)/common/common.c nut-scanner.c: $(top_builddir)/include/nut_version.h +nut-scanner.c: $(top_builddir)/include/nut_version.h $(top_builddir)/include/nut_version.h: @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) @@ -36,8 +36,7 @@ libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \ nutscan-init.c scan_usb.c scan_snmp.c scan_xml_http.c \ scan_avahi.c scan_eaton_serial.c nutscan-serial.c \ $(top_srcdir)/drivers/serial.c \ - $(top_srcdir)/drivers/bcmxcp_ser.c \ - $(top_srcdir)/common/common.c $(top_srcdir)/common/str.c + $(top_srcdir)/drivers/bcmxcp_ser.c libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) # # Below we set API versions of public libraries From 53c3381bdd20faf7429f4221fe6f2eb5b2254891 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 4 Nov 2021 23:44:35 +0100 Subject: [PATCH 4/6] tools/nut-scanner/Makefile.am: use libcommon.la as part of libnutscan.(la|so) --- tools/nut-scanner/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index 6905612777..56d89cc492 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -37,7 +37,7 @@ libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \ scan_avahi.c scan_eaton_serial.c nutscan-serial.c \ $(top_srcdir)/drivers/serial.c \ $(top_srcdir)/drivers/bcmxcp_ser.c -libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) +libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) $(top_builddir)/common/libcommon.la # # Below we set API versions of public libraries # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html @@ -50,7 +50,7 @@ libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL nut_scanner_SOURCES = nut-scanner.c nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include -nut_scanner_LDADD = $(top_builddir)/common/libcommon.la libnutscan.la +nut_scanner_LDADD = libnutscan.la if WITH_SSL libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS) From db979aee18168c8712b8998a2301805f889af71f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 6 Nov 2021 21:48:53 +0100 Subject: [PATCH 5/6] GitIgnore .dirstamp in build trees --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e08573fb2f..534bdd283a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ common/.dirstamp /cppcheck*.xml /.ci*.log /.ci*.log.* +.dirstamp # Python precompiled files __pycache__/ From 07b250a826ec5d86e30a7db0823e5db099035582 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 6 Nov 2021 21:49:36 +0100 Subject: [PATCH 6/6] GitIgnore LINKED_SOURCES (follow-up to PR #1159) --- tests/.gitignore | 1 + tools/nut-scanner/.gitignore | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/.gitignore b/tests/.gitignore index b7a2de42f9..cdee50ce56 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -9,3 +9,4 @@ /getvaluetest /getvaluetest.log /getvaluetest.trs +/hidparser.c diff --git a/tools/nut-scanner/.gitignore b/tools/nut-scanner/.gitignore index bf1ab545d2..393712ae49 100644 --- a/tools/nut-scanner/.gitignore +++ b/tools/nut-scanner/.gitignore @@ -1,3 +1,5 @@ /nut-scanner /nutscan-snmp.h /nutscan-usb.h +/serial.c +/bcmxcp_ser.c