Subversion Repositories DevTools

Rev

Rev 271 | Rev 369 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 271 Rev 275
Line 347... Line 347...
347
    #   Process all the constituent makefile data and build up a huge data structure
347
    #   Process all the constituent makefile data and build up a huge data structure
348
    #   Order of reading isn't important. It will be sorted out later
348
    #   Order of reading isn't important. It will be sorted out later
349
    #
349
    #
350
    foreach my $dir ( keys(%cf_filelist) )
350
    foreach my $dir ( keys(%cf_filelist) )
351
    {
351
    {
-
 
352
        my $cfg_file = "$::ScmRoot/$::ScmInterface/$cf_filelist{$dir}";
352
        $self->{IDX}{$dir} = JatsMakeConfigDataReader::New( $cf_filelist{$dir} );
353
        $self->{IDX}{$dir} = JatsMakeConfigDataReader::New( $cfg_file );
353
    }
354
    }
354
 
355
 
355
#    DebugDumpData ("all", \$self );
356
#    DebugDumpData ("all", \$self );
356
    return bless $self, __PACKAGE__;
357
    return bless $self, __PACKAGE__;
357
}
358
}
Line 421... Line 422...
421
################################################################################
422
################################################################################
422
#   Package to contain makefile data reader operations
423
#   Package to contain makefile data reader operations
423
#
424
#
424
package JatsMakeConfigDataReader;
425
package JatsMakeConfigDataReader;
425
use JatsError;
426
use JatsError;
-
 
427
 
426
#
428
#
427
#   Global data
429
#   Global data
428
#
430
#
429
our %cf_info;                       # Makefile_x.cfg data
431
our %cf_info;                       # Makefile_x.cfg data
430
our %cf_info2;
432
our %cf_info2;
431
 
433
 
432
#-------------------------------------------------------------------------------
434
#-------------------------------------------------------------------------------
433
# Function        : New
435
# Function        : New
434
#
436
#
435
# Description     : Create an object to conatin the Makefile Data
437
# Description     : Create an object to contain the Makefile Data
436
#
438
#
437
# Inputs          : Name of the config file to read
439
# Inputs          : Name of the config file to read
438
#
440
#
439
# Returns         : Ref
441
# Returns         : Ref
440
#
442
#
Line 450... Line 452...
450
            INFO            => {},      # Basic data
452
            INFO            => {},      # Basic data
451
            FULL            => {},      # Full data
453
            FULL            => {},      # Full data
452
            CFG             => {},      # Config files used
454
            CFG             => {},      # Config files used
453
        };
455
        };
454
 
456
 
455
    $cfg_file = "$::ScmRoot/$::ScmInterface/$cfg_file";
-
 
456
    Error ("Makefile index entry missing: $cfg_file. Rebuild required")
457
    Error ("Makefile index entry missing: $cfg_file. Rebuild required")
457
        unless -f $cfg_file;
458
        unless -f $cfg_file;
458
 
459
 
459
    %cf_info = ();
460
    %cf_info = ();
460
    %cf_info2 = ();
461
    %cf_info2 = ();
Line 541... Line 542...
541
 
542
 
542
    return undef unless ( exists $self->{INFO}{$item} );
543
    return undef unless ( exists $self->{INFO}{$item} );
543
    return $self->{INFO}{$item};
544
    return $self->{INFO}{$item};
544
}
545
}
545
 
546
 
-
 
547
################################################################################
-
 
548
################################################################################
-
 
549
#   Package to contain makefile data reader operations
-
 
550
#   Simple single target reader for use at runtime
-
 
551
#
-
 
552
#
-
 
553
package JatsMakeConfigLoader;
-
 
554
use JatsError;
-
 
555
use JatsEnv;
-
 
556
 
-
 
557
#-------------------------------------------------------------------------------
-
 
558
# Function        : Load
-
 
559
#
-
 
560
# Description     : Load Makefile data
-
 
561
#                   Uses EnvVars setup by the build system to load the
-
 
562
#                   makefile data for the current platform
-
 
563
#
-
 
564
#                   Used by some utilities that need to access definitions
-
 
565
#                   and information available after the makefile has been
-
 
566
#                   parsed.
-
 
567
#
-
 
568
# Inputs          : None
-
 
569
#
-
 
570
# Returns         : Ref to a class to allow manipulation of the data
-
 
571
#
-
 
572
sub Load
-
 
573
{
-
 
574
    #
-
 
575
    #   These MUST be in the environment
-
 
576
    #
-
 
577
    EnvImport ('GBE_MAKE_TYPE');
-
 
578
    EnvImport ('GBE_MAKE_TARGET');
-
 
579
    EnvImport ('GBE_MAKE_CFG');
-
 
580
 
-
 
581
    my $data = JatsMakeConfigDataReader::New( $::GBE_MAKE_CFG );
-
 
582
 
-
 
583
    #
-
 
584
    #   Delete data for platforms other than the current one
-
 
585
    #   Not essentail, but it will save memory and it will
-
 
586
    #   make the data structure easier to debug
-
 
587
    #
-
 
588
    $data->{FULL} = $data->{FULL}{$::GBE_MAKE_TARGET};
-
 
589
 
-
 
590
    #
-
 
591
    #   Clean up a few items
-
 
592
    #   A few items are a hash of items keys on platform name
-
 
593
    #   Remove the extra level of indirection to simplify access
-
 
594
    #
-
 
595
    foreach  ( qw (%ScmBuildPkgRules
-
 
596
                   %BUILDINFO
-
 
597
                   %BUILDPLATFORM_PARTS
-
 
598
                   %ScmBuildProducts )  )
-
 
599
    {
-
 
600
        $data->{FULL}{$_} = $data->{FULL}{$_}{$::GBE_MAKE_TARGET};
-
 
601
    }
-
 
602
 
-
 
603
    #
-
 
604
    #   Add a little bit more data
-
 
605
    #
-
 
606
    $data->{'PLATFORM'} = $::GBE_MAKE_TARGET;
-
 
607
    $data->{'TYPE'} = $::GBE_MAKE_TYPE;
-
 
608
 
-
 
609
    #
-
 
610
    #   Bless myself
-
 
611
    #
-
 
612
    return bless $data, __PACKAGE__;
-
 
613
}
-
 
614
 
-
 
615
 
-
 
616
#-------------------------------------------------------------------------------
-
 
617
# Function        : GetData
-
 
618
#
-
 
619
# Description     : Return a ref to the complete raw data
-
 
620
#
-
 
621
# Returns         :
-
 
622
#
-
 
623
sub GetData
-
 
624
{
-
 
625
    my( $self ) = @_;
-
 
626
    return $self->{FULL};
-
 
627
}
-
 
628
 
-
 
629
sub GetInfo
-
 
630
{
-
 
631
    my( $self ) = @_;
-
 
632
    return $self->{INFO};
-
 
633
}
-
 
634
 
-
 
635
#-------------------------------------------------------------------------------
-
 
636
# Function        : GetDataItem
-
 
637
#
-
 
638
# Description     : Return a data item
-
 
639
#
-
 
640
# Inputs          : self            - Object data
-
 
641
#                   item            - Item within the platform data
-
 
642
#
-
 
643
# Returns         : 
-
 
644
#
-
 
645
 
-
 
646
sub GetDataItem
-
 
647
{
-
 
648
    my( $self, $item ) = @_;
-
 
649
 
-
 
650
 
-
 
651
    return undef unless ( exists $self->{FULL}{$item} );
-
 
652
 
-
 
653
    return $self->{FULL}{$item};
-
 
654
}
-
 
655
 
-
 
656
sub GetInfoItem
-
 
657
{
-
 
658
    my( $self, $item ) = @_;
-
 
659
 
-
 
660
    return undef unless ( exists $self->{INFO}{$item} );
-
 
661
    return $self->{INFO}{$item};
-
 
662
}
-
 
663
 
-
 
664
 
546
1;
665
1;
547
 
666
 
548
 
667