~ubuntu-branches/ubuntu/trusty/clc-intercal/trusty-proposed

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Bazaar Package Importer
  • Author(s): Mark Brown
  • Date: 2006-10-08 13:30:54 UTC
  • mfrom: (1.1.1 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20061008133054-fto70u71yoyltr3m
Tags: 1:1.0~2pre1.-94.-4.1-1
* New upstream release.
* Change to dh_installman.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
 
1
#!/usr/bin/perl -w
2
2
 
3
3
eval 'exec perl -S $0 ${1+"$@"}'
4
4
    if 0;
5
5
 
6
 
# Create Makefile for Language/INTERCAL.pm
7
 
 
8
 
# This file is part of CLC-INTERCAL.
9
 
 
10
 
# Copyright (C) 1999 Claudio Calvelli <lunatic@assurdo.com>, all rights reserved
11
 
 
12
 
# WARNING - do not operate heavy machinery while using CLC-INTERCAL
13
 
 
14
 
# This program is free software; you can redistribute it and/or modify
15
 
# it under the terms of the GNU General Public License as published by
16
 
# the Free Software Foundation; either 2 of the License, or
17
 
# (at your option) any later version.
18
 
 
19
 
# This program is distributed in the hope that it will be useful,
20
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 
# GNU General Public License for more details.
23
 
 
24
 
# You should have received a copy of the GNU General Public License
25
 
# along with this program; if not, write to the Free Software
26
 
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27
 
 
28
 
require 5.002;
29
 
 
30
 
use vars qw($VERSION);
31
 
 
32
 
$VERSION = '0.05';
33
 
 
 
6
# This script will create the Makefile to build and install CLC-INTERCAL
 
7
 
 
8
# This file is part of CLC-INTERCAL 1.-94.-4
 
9
 
 
10
# Copyright (c) 2006 Claudio Calvelli, all rights reserved.
 
11
 
 
12
# CLC-INTERCAL is copyrighted software. However, permission to use, modify,
 
13
# and distribute it is granted provided that the conditions set out in the
 
14
# licence agreement are met. See files README and COPYING in the distribution.
 
15
 
 
16
require 5.005;
 
17
use Config qw(%Config);
34
18
use ExtUtils::MakeMaker;
35
 
 
36
 
WriteMakefile(NAME => 'CLC-INTERCAL',
37
 
              PMLIBDIRS => [qw(Language Charset)],
38
 
              EXE_FILES => ['oo,space,ick'],
39
 
              PREREQ_PM => { 'Data::Dumper' => 2.0 },
 
19
use strict;
 
20
 
 
21
use vars qw($PERVERSION $VERSION);
 
22
$PERVERSION = "CLC-INTERCAL Makefile.PL 1.-94.-4.1";
 
23
($VERSION) = $PERVERSION =~ /(\S+)$/;
 
24
 
 
25
my @want_type = grep { /^type=/ } @ARGV;
 
26
@ARGV = grep { ! /^type=/ } @ARGV;
 
27
 
 
28
open(MANIFEST, "MANIFEST")
 
29
    or die "Sorry, I can't function without file \"MANIFEST\"\n";
 
30
 
 
31
my $pm_dir = 'INTERCAL';
 
32
my $iacc_dir = 'Include';
 
33
my $iacc_suffix = 'iacc';
 
34
my $sick_suffix = 'i';
 
35
my $iasm_suffix = 'iasm';
 
36
my $bin_dir = 'bin';
 
37
 
 
38
my @iacc = ();
 
39
my @sick = ();
 
40
my @iasm = ();
 
41
my @bin = ();
 
42
while (<MANIFEST>) {
 
43
    chomp;
 
44
    if (s#^$pm_dir/*##o) {
 
45
        s/\s+\S+$//;
 
46
        if (s#^$iacc_dir/*##o) {
 
47
            push @iacc, $_ if s#\.$iacc_suffix$##o;
 
48
            push @sick, $_ if s#\.$sick_suffix$##o;
 
49
            push @iasm, $_ if s#\.$iasm_suffix$##o;
 
50
        }
 
51
    } elsif (m#^$bin_dir/#o) {
 
52
        s/\s+\S+$//;
 
53
        push @bin, $_;
 
54
    }
 
55
}
 
56
close MANIFEST;
 
57
 
 
58
WriteMakefile(NAME => 'Language::INTERCAL',
 
59
              DISTNAME => 'CLC-INTERCAL',
 
60
              EXE_FILES => \@bin,,
40
61
              VERSION => $VERSION,
41
 
              dist => {COMPRESS => 'gzip', SUFFIX => 'gz'});
42
 
 
43
 
sub MY::installbin {
44
 
    package MY;
45
 
    my $i = shift->SUPER::installbin(@_);
46
 
    $i =~ s[\$\(FIXIN\) \$\(INST_SCRIPT\)/oo,space,ick]
47
 
           [\$(FIXIN) \$(INST_SCRIPT)/oo,space,ick
48
 
        \@cp \$(INST_SCRIPT)/oo,space,ick \$(INST_SCRIPT)/'oo, ick'];
49
 
    $i;
50
 
};
51
 
 
52
 
sub MY::manifypods {
53
 
    package MY;
54
 
    my $i = shift->SUPER::manifypods(@_) . "\n\n";
55
 
    my $j;
56
 
    $i =~ /\nmanifypods\s*:/ and
57
 
    $j = $` . $&, $' =~ /\n\n/ and
58
 
    $i = $j . $`
59
 
            . "\n\t\@cp \$(INST_MAN1DIR)/oo,space,ick.\$(MAN1EXT) "
60
 
            . "'\$(INST_MAN1DIR)/oo, ick.\$(MAN1EXT)'\n\n"
61
 
            . $';
62
 
    $i;
63
 
};
 
62
              PERL_MALLOC_OK => 1,
 
63
              PM_FILTER => '$(PERL) Generate/Generate',
 
64
#             PMLIBDIRS => [ 'Language' ],
 
65
              PREREQ_PM => {
 
66
                  'Carp' => 0,
 
67
                  'Cwd' => 0,
 
68
                  'File::Basename' => 0,
 
69
                  'File::Spec' => 0,
 
70
                  'Getopt::Long' => 0,
 
71
                  'IO::File' => 0,
 
72
                  'IO::Handle' => 0,
 
73
              },
 
74
              dist => {
 
75
                  COMPRESS => 'gzip',
 
76
                  SUFFIX => '.gz',
 
77
                  DIST_DEFAULT => 'ddsh_dist',
 
78
              },
 
79
              clean => { FILES => 'iacc_to_io sick_to_io' },
 
80
);
 
81
 
 
82
sub MY::constants {
 
83
    package MY;
 
84
    my $i = shift->SUPER::constants(@_);
 
85
    $i .= "\n# Needed to run iacc\n";
 
86
#    $i .= "SICK_OPTIONS = --rcfile=\$(INST_LIB)/Language/INTERCAL/Include/system.sickrc --batch --bug=0 --ubug=0 --stdtrace=/dev/null -lObject -v\n";
 
87
    $i .= "SICK_OPTIONS = --rcfile=\$(INST_LIB)/Language/INTERCAL/Include/system.sickrc --batch --bug=0 --ubug=0 --stdtrace=/dev/null -lObject\n";
 
88
    $i .= "SICK = \$(FULLPERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) \\\n";
 
89
    $i .= "\t-I\$(PERL_ARCHLIB) -I\$(PERL_LIB) \$(INST_SCRIPT)/sick \\\n";
 
90
    $i .= "\t\$(SICK_OPTIONS)\n";
 
91
    $i .= "INST_IACC = \$(INST_LIB)/Language/INTERCAL/Include\n";
 
92
    $i;
 
93
}
 
94
 
 
95
sub MY::postamble {
 
96
    package MY;
 
97
    my $i = shift->SUPER::postamble(@_);
 
98
    $i .= <<EOI for @iacc;
 
99
pure_all :: \$(INST_IACC)/$_.io
 
100
        \$(NOECHO) \$(NOOP)
 
101
 
 
102
\$(INST_IACC)/$_.io : \$(INST_IACC)/$_.$iacc_suffix
 
103
        \$(SICK) -piacc --output \$(INST_IACC)/$_.io \$(INST_IACC)/$_.$iacc_suffix
 
104
EOI
 
105
 
 
106
    $i .= <<EOI for @sick;
 
107
pure_all :: \$(INST_IACC)/$_.io
 
108
        \$(NOECHO) \$(NOOP)
 
109
 
 
110
\$(INST_IACC)/$_.io : \$(INST_IACC)/sick.io \\
 
111
                \$(INST_IACC)/postpre.io \\
 
112
                \$(INST_IACC)/$_.$sick_suffix
 
113
        \$(SICK) -psick --output \$(INST_IACC)/$_.io \$(INST_IACC)/$_.$sick_suffix
 
114
EOI
 
115
 
 
116
    $i .= <<EOI for @iasm;
 
117
pure_all :: \$(INST_IACC)/$_.io
 
118
        \$(NOECHO) \$(NOOP)
 
119
 
 
120
\$(INST_IACC)/$_.io : \$(INST_IACC)/sick.io \\
 
121
                \$(INST_IACC)/postpre.io \\
 
122
                \$(INST_IACC)/$_.$iasm_suffix
 
123
        \$(SICK) -pasm --output \$(INST_IACC)/$_.io \$(INST_IACC)/$_.$iasm_suffix
 
124
EOI
 
125
 
 
126
    $i;
 
127
};
 
128
 
 
129
sub MY::dist_core {
 
130
    package MY;
 
131
    my $i = shift->SUPER::dist_core(@_);
 
132
    $i .= <<'EOF';
 
133
 
 
134
ddsh_dist :
 
135
        $(RM_F) $(DISTVNAME).ddsh $(DISTVNAME).ddsh$(SUFFIX)
 
136
        $(PERL) ./makeddshdist MANIFEST $(DISTVNAME).ddsh $(VERSION)
 
137
        $(COMPRESS) $(DISTVNAME).ddsh
 
138
 
 
139
EOF
 
140
    $i;
 
141
}
64
142