casiano has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I want the test target of the Makefile generated by Makefile.PL to depend on some additional targets explicited in my MY::postamble function. I. e. when doing

make test
I want some other targets to be performed as well. How can I do that?

Many, many thanks for sharing your knowledge

Casiano

Replies are listed 'Best First'.
Re: Adding dependencies to the generated Makefile
by Anonymous Monk on Oct 29, 2008 at 11:58 UTC
      Thanks.
      I already tried this but I am failing:
      $ cat Makefile.PL use warnings; use strict; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Math::Calc', VERSION => '1.0', PREREQ_PM => {}, # e.g., Module::Name => 1.1 EXE_FILES => [ 'scripts/calc.pl' ], ABSTRACT_FROM => 'lib/Math/Calc.pod', # retrieve abstract from + pod AUTHOR => 'Procesadores de Lenguaje <casiano@ull.es>', depend => { 'test' => 'calc' }, ); sub MY::postamble { return <<'EOM'; calc: lib/Math/Calc.pm lib/Math/Calc.pm: lib/Math/Calc.eyp eyapp -s -m Math::Calc -o lib/Math/Calc.pm lib/Math/Calc.eyp myclean: veryclean rm -f Math-Calc-*.tar.gz cover -delete rmcalc: rm -f lib/Math/Calc.pm mytest: calc test remotetest: calc dist remotetest.pl ${DISTVNAME}.tar.gz orion beowulf coverage: calc cover -delete make HARNESS_PERL_SWITCHES=-MDevel::Cover test cover EOM }
      It says s.t. like:
      $ perl Makefile.PL Writing Makefile for Math::Calc $ make test Makefile:779: *** el archivo de objetivos `test' tiene líneas con : y +::. Alto.
      Waht I am doing wrong?
      I also unsuccessfully tried to add a colon to the target descriptor:
      depend => { 'test:' => 'calc' },
        Ouch. How about an example we can try? With error messages we don't have to translate? :)

        update: ok, after finding something to test, your error appears to be same as NMAKE Fatal Error U1087 (cannot have : and :: dependents for same target) which appears to be what ExtUtils::MakeMaker warned about (ANY_TARGET must not be given a double-colon rule by MakeMaker.). Maybe you can switch to Module::Build?