File: cxref_includes.pl

package info (click to toggle)
cxref 1.6e-3.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 2,996 kB
  • sloc: ansic: 16,598; yacc: 2,091; sh: 937; lex: 470; perl: 452; makefile: 433; lisp: 256; cpp: 188; python: 80
file content (56 lines) | stat: -rwxr-xr-x 1,006 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# -*- cperl -*-
#
# C Cross Referencing & Documentation tool. Version 1.5b.
#
# A Perl script to determine the headers to process from the cxref.include file.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1999 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

if [ ! -f "$1" ]; then
   echo "Usage: $0 cxref.include"
   exit 1
fi

exec perl -x $0 $1

exit 1

#!perl

$|=1;

open(INCLUDE,"<$ARGV[0]") || die "Cannot open $ARGV[0]\n";

@files=();

while(<INCLUDE>)
  {
   ($cfile,@hfiles)=split(/[ \n]+/);

   foreach $hfile (@hfiles)
       {
        push(@files,substr($hfile,1)) if ($hfile =~ m/^%/);
       }
  }

close(INCLUDE);

$lastfile='';
@files=sort(@files);

foreach $file (@files)
  {
   if($file ne $lastfile)
       {
        print "cxref $file\n";
        `cxref $file`;
       }
   $lastfile=$file;
  }