in reply to Re^2: Benchmarks target in Makefile
in thread Benchmarks target in Makefile

Based on my reading of ExtUtils::MakeMaker:

postamble: Anything put here will be passed to MY::postamble() if you have one

... and the

sub MY::postamble { my (undef,%h) = @_; ...
start to my function that I linked earlier, I believe that MM passes the hash as args to the subroutine, not as variables in the Makefile, so I would suggest something like (untested):
sub MY::postamble { my (undef,%h) = @_; my $ret = "bench :: $h{BENCHMARKS}\n"; $ret .= <<'POSTAMBLE'; $(NOECHO) /usr/bin/env perl '$<' POSTAMBLE return $ret; } WriteMakefile( INSTALL_BASE => blablabla ... postamble => { BENCHMARKS => 'benchmarks/*.b' } );

Replies are listed 'Best First'.
Re^4: Benchmarks target in Makefile
by bliako (Abbot) on Jun 19, 2018 at 19:40 UTC

    thanks it works.

    Based on what you supplied, inserting into the Makefile a variable which holds all benchmark files $(BENCHMARKS), works this way:

    return "BENCHMARKS=$h{BENCHMARKS}\n" . <<'POSTAMBLE'; bench :: $(BENCHMARKS) $(NOECHO) /usr/bin/env perl '$<' POSTAMBLE