next up previous contents index practicapracticaPP2moodleLHPmoodlepserratacpanmodulospauseperlgoogleetsiiullpcgull
Sig: Práctica: Ejecutable en una Sup: Pruebas en la Construcción Ant: Dónde está un Módulo Err: Si hallas una errata ...

Ejecutables

Si se tienen guiones ejecutables que acompañan el módulo es conveniente hacerlo notar en Makefile.PL usando la opción EXE_FILES de WriteMakefile. El valor para esta clave es una referencia a un array de ficheros ejecutables. Por ejemplo:
   # Verify perl version.
    require 5.000;
    use ExtUtils::MakeMaker;
    my @scripts = qw(fontsampler pfb2pfa pfa2pfb);
    WriteMakefile
      (
       NAME      => 'PostScript::Font',
       ($[ >= 5.005) ?
       (AUTHOR   => 'Johan Vromans (jvromans@squirrel.nl)',
        ABSTRACT => 'Modules to get info from PostScript fonts') : (),
       VERSION   => "0.03",
       PREREQ_PM => { 'Getopt::Long' => 2.00, 'IO' => 0 },
       EXE_FILES => [ map { "script/$_" } @scripts ],
       # *.pm files will be picked up automatically from ./lib
     );
Los ficheros serán copiados al directorio INST_SCRIPT (por defecto ./blib/script) cuando se haga make. Hacer make realclean borrará estas copias. Hacer make install los copiará desde INST_SCRIPT hasta INSTALLSCRIPT. Veamos un ejemplo típico de su valor:
~/Lperl/src/threads/knapsack/Algorithm-Knap01DP$ grep '^INSTALLSCRIPT' Makefile
INSTALLSCRIPT = $(PERLPREFIX)/bin
~/Lperl/src/threads/knapsack/Algorithm-Knap01DP$ grep '^PERLPREFIX' Makefile
PERLPREFIX = $(PREFIX)
~/Lperl/src/threads/knapsack/Algorithm-Knap01DP$ grep '^PREFIX' Makefile
PREFIX = /usr
El método WriteMakefile sobreescribirá la cabecera del ejecutable, por ejemplo#!/usr/bin/perl, por el camino que lleva a la versión del compilador Perl que se usó para ejecutar Makefile.PL.


next up previous contents index practicapracticaPP2moodleLHPmoodlepserratacpanmodulospauseperlgoogleetsiiullpcgull
Sig: Práctica: Ejecutable en una Sup: Pruebas en la Construcción Ant: Dónde está un Módulo Err: Si hallas una errata ...
Casiano Rodríguez León
2006-02-21