summaryrefslogtreecommitdiff
path: root/win32/genmk95.pl
diff options
context:
space:
mode:
authorBenjamin Stuhl <sho_pi@hotmail.com>1999-11-18 10:45:27 -0800
committerGurusamy Sarathy <gsar@cpan.org>1999-12-05 11:07:37 +0000
commit7a958ec31151f9d03a26dcab8abdf5c57315dc96 (patch)
treebf0c1582733a01b04dc1e389cf32286fba918631 /win32/genmk95.pl
parent878143fbd9fc1c2bef489be4fd428b8d222cc108 (diff)
downloadperl-7a958ec31151f9d03a26dcab8abdf5c57315dc96.tar.gz
applied somewhat modified version of suggested patch
Message-ID: <19991119024527.72749.qmail@hotmail.com> Subject: [PATCH 5.005_62] Perl on Win95, Mark IIB p4raw-id: //depot/perl@4653
Diffstat (limited to 'win32/genmk95.pl')
-rw-r--r--win32/genmk95.pl33
1 files changed, 17 insertions, 16 deletions
diff --git a/win32/genmk95.pl b/win32/genmk95.pl
index 74788ff3cb..6137ce2be6 100644
--- a/win32/genmk95.pl
+++ b/win32/genmk95.pl
@@ -1,28 +1,28 @@
-# genmk95.pl - uses miniperl to generate a makefile that command.com
-# (and dmake) will understand given one that cmd.exe will understand
+# genmk95.pl - uses miniperl to generate a makefile that command.com will
+# understand given one that cmd.exe will understand
# Author: Benjamin K. Stuhl
-# Date: 8-18-1999
+# Date: 10-16-1999
# how it works:
# dmake supports an alternative form for its recipes, called "group
-# recipes", in which all elements of a recipe are run with only one
-# shell. This program converts the standard dmake makefile.mk to
-# one using group recipes. This is done so that lines using && or
-# || (which command.com doesn't understand) may be split into two
-# lines.
+# recipes", in which all elements of a recipe are run with only one shell.
+# This program converts the standard dmake makefile.mk to one using group
+# recipes. This is done so that lines using && or || (which command.com
+# doesn't understand) may be split into two lines that will still be run
+# with one shell.
my ($filein, $fileout) = @ARGV;
-chomp (my $loc = `cd`);
-
-open my $in, $filein or die "Error opening input file: $!";
-open my $out, "> $fileout" or die "Error opening output file: $!";
+open my $in, $filein or die "Error opening input file: $!\n";
+open my $out, "> $fileout" or die "Error opening output file: $!\n";
print $out <<_EOH_;
# *** Warning: this file is autogenerated from $filein by $0 ***
# *** Do not edit this file - edit $filein instead ***
+_HOME_DIR := \$(PWD)
+
_EOH_
my $inrec = 0;
@@ -30,12 +30,12 @@ my $inrec = 0;
while (<$in>)
{
chomp;
- if (/^[^#.\t][^#=]*?:/)
+ if (/^[^#.\t][^#=]*?:(?:[^=]|$)/)
{
if (! $inrec)
{
print $out "$_\n";
- while (/\\$/)
+ while (/\\\s*$/)
{
chomp($_ = <$in>);
print $out "$_\n";
@@ -70,7 +70,7 @@ LINE_CONT:
s/^\s*// for ($one, $two);
print $out "\t$one\n\t$two\n" if ($sep eq "&&");
print $out "\t$one\n\tif errorlevel 1 $two\n" if ($sep eq "||");
- print $out "\tcd $loc\n";
+ print $out "\tcd \$(_HOME_DIR)\n";
next;
}
# fall through - no need for special handling
@@ -78,4 +78,5 @@ LINE_CONT:
}
print $out "]\n" if ($inrec);
-close $in; close $out;
+close $in or warn "Error closing \$in: $!\n";
+close $out or warn "Error closing \$out: $!\n";