From: Petr Písař Date: Wed, 19 Oct 2022 09:50:23 +0000 (+0200) Subject: Declare make dependencies for Perl binding X-Git-Tag: 0.9.16~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa07053fa365d31c090947ef49c37ebfd70e3c97;p=location%2Flibloc.git Declare make dependencies for Perl binding 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 --- 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: