File: Makefile.PL

package info (click to toggle)
libmath-random-perl 0.71-5
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 364 kB
  • ctags: 187
  • sloc: perl: 1,623; ansic: 1,433; makefile: 10
file content (31 lines) | stat: -rw-r--r-- 738 bytes parent folder | download | duplicates (6)
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
use ExtUtils::MakeMaker;

#--- Original or revised phrtsd?
$OPT = $ARGV[0];
if ($OPT =~ /phrtsd_orig/i) {
   warn "*"x40, "\nUsing original phrtsd\n", "*"x40, "\n";
   $def = '-DPHRTSD_ORIG';
   copy('test1.pl', 'test.pl');
} else {
   $def = '';
   copy('test2.pl', 'test.pl');
}

WriteMakefile(
    'NAME'		=> 'Math::Random',
    'VERSION_FROM'	=> 'Random.pm',
    'OBJECT'		=> '$(O_FILES)',
    'LIBS'		=> ['-lm'],
    'DEFINE'		=> $def,
    'INC'		=> '',     # e.g., '-I/opt/pkg/perl5.002/dist' 
    'dist'		=> { COMPRESS=>"gzip -9", SUFFIX=>"gz" },
);

sub copy {
 my ($in, $out) = @_;
 open(I, $in) or die "Could not open $in: $!";
 open(O, ">$out") or die "Could not open $out: $!";
 while (<I>) { print O; }
 close I;
 close O;
}