ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ProcessSiteFile
Revision: 1.3
Committed: Thu Mar 18 12:53:57 1999 UTC (26 years, 1 month ago) by williamc
Branch: MAIN
CVS Tags: V0_1
Changes since 1.2: +9 -6 lines
Log Message:
Mods to allow external in tools files propogate

File Contents

# User Rev Content
1 williamc 1.1 #!/usr/local/bin/perl5
2     #
3     # Parse the site file specified by the first argument 1 and produce a
4     # makefile specified by argument 2
5     # version defaults by argument 3
6    
7     open (OUT, ">$ARGV[1]" );
8     # group stuff - prototypeonly - hardcoded in for now
9     #
10     print OUT<<ENDTEXT;
11     ifdef GROUP_G3
12     cmsim=true
13 williamc 1.3 geant=true
14 williamc 1.1 endif
15     ENDTEXT
16    
17 williamc 1.3 open (requires, "<$ARGV[0]_reqs" );
18     while( <requires> ) {
19     print OUT $_;
20     }
21     close requirements;
22    
23 williamc 1.1 # project defualts
24    
25     open (defaultsfile, "<$ARGV[2]" ) || die "Unable to open file $ARGV[2] $!";
26     while( <defaultsfile> ) {
27     chomp;
28     next if /^#/;
29     next if /^\s*$/;
30     ($product, $version )=split /:/;
31 williamc 1.3 $product=~tr[A-Z][a-z];
32 williamc 1.1 print OUT<<ENDTEXT;
33     ifdef $product
34     ${product}_V_$version=true
35     endif
36     ENDTEXT
37     }
38     close defaultsfile;
39    
40     open (file, "<$ARGV[0]" ) || die "Unable to open file $ARGV[0] $!";
41     while( <file> ) {
42     chomp;
43     next if /^#/;
44     next if /^\s*$/;
45     ($product, $version, $type, $variable, $value, @junk)=split /:/;
46     next if ( $variable=~/\&/ );
47 williamc 1.3 $product=~tr[A-Z][a-z];
48 williamc 1.1 if ( ! $version=="" ) {
49     $product=$product."_V_".$version;
50     }
51     print OUT<<ENDTEXT;
52     ifdef $product
53     $variable += $value
54     endif
55     ENDTEXT
56     }
57     close file;
58    
59    
60     # Prototype only
61     print OUT 'INCLUDEPATH+=$(addprefix -I,$(INCLUDE))'."\n";
62 williamc 1.2 print OUT 'LDFLAGS+=$(addprefix -L,$(LIBDIR))'."\n";
63 williamc 1.1 print OUT 'CPPFLAGS+=$(addprefix -D,$(CPPDEFINES))'."\n";
64 williamc 1.2 print OUT 'LDLIBS+=$(addprefix -l,$(lib))'."\n";
65     print OUT 'LDLIBS+=$(addprefix -l,$(REQUIRES))'."\n";
66 williamc 1.1
67     close OUT;