3
3
eval 'exec perl -S $0 ${1+"$@"}'
6
# Create Makefile for Language/INTERCAL.pm
8
# This file is part of CLC-INTERCAL.
10
# Copyright (C) 1999 Claudio Calvelli <lunatic@assurdo.com>, all rights reserved
12
# WARNING - do not operate heavy machinery while using CLC-INTERCAL
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.
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.
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.
30
use vars qw($VERSION);
6
# This script will create the Makefile to build and install CLC-INTERCAL
8
# This file is part of CLC-INTERCAL 1.-94.-4
10
# Copyright (c) 2006 Claudio Calvelli, all rights reserved.
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.
17
use Config qw(%Config);
34
18
use ExtUtils::MakeMaker;
36
WriteMakefile(NAME => 'CLC-INTERCAL',
37
PMLIBDIRS => [qw(Language Charset)],
38
EXE_FILES => ['oo,space,ick'],
39
PREREQ_PM => { 'Data::Dumper' => 2.0 },
21
use vars qw($PERVERSION $VERSION);
22
$PERVERSION = "CLC-INTERCAL Makefile.PL 1.-94.-4.1";
23
($VERSION) = $PERVERSION =~ /(\S+)$/;
25
my @want_type = grep { /^type=/ } @ARGV;
26
@ARGV = grep { ! /^type=/ } @ARGV;
28
open(MANIFEST, "MANIFEST")
29
or die "Sorry, I can't function without file \"MANIFEST\"\n";
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';
44
if (s#^$pm_dir/*##o) {
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;
51
} elsif (m#^$bin_dir/#o) {
58
WriteMakefile(NAME => 'Language::INTERCAL',
59
DISTNAME => 'CLC-INTERCAL',
40
61
VERSION => $VERSION,
41
dist => {COMPRESS => 'gzip', SUFFIX => 'gz'});
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'];
54
my $i = shift->SUPER::manifypods(@_) . "\n\n";
56
$i =~ /\nmanifypods\s*:/ and
57
$j = $` . $&, $' =~ /\n\n/ and
59
. "\n\t\@cp \$(INST_MAN1DIR)/oo,space,ick.\$(MAN1EXT) "
60
. "'\$(INST_MAN1DIR)/oo, ick.\$(MAN1EXT)'\n\n"
63
PM_FILTER => '$(PERL) Generate/Generate',
64
# PMLIBDIRS => [ 'Language' ],
68
'File::Basename' => 0,
77
DIST_DEFAULT => 'ddsh_dist',
79
clean => { FILES => 'iacc_to_io sick_to_io' },
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";
97
my $i = shift->SUPER::postamble(@_);
98
$i .= <<EOI for @iacc;
99
pure_all :: \$(INST_IACC)/$_.io
102
\$(INST_IACC)/$_.io : \$(INST_IACC)/$_.$iacc_suffix
103
\$(SICK) -piacc --output \$(INST_IACC)/$_.io \$(INST_IACC)/$_.$iacc_suffix
106
$i .= <<EOI for @sick;
107
pure_all :: \$(INST_IACC)/$_.io
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
116
$i .= <<EOI for @iasm;
117
pure_all :: \$(INST_IACC)/$_.io
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
131
my $i = shift->SUPER::dist_core(@_);
135
$(RM_F) $(DISTVNAME).ddsh $(DISTVNAME).ddsh$(SUFFIX)
136
$(PERL) ./makeddshdist MANIFEST $(DISTVNAME).ddsh $(VERSION)
137
$(COMPRESS) $(DISTVNAME).ddsh