Commit fa07053f authored by Petr Písař's avatar Petr Písař Committed by Michael Tremer

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: default avatarPetr Písař <ppisar@redhat.com>
Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent a2427902
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment