summaryrefslogtreecommitdiff
path: root/mkdep.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-06-04 19:53:35 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-06-04 19:53:35 +0000
commit2b9e9f9e24d5a5cb95d2b88b70beaed1a1bf4f07 (patch)
tree1232043fd5f2f9b5468d0e0ed4788842fb7db5ae /mkdep.pl
parent63b53f7325aa8a2e705778f7405af9074a8b37c6 (diff)
downloadnasm-2b9e9f9e24d5a5cb95d2b88b70beaed1a1bf4f07.tar.gz
nasm-2b9e9f9e24d5a5cb95d2b88b70beaed1a1bf4f07.tar.bz2
nasm-2b9e9f9e24d5a5cb95d2b88b70beaed1a1bf4f07.zip
Break long lines by default.
Diffstat (limited to 'mkdep.pl')
-rwxr-xr-xmkdep.pl19
1 files changed, 16 insertions, 3 deletions
diff --git a/mkdep.pl b/mkdep.pl
index 5903474..fcd7df8 100755
--- a/mkdep.pl
+++ b/mkdep.pl
@@ -86,6 +86,7 @@ sub insert_deps($) {
my($line,$parm,$val);
my($obj) = '.o'; # Defaults
my($sep) = '/';
+ my($maxline) = 78; # SMTP uses this value...
while ( defined($line = <IN>) ) {
if ( $line =~ /^\s*\#\s*@([a-z0-9-]+):\s*\"([^\"]*)\"/ ) {
@@ -94,6 +95,8 @@ sub insert_deps($) {
$obj = $val;
} elsif ( $parm eq 'path-separator' ) {
$sep = $val;
+ } elsif ( $parm eq 'line-width' ) {
+ $maxline = $val+0;
}
} elsif ( $line eq $barrier ) {
last; # Stop reading input at barrier line
@@ -102,7 +105,7 @@ sub insert_deps($) {
}
close(IN);
- my $dfile, $ofile;
+ my $dfile, $ofile, $str, $sl, $len;
my @deps, $dep;
print OUT $barrier;
@@ -110,9 +113,19 @@ sub insert_deps($) {
foreach $dfile ( sort(keys(%deps)) ) {
if ( $dfile =~ /\.[Cc]$/ ) {
$ofile = $dfile; $ofile =~ s/\.[Cc]$//;
- print OUT convert_file($ofile,$sep), $obj, ':';
+ $str = convert_file($ofile,$sep).$obj.':';
+ $len = length($str);
+ print OUT $str;
foreach $dep ($dfile, alldeps($dfile)) {
- print OUT ' ', convert_file($dep,$sep);
+ $str = convert_file($dep,$sep);
+ $sl = length($str)+1;
+ if ( $len+$sl > $maxline-2 ) {
+ print OUT " \\\n ", $str;
+ $len = $sl;
+ } else {
+ print OUT ' ', $str;
+ $len += $sl;
+ }
}
print OUT "\n";
}