File: Makefile.PL

package info (click to toggle)
libai-fann-perl 0.10-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 352 kB
  • ctags: 634
  • sloc: perl: 346; ansic: 121; makefile: 2
file content (56 lines) | stat: -rw-r--r-- 1,227 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

use ExtUtils::MakeMaker;

use strict;
use warnings;

my $fann_lib = '';
my $fann_inc = '';
my $prefix;

@ARGV = map {
    if (/^FANN_LIB=(.*)/) {
        $fann_lib = "-L$1 ";
        ()
    }
    elsif (/^FANN_INCLUDE=(.*)/) {
        $fann_inc = "-I$1 ";
        ()
    }
    else {
	$prefix = $1 if /^PREFIX=(.*)/;
	$_
    }
} @ARGV;

if (defined $prefix) {
    $fann_lib = "-L$prefix/lib " unless length $fann_lib;
    $fann_inc = "-I$prefix/include " unless length $fann_inc;
}

WriteMakefile( NAME => 'AI::FANN',
               VERSION_FROM => 'lib/AI/FANN.pm',
               PREREQ_PM => {},
               ABSTRACT_FROM => 'lib/AI/FANN.pm',
               AUTHOR => 'Salvador Fandio <sfandino@yahoo.com>',
               LIBS => ["${fann_lib}-ldoublefann"],
               DEFINE => '',
               INC => "${fann_inc}-I.",
               OBJECT => '$(BASEEXT)$(OBJ_EXT) morefann$(OBJ_EXT)',
               #OPTIMIZE => '-g -O0',
               depend => { '$(BASEEXT).c' => 'constants.h accessors.xsh' }
             );

sub MY::postamble {
    return <<MAKE_FRAG

constants.h: genconstants
\t\$(PERL) genconstants > constants.h

accessors.xsh: genaccessors
\t\$(PERL) genaccessors > accessors.xsh

MAKE_FRAG

}