3
# $Id: mkdep.perl 106505 2004-11-25 00:01:34Z nd $
5
# Created: Thu Aug 15 11:57:33 1996 too
6
# Last modified: Mon Dec 27 09:23:56 1999 too
8
# Copyright (c) 1996-1999 Tomi Ollila. All rights reserved.
10
# Redistribution and use in source and binary forms, with or without
11
# modification, are permitted provided that the following conditions
13
# 1. Redistributions of source code must retain the above copyright
14
# notice, this list of conditions and the following disclaimer.
15
# 2. Redistributions in binary form must reproduce the above copyright
16
# notice, this list of conditions and the following disclaimer in the
17
# documentation and/or other materials provided with the distribution.
19
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
22
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
die "Usage: mkdep CPP-command [CPP options] file1 [file2...]\n"
35
$cmdl = "$cmdl " . shift (@ARGV) while ($ARGV[0] =~ /^-[A-Z]/);
37
while ($file = shift(@ARGV))
41
open(F, "$cmdl $file|");
70
next unless (/^# [0-9]* "(.*\.h)"/);
72
next if ($1 =~ /^\//);
78
$nlen = length($1) + 1;
80
if ($len + $nlen > 72)
86
else { $str = $str . " " . $1; }