ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildFile.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildFile.pm (file contents):
Revision 1.21 by williamc, Tue Apr 13 17:30:19 1999 UTC vs.
Revision 1.21.2.7 by williamc, Tue Sep 7 10:09:39 1999 UTC

# Line 37 | Line 37 | sub ParseBuildFile {
37                  'ClassPath_StartTag' => \&setBlockClassPath,
38                  'lib' => 'none',
39                  'lib_StartTag' => \&lib_start,
40 <                'lib_EndTag' => 'none'
40 >                'lib_EndTag' => 'none',
41 >                'ignore' => 'none',
42 >                'ignore_EndTag' => \&ignoretag_end,
43 >                'ignore_StartTag' => \&ignoretag,
44 >                'Architecture_StartTag' => \&Arch_Start,
45 >                'Architecture_EndTag' => \&Arch_End,
46 >                'Architecture' => \&OutToMakefile,
47 >                'LibType_StartTag' => \&LibType_Start,
48 >                'LibType_EndTag' => 'none',
49 >                'LibType' => 'none'
50          };
51          use Utilities::Switcher;
52          $switch=Switcher->new($SupportedTags, $fullfilename);
# Line 103 | Line 112 | sub Class_StartTag {
112          my @vars=@_;
113          
114          $hashref=$switch->SetupValueHash(\@vars);
115 +        if ( $Arch ) {
116          if ( defined $$hashref{'type'} ) {
117                  $ClassName=$$hashref{'type'};
118          }
119 +        }
120   }
121  
122   sub ClassPath_StartTag {
# Line 114 | Line 125 | sub ClassPath_StartTag {
125          my $hashref;
126  
127          $hashref=$switch->SetupValueHash(\@vars);
128 +        if ( $Arch ) {
129          if ( defined $$hashref{'defaultpath'} ) {
130          }
131 +        }
132   }
133  
134   sub Bin_start {
# Line 130 | Line 143 | sub Bin_start {
143          
144          $hashref=$switch->SetupValueHash(\@vars);
145          $switch->checkparam($hashref, $name, 'file');
146 +        if ( $Arch ) {
147          if ( ! defined $$hashref{name} ) {
148                  ($$hashref{name}=$$hashref{file})=~s/\..*//;
149          }
# Line 140 | Line 154 | sub Bin_start {
154          ($objectname=$$hashref{file})=~s/\..*/\.o/;
155          ($objectname_d=$$hashref{file})=~s/\..*/_d\.o/;
156          ($objectname_Insure=$$hashref{file})=~s/\..*/_Insure\.o/;
157 <        print GNUmakefile "bin:$$hashref{name}\n";
157 >        print GNUmakefile "bin:$$hashref{name}_o\n";
158          print GNUmakefile "bin_debug:$$hashref{name}_d\n";
159          print GNUmakefile "bin_insure:$$hashref{name}_Insure\n";
160 <        print GNUmakefile ".INTERMEDIATE::$$hashref{name}_d.exe\n";
161 <        print GNUmakefile ".INTERMEDIATE::$$hashref{name}_Insure.exe\n";
160 > #       print GNUmakefile ".INTERMEDIATE::$$hashref{name}_d.exe\n";
161 > #       print GNUmakefile ".INTERMEDIATE::$$hashref{name}_Insure.exe\n";
162          print GNUmakefile ".INTERMEDIATE::$$hashref{name}.exe\n";
163          print GNUmakefile "$$hashref{name}_Insure:.psrc\n";
164          print GNUmakefile "$$hashref{name}_d.exe:$objectname_d\n";
# Line 162 | Line 176 | sub Bin_start {
176   print GNUmakefile <<ENDTEXT;
177   $$hashref{name}_d.exe:\$(libslocal_d)
178   $$hashref{name}.exe:\$(libslocal)
179 + ifdef MCCABE_DATA_DIR
180 + $$hashref{name}_mccabe.exe: \$(libslocal_d) $(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp
181 + endif
182   $$hashref{name}_Insure.exe:\$(libslocal_I)
183   $$hashref{name}_d:$$hashref{name}_d.exe
184 <        \@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
184 >        \@cp $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
185   $$hashref{name}_Insure:$$hashref{name}_Insure.exe
186 <        \@mv $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure
186 >        \@cp $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure
187   $$hashref{name}:$$hashref{name}_d.exe
188          \@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
189 < $$hashref{name}_o:$$hashref{name}_o.exe
189 > $$hashref{name}_o:$$hashref{name}.exe
190          \@mv $$hashref{name}.exe \$(binarystore)/$$hashref{name}
191 < binfiles+=$filename
191 > binfiles+=$$hashref{file}
192   bintargets+=$$hashref{name} $$hashref{name}_d $$hashref{name}_Insure
193   ENDTEXT
194 +        }
195   }
196  
197   sub External_StartTag {
# Line 200 | Line 218 | sub Group_start {
218          
219          $hashref=$switch->SetupValueHash(\@vars);
220          $switch->checkparam($hashref, $name, 'name');
221 +        if ( $Arch ) {
222          print GNUmakefile "GROUP_".$$hashref{'name'};
223          if ( defined $$hashref{'version'} ) {
224                  print GNUmakefile "_V_".$$hashref{'version'};
225          }
226          print GNUmakefile "=true\n";
227 +        }
228   }      
229  
230   sub External {
# Line 231 | Line 251 | sub Use_start {
251          
252          $hashref=$switch->SetupValueHash(\@vars);
253          $switch->checkparam($hashref, $name, "name");
254 +        if ( $Arch ) {
255          $filename=SCRAMUtils::checkfile(
256                  "$ENV{INTsrc}/$$hashref{name}/BuildFile");
257          if ( $filename ne "" ) {
258            ParseBuildFile_Export( $filename );
259          }
260 +        }
261   }
262  
263   sub CheckBuildFile {
# Line 268 | Line 290 | sub AssociateGroup {
290          }
291   }
292  
293 + sub ignoretag {
294 +        my $name=shift;
295 +        my @vars=@_;
296 +        
297 +        $Arch=0;
298 +        push @ARCHBLOCK, $Arch;
299 + }
300 +
301 + sub ignoretag_end {
302 +        my $name=shift;
303 +        my @vars=@_;
304 +        
305 +        pop @ARCHBLOCK;
306 +        $Arch=$ARCHBLOCK[$#ARCHBLOCK];
307 + }
308 +
309 + sub Arch_Start {
310 +        my $name=shift;
311 +        my @vars=@_;
312 +        my $hashref;
313 +
314 +        $hashref=$toolswitch->SetupValueHash( \@vars );
315 +        $toolswitch->checkparam($hashref, $name, 'name');
316 +        #( ($$hashref{name}=~/$ENV{SCRAM_ARCH}/) )?$Arch=1:$Arch=0;
317 +        ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($Arch=1) : ($Arch=0);
318 +        push @ARCHBLOCK, $Arch;
319 + }
320 + sub Arch_End {
321 +        my $name=shift;
322 +        my @vars=@_;
323 +
324 +        pop @ARCHBLOCK;
325 +        $Arch=$ARCHBLOCK[$#ARCHBLOCK];
326 + }
327 +
328   # Split up the Class Block String into a useable array
329   sub _CutBlock {
330      my $string= shift @_;
# Line 333 | Line 390 | sub lib_start {
390             print GNUmakefile "lib+=$$hashref{name}\n";
391          }
392   }
393 +
394 + #
395 + # libtype specification
396 + #
397 + sub LibType_Start {
398 +        my $name=shift;
399 +        my @vars=@_;
400 +        my $hashref;
401 +
402 +        $hashref=$switch->SetupValueHash( \@vars );
403 +        $switch->checkparam($hashref, $name, 'type');
404 +        
405 +        print GNUmakefile "# Specify Library Type\n";
406 +        print GNUmakefile "DefaultLibsOff=yes\n";
407 +        if ( $$hashref{'type'}=~/^archive/i ) {
408 +          print GNUmakefile "LibArchive=true\n";
409 +        }
410 +        elsif ($$hashref{'type'}=~/debugarchive/i ) {
411 +          print GNUmakefile "LibDebugArchive=true\n";
412 +        }
413 +        elsif ($$hashref{'type'}=~/shared/i ) {
414 +          print GNUmakefile 'LibShared=true'."\n";
415 +        }
416 +        elsif ($$hashref{'type'}=~/debugshared/i ) {
417 +          print GNUmakefile "LibDebugShared=true\n";
418 +        }
419 +        print GNUmakefile "\n";
420 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines