perl: Fix build and test to work with separated builds.

This is inspired largely by Hilko Bengen's equivalent
hivex patch here:

887466794a
This commit is contained in:
Richard W.M. Jones
2013-04-30 12:22:54 +01:00
parent 440183b440
commit 4ea016dae9
6 changed files with 21 additions and 8 deletions

View File

@@ -64,10 +64,20 @@ TESTS_ENVIRONMENT = $(top_builddir)/run --test
INSTALLDIRS = site
all: Makefile-pl src_deps
$(MAKE) -f Makefile-pl
$(MAKE) -C $(srcdir) -f $(abs_builddir)/Makefile-pl \
INST_ARCHLIB=$(abs_builddir)/blib/arch \
INST_SCRIPT=$(abs_builddir)/blib/script \
INST_BIN=$(abs_builddir)/blib/bin \
INST_LIB=$(abs_builddir)/blib/lib \
INST_MAN1DIR=$(abs_builddir)/blib/man1 \
INST_MAN3DIR=$(abs_builddir)/blib/man3 \
TEST_FILES=$(abs_srcdir)/t/*.t
Makefile-pl: Makefile.PL
perl Makefile.PL INSTALLDIRS=$(INSTALLDIRS) PREFIX=$(prefix)
cd $(srcdir); \
perl $(abs_builddir)/Makefile.PL \
INSTALLDIRS=$(INSTALLDIRS) PREFIX=$(prefix)
sed -i 's,Makefile.PL,$(abs_builddir)/Makefile.PL,' $@
# No! Otherwise it is deleted before the clean-local rule runs.
#CLEANFILES = Makefile-pl