From fa07053fa365d31c090947ef49c37ebfd70e3c97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 19 Oct 2022 11:50:23 +0200 Subject: [PATCH] Declare make dependencies for Perl binding MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Running make in parallel (make -j5) randomly failed with: /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -include ./config.h -DSYSCONFDIR=\""/etc"\" -I./src -Wall -Wchar-subscripts -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wtype-limits -fno-semantic-interposition -ffunction-sections -fdata-sections -DLIBLOC_PRIVATE -fvisibility=hidden -g -O2 -c -o src/libloc_internal_la-database.lo `test -f 'src/database.c' || echo './'`src/database.c /usr/bin/ld: cannot find -lloc: No such file or directory collect2: error: ld returned 1 exit status make[3]: *** [Makefile:482: blib/arch/auto/Location/Location.so] Error 1 make[2]: *** [Makefile:2982: build-perl] Error 2 That's because build-perl did not depend on libloc library. A similar issue was with running tests and installing files. Moreover, thess two targets rebuilt Perl binding from scratch. This patch make the dependencies explicit and turns build-perl into non-PHONY. Fixes: #12961 Signed-off-by: Petr Písař Signed-off-by: Michael Tremer --- Makefile.am | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 63ea173..81e10f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -232,8 +232,7 @@ EXTRA_DIST += \ src/perl/t/Location.t \ src/perl/typemap -.PHONY: build-perl -build-perl: +build-perl: src/libloc.la @mkdir -p $(builddir)/src/perl/{lib,t} @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/ @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/ @@ -245,19 +244,21 @@ build-perl: cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \ INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc" cd $(builddir)/src/perl && $(MAKE) + touch build-perl .PHONY: check-perl -check-perl: testdata.db +check-perl: testdata.db build-perl cd $(builddir)/src/perl && $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \ database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem" .PHONY: install-perl -install-perl: +install-perl: build-perl cd $(builddir)/src/perl && $(MAKE) install DESTIDR=$(DESTDIR) .PHONY: clean-perl clean-perl: cd $(builddir)/src/perl && $(MAKE) distclean + rm build-perl .PHONY: uninstall-perl uninstall-perl: -- 2.39.2