Changeset cd254c in git
- Timestamp:
- Dec 9, 1997, 11:57:19 AM (26 years ago)
- Branches:
- (u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
- Children:
- 1d98dbc0614e3c0d1a7a51150922a70a13fdbfc9
- Parents:
- 4e8da257eb53acdc68891dc38d6f060298385436
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/bin/makeheader.pl
r4e8da2 rcd254c 1 1 #!/usr/bin/perl 2 # $Id: makeheader.pl,v 1.2 1997-04-17 14:31:30 schmidt Exp $ 2 # $Id: makeheader.pl,v 1.3 1997-12-09 10:57:19 schmidt Exp $ 3 3 4 # 4 # makeheader.pl - generate a header file out of several header file (ver 1.2). 5 # makeheader.pl - generate a header file out of several header files. 6 # 7 # Type 'makeheader.pl -?' for instructions on syntax/usage. 5 8 # 6 9 … … 11 14 local ( $file, $path ) = @_; 12 15 for ( split ( /:/, $path ) ) { 13 if ( -f "$_/$file" ) { 16 if ( /^\.$/ && -f $file ) { 17 return $file; } 18 elsif ( -f "$_/$file" ) { 14 19 return "$_/$file"; 15 20 } … … 19 24 20 25 if ( ( $#ARGV == -1 ) || ( $ARGV[0] =~ /-help|-\?/ ) ) { 21 die " 22 usage: makeheader [-?] {-I<includedir>} <templatefile> <outfile> 26 die "usage: makeheader [-?] {-I<includedir>} <templatefile> <outfile> 23 27 24 28 This is makeheader, a header file generation tool. … … 43 47 44 48 <includefile> is looked up in all <includedir>s, then in the 45 current directory, then in the base directory of 46 <templatefile>.\n"; 49 current directory, then in the base directory of <templatefile>.\n"; 47 50 } 48 51 49 52 # get list of include directories 50 53 $includes = ""; 51 while ( $ARGV[0] =~ /^- / ) {54 while ( $ARGV[0] =~ /^-I/ ) { 52 55 $_ = shift; 53 56 if ( /^-I(.*)/ ) { … … 59 62 # check for rest of arguments 60 63 if ( $#ARGV < 1 ) { 61 die "usage: makeheader [-?] {-I<includedir>} <templatefile> <outfile>\n \n";64 die "usage: makeheader [-?] {-I<includedir>} <templatefile> <outfile>\n"; 62 65 } 63 66 … … 69 72 70 73 open( INFILE, $infile ) || 71 die "makeheader: Can not open template file $infile for reading!\n";74 die "makeheader: Cannot open template file $infile for reading\n"; 72 75 open( OUTFILE, ">$outfile" ) || 73 die "makeheader: Can not open header file $outfile for writing!\n"; 76 die "makeheader: Cannot open header file $outfile for writing\n"; 77 78 print OUTFILE "/* $outfile automatically generated by makeheader from $infile */\n"; 74 79 75 80 while( <INFILE> ) { … … 87 92 $inclfile = $1; 88 93 } else { 89 die "makeheader: $_ is not a valid include directive!\n";94 die "makeheader: Invalid include statement $_\n"; 90 95 } 91 96 92 97 $inclfile = &searchpath( $inclfile, $includes ) || 93 die "makeheader: Can not open included file $inclfile for reading!\n";98 die "makeheader: Include file $includefile not found\n"; 94 99 open( INCLFILE, $inclfile ) || 95 die "makeheader: Can not open includedfile $inclfile for reading!\n";100 die "makeheader: Cannot open include file $inclfile for reading!\n"; 96 101 97 print OUTFILE " \n/* Stuff included from $inclfile */\n";102 print OUTFILE "/* stuff included from $inclfile */\n\n"; 98 103 if ( $public_only ) { 99 104 # read public part only … … 116 121 } 117 122 } 118 print OUTFILE "\n/* $outfile automatically generated by $0 on " .119 `date` . "*/\n";120 123 121 124 close OUTFILE;
Note: See TracChangeset
for help on using the changeset viewer.