Subversion Repositories DevTools

Rev

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

Rev 7299 Rev 7300
Line 1... Line 1...
1
##############################################################################
1
##############################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
2
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
3
#
3
#
4
# Module name   : makelib.pl2
4
# Module name   : makelib.pl2
5
# Module type   : Makefile system
5
# Module type   : Makefile system
6
#
6
#
7
# Description:
7
# Description:
Line 723... Line 723...
723
    my $local_base_dir = "$ScmRoot/gbe/DIRECTIVES";
723
    my $local_base_dir = "$ScmRoot/gbe/DIRECTIVES";
724
    if ( -d $local_base_dir )
724
    if ( -d $local_base_dir )
725
    {
725
    {
726
        foreach my $file  ( glob ("$local_base_dir/*.pm") )
726
        foreach my $file  ( glob ("$local_base_dir/*.pm") )
727
        {
727
        {
728
DebugDumpData("Include: $file",);
-
 
729
            push( @ScmDepends, "$file" );
728
            push( @ScmDepends, "$file" );
730
            require $file;
729
            require $file;
731
        }
730
        }
732
    }
731
    }
733
 
732
 
Line 1787... Line 1786...
1787
        push( @NODEPDIRS, $_ )
1786
        push( @NODEPDIRS, $_ )
1788
            if ($nodepend);
1787
            if ($nodepend);
1789
    }
1788
    }
1790
}
1789
}
1791
 
1790
 
-
 
1791
#-------------------------------------------------------------------------------
-
 
1792
# Function        : ExtendIncDir 
-
 
1793
#
-
 
1794
# Description     : Allow the directory search paths to be extended into sub
-
 
1795
#                   directories.
-
 
1796
#                   
-
 
1797
#                   Limit use, but ...
-
 
1798
#
-
 
1799
# Inputs          : $platform       - Active platforms
-
 
1800
#                   ...             - Path extensions
-
 
1801
#
-
 
1802
# Returns         : 
-
 
1803
#
-
 
1804
my  %ExtendIncDirSeen;
-
 
1805
sub ExtendIncDir
-
 
1806
{
-
 
1807
    my( $platforms, @paths ) = @_;
-
 
1808
    Debug2( "ExtendIncDir($platforms, @paths)" );
-
 
1809
    return if ( ! ActivePlatform($platforms) );
-
 
1810
    Error ('ExtendIncDir. No extensions listed') unless @paths;
-
 
1811
    #
-
 
1812
    #   Ensure the user only extends the paths once.
-
 
1813
    #   Could silently discard excess - better to force the user to get it right
-
 
1814
    #
-
 
1815
    foreach my $path ( @paths) {
-
 
1816
        ReportError ('ExtendIncDir. Multiple defintions for: ' . $path) if exists $ExtendIncDirSeen{$path}; 
-
 
1817
        $ExtendIncDirSeen{$path} = 0;
-
 
1818
    }
-
 
1819
    ErrorDoExit();
-
 
1820
 
-
 
1821
    #
-
 
1822
    #   Zip though all the packages and extend the search paths
-
 
1823
    #   Also gets those in the interface directory
-
 
1824
    #
-
 
1825
    for my $package (@{$::ScmBuildPkgRules{$ScmPlatform} })
-
 
1826
    {
-
 
1827
        #DebugDumpData("package", $package);
-
 
1828
        foreach my $path ( @paths)
-
 
1829
        {
-
 
1830
            if ( $package->{PINCDIRS})
-
 
1831
            {
-
 
1832
                my @output;
-
 
1833
                foreach my $pdir ( @{$package->{PINCDIRS}})
-
 
1834
                {
-
 
1835
                    my $tdir = catdir ($pdir, $path);
-
 
1836
                    my $adir = catdir ($package->{ROOT}, $tdir);
-
 
1837
                    if ( -d $adir) {
-
 
1838
                        Verbose("Extending $package->{DNAME} $package->{VERSION}: $tdir");
-
 
1839
                        push @output, $tdir;
-
 
1840
                        $ExtendIncDirSeen{$path}++;
-
 
1841
                    }
-
 
1842
                    push @output, $pdir;
-
 
1843
                }
-
 
1844
              @{$package->{PINCDIRS}} = @output;
-
 
1845
            }
-
 
1846
        }
-
 
1847
    }
-
 
1848
 
-
 
1849
    #
-
 
1850
    #   Report extensions that have not been used
-
 
1851
    #
-
 
1852
    foreach my $path ( @paths) {
-
 
1853
        ReportError ('ExtendIncDir. Search path not extendable: ' . $path) unless $ExtendIncDirSeen{$path}; 
-
 
1854
    }
-
 
1855
 
-
 
1856
    ErrorDoExit();
-
 
1857
}
-
 
1858
 
1792
 
1859
 
1793
sub AddProg
1860
sub AddProg
1794
{
1861
{
1795
    my( $platforms, @progs ) = @_;
1862
    my( $platforms, @progs ) = @_;
1796
 
1863
 
Line 2559... Line 2626...
2559
#                                                 be added to the list of recipe prerequisites
2626
#                                                 be added to the list of recipe prerequisites
2560
#                       --GeneratedDirectory(xxx)
2627
#                       --GeneratedDirectory(xxx)
2561
#                       --GeneratedCommonDirectory(xxx)
2628
#                       --GeneratedCommonDirectory(xxx)
2562
#                       --GeneratedObjectDirectory(xxx)
2629
#                       --GeneratedObjectDirectory(xxx)
2563
#                       --GeneratedProgDirectory(xxx)
2630
#                       --GeneratedProgDirectory(xxx)
2564
#                                               - xxx is a generated file, but is not placed
2631
#                                               - xxx is a generated file
2565
#                                                 on the command line. It is flagged as
2632
#                                                 The containing directory will be placed on the command line
2566
#                                                 a generated files
-
 
2567
#                       --PackageBase(xxx)      - xxx is a package. The keyword will be replaced
2633
#                       --PackageBase(xxx)      - xxx is a package. The keyword will be replaced
2568
#                                                 with the pathname to the package. If the package
2634
#                                                 with the pathname to the package. If the package
2569
#                                                 has been copied in the the interface directory
2635
#                                                 has been copied in the the interface directory
2570
#                                                 then the interface directory will be used.
2636
#                                                 then the interface directory will be used.
2571
#                       --PackageInfo(xxx,--opt)- xxx is a package. The keyword will be replaced
2637
#                       --PackageInfo(xxx,--opt)- xxx is a package. The keyword will be replaced
Line 8646... Line 8712...
8646
    ToolsetFiles::AddFile($Makefile);
8712
    ToolsetFiles::AddFile($Makefile);
8647
    open( MAKEFILE, '>', $Makefile ) || Error( "Cannot create $Makefile" );
8713
    open( MAKEFILE, '>', $Makefile ) || Error( "Cannot create $Makefile" );
8648
    ::MakefileHeader( *MAKEFILE,
8714
    ::MakefileHeader( *MAKEFILE,
8649
                      'Auto-generated Platform Dependent Makefile',
8715
                      'Auto-generated Platform Dependent Makefile',
8650
                      "$ScmMakelib (version $ScmVersion)",
8716
                      "$ScmMakelib (version $ScmVersion)",
8651
                      "# Copyright (c) VIX TECHNOLOGY (AUST) LTD",
8717
                      "# COPYRIGHT - VIX IP PTY LTD (\"VIX\"). ALL RIGHTS RESERVED.",
8652
                      '#',
8718
                      '#',
8653
                      "# Located in $::Cwd",
8719
                      "# Located in $::Cwd",
8654
                      "# Platform $::ScmPlatform",
8720
                      "# Platform $::ScmPlatform",
8655
                      '#' . ('-' x 79),
8721
                      '#' . ('-' x 79),
8656
                      );
8722
                      );
Line 8817... Line 8883...
8817
#
8883
#
8818
#
8884
#
8819
    MakeHeader ("Defines, flags and file sets");
8885
    MakeHeader ("Defines, flags and file sets");
8820
 
8886
 
8821
    # Flags
8887
    # Flags
8822
    foreach my $opt ( keys %ScmCompilerOpts )
8888
    foreach my $opt ( sort keys %ScmCompilerOpts )
8823
    {
8889
    {
8824
        MakeDefEntry ( $opt, "=", $ScmCompilerOpts{$opt} );
8890
        MakeDefEntry ( $opt, "=", $ScmCompilerOpts{$opt} );
8825
    }
8891
    }
8826
 
8892
 
8827
    MakeDefEntry( "CFLAGS",         "=", \@CFLAGS, \@CFLAGS_PROD, \@CFLAGS_DEBUG );
8893
    MakeDefEntry( "CFLAGS",         "=", \@CFLAGS, \@CFLAGS_PROD, \@CFLAGS_DEBUG );
Line 8892... Line 8958...
8892
    {
8958
    {
8893
    MakePrint( "export PERL5LIB\n" );
8959
    MakePrint( "export PERL5LIB\n" );
8894
    }
8960
    }
8895
 
8961
 
8896
#-------------------------------------------------------------------------------
8962
#-------------------------------------------------------------------------------
8897
#   Internal Helper Functions
-
 
8898
#   Creating INCLUDE and LIBRARY paths
-
 
8899
#
-
 
8900
 
-
 
8901
# Assist in creating a list paths
-
 
8902
#   $pList  - Reference to an array to which $data will be added
-
 
8903
#   $pSeen  - Hash Ref to track tags that have been seen
-
 
8904
#   $data   - Data item to add, if tag is defined, but not seen
-
 
8905
#   $tag    - Resolved name for item
-
 
8906
#
-
 
8907
    sub PushPath
-
 
8908
    {
-
 
8909
        my ($pList, $pSeen, $data, $tag) = @_;
-
 
8910
        if ( $tag )
-
 
8911
        {
-
 
8912
            unless ( exists $pSeen->{$tag} )
-
 
8913
            {
-
 
8914
                $pSeen->{$tag} = 1;
-
 
8915
                push @{$pList}, $data;
-
 
8916
            }
-
 
8917
        }
-
 
8918
    }
-
 
8919
 
-
 
8920
    #
-
 
8921
    # Search paths for include files and libraries
-
 
8922
    # Currently symbolic paths are created, but there is very little need for this
-
 
8923
    #
-
 
8924
    sub MakePaths
-
 
8925
    {
-
 
8926
        my( $root ) = @_;
-
 
8927
        my @pathlist;
-
 
8928
        my %seen;
-
 
8929
 
-
 
8930
        #
-
 
8931
        #   Interface and Local directories are now treated quite
-
 
8932
        #   diffently. The Local is under our control.
-
 
8933
        #
-
 
8934
        if ( $root =~ /INTERFACE/ ) {
-
 
8935
 
-
 
8936
            #   eg. SCA_WIN32   and SCA_WIN32       and SCA_SOLARIS
-
 
8937
            #       SCA             WIN32_i386          SPARC
-
 
8938
            #       WIN32           SCA                 SCA
-
 
8939
            #       .               WIN32               SOLARIS
-
 
8940
            #                       .                   .
-
 
8941
            #..
-
 
8942
 
-
 
8943
            #
-
 
8944
            #   For Interface Path List use the 'PARTS' as calculated within
-
 
8945
            #   the build file. Its good enough for everthing else in JATS
-
 
8946
            #
-
 
8947
            foreach ( @{$::BUILDINFO{$ScmPlatform}{PARTS}} ) {
-
 
8948
                PushPath( \@pathlist, \%seen, "$root/$_",   $_ );
-
 
8949
            }
-
 
8950
        }
-
 
8951
        else
-
 
8952
        {
-
 
8953
            #
-
 
8954
            #   Local directory
-
 
8955
            #   The user can (should) only install stuff into a few known
-
 
8956
            #   locations.
-
 
8957
            #
-
 
8958
            foreach ( $ScmPlatform, $ScmProduct, $ScmTarget ) {
-
 
8959
                PushPath( \@pathlist, \%seen, "$root/$_",   $_ );
-
 
8960
            }
-
 
8961
        }
-
 
8962
 
-
 
8963
        #
-
 
8964
        #   Add OS Common Directory
-
 
8965
        ### May need more testing before being added
-
 
8966
        #
-
 
8967
        #if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) )
-
 
8968
        #{
-
 
8969
        #    my $os_common = $::BUILDINFO{$ScmPlatform}{OS_COMMON};
-
 
8970
        #    PushPath( \@pathlist, \%seen, "$root/$os_common", $os_common );
-
 
8971
        #}
-
 
8972
 
-
 
8973
        #
-
 
8974
        #   Add the root directory too
-
 
8975
        #
-
 
8976
        push @pathlist, "$root";
-
 
8977
        return \@pathlist;
-
 
8978
    }
-
 
8979
    
-
 
8980
 
-
 
8981
#-------------------------------------------------------------------------------
-
 
8982
#   
8963
#   
8983
#
8964
#
8984
    MakeHeader ("Include Search Paths",
8965
    MakeHeader ("Include Search Paths",
8985
                "Package Include Paths for header files and libraries" );
8966
                "Package Include Paths for header files and libraries" );
8986
 
8967
 
8987
    MakeDefEntry( 'PINCDIRS', '=', '# includes');
8968
    MakeDefEntry( 'PINCDIRS'  , '=', '# includes');
-
 
8969
    MakeDefEntry( 'PINCDIRS_INTERFACE', '=', '# Interface includes');
-
 
8970
    MakeDefEntry( 'PINCDIRS_LOCAL', '=', '# Local includes');
8988
    MakeDefEntry( 'PLIBDIRS', '=', '# libraries');
8971
    MakeDefEntry( 'PLIBDIRS'  , '=', '# libraries');
-
 
8972
    MakeDefEntry( 'PLIBDIRS_INTERFACE', '=', '# Interface libraries');
-
 
8973
    MakeDefEntry( 'PLIBDIRS_LOCAL', '=', '# Local libraries');
8989
 
8974
 
8990
    for my $package (@{$::ScmBuildPkgRules{$ScmPlatform} })
8975
    for my $package (@{$::ScmBuildPkgRules{$ScmPlatform} })
8991
    {
8976
    {
8992
        #
8977
        #
8993
        #   Skip the pseudo package that encapsulates the interface
8978
        #   Skip the pseudo package that encapsulates the interface
Line 8996... Line 8981...
8996
        #
8981
        #
8997
        #   Just comment out the lines so that the data is visible
8982
        #   Just comment out the lines so that the data is visible
8998
        #   Its a hint to make use of the data
8983
        #   Its a hint to make use of the data
8999
        #
8984
        #
9000
        my $prefix = '';
8985
        my $prefix = '';
9001
        $prefix = '# ' if ( $package->{'TYPE'} eq 'interface' );
8986
        my $suffix = '';
9002
        $prefix = '# ' if ( $package->{'TYPE'} eq 'build' );
8987
        $prefix = '# ' if ( $package->{'TYPE'} eq 'build' );
9003
 
8988
 
-
 
8989
        #
-
 
8990
        #   The interface directory is a little bit different
9004
 
8991
        #
-
 
8992
        my ($name,$base);
-
 
8993
        if ( $package->{'TYPE'} eq 'interface' ) {
-
 
8994
            $base = '$(INTERFACEDIR)';
-
 
8995
            $name = 'Interface Directory';
-
 
8996
            $suffix = '_INTERFACE';
-
 
8997
        } else {
9005
        my $name = $package->{'NAME'} . '/' . $package->{'VERSION'};
8998
            $name = $package->{'NAME'} . '/' . $package->{'VERSION'};
9006
        my $base = $package->{'ROOT'};
8999
            $base = $package->{'ROOT'};
-
 
9000
        }
9007
 
9001
 
9008
        my @doc;
9002
        my @doc;
9009
        push (@doc, "From: $base");
9003
        push (@doc, "From: $base");
9010
        push (@doc, 'BuildPkgArchive via Interface' )if $package->{'TYPE'} eq 'build' ;
9004
        push (@doc, 'BuildPkgArchive via Interface' )if $package->{'TYPE'} eq 'build' ;
9011
        push (@doc, 'Is Interface' ) if $package->{'TYPE'} eq 'interface' ;
-
 
9012
 
9005
 
9013
        MakeHeader ("Source: $name", @doc);
9006
        MakeHeader ("Source: $name", @doc);
9014
 
9007
 
9015
        #
9008
        #
9016
        #   List include and library directories
9009
        #   List include and library directories
9017
        #   Note: Need the True Path for windows.
9010
        #   Note: Need the True Path for windows.
9018
        #       Some makefile functions (wildcard) only work as expected
9011
        #       Some makefile functions (wildcard) only work as expected
9019
        #       if the case of the pathname is correct. Really only a problem
9012
        #       if the case of the pathname is correct. Really only a problem
9020
        #       with badly formed legecy packages where the Windows user
9013
        #       with badly formed legacy packages where the Windows user
9021
        #       guessed at the package format.
9014
        #       guessed at the package format.
9022
        #
9015
        #
9023
        #       The conversion to a TruePath is done when ScmBuildPkgRules
9016
        #       The conversion to a TruePath is done when ScmBuildPkgRules
9024
        #       is created. Create one, use many time.
9017
        #       is created. Create once, use many time.
9025
        #
-
 
9026
        #
9018
        #
9027
        for my $type (qw (PINCDIRS PLIBDIRS) )
9019
        for my $type (qw (PINCDIRS PLIBDIRS) ) {
9028
        {
-
 
9029
            for my $path ( @{$package->{$type}} )
9020
            for my $path ( @{$package->{$type}} ) {
9030
            {
-
 
9031
                MakeDefEntry ( "$prefix$type", "+=", $base . $path);
9021
                MakeDefEntry ( "$prefix$type$suffix", "+=", $base . $path);
9032
            }
9022
            }
9033
        }
9023
        }
9034
    }
9024
    }
9035
 
9025
 
-
 
9026
    #
-
 
9027
    #   Local Paths
-
 
9028
    #   These are a little bit special
-
 
9029
    #
-
 
9030
    MakeHeader ('Source: Local',  'From: Package Local');
-
 
9031
 
-
 
9032
    sub MakeLocalPaths 
-
 
9033
    {
-
 
9034
        my ($name, $root, $addRoot) = @_;
-
 
9035
        my @pathlist;
-
 
9036
 
-
 
9037
        foreach my $tag ( $ScmPlatform, $ScmProduct, $ScmTarget ) {
-
 
9038
            UniquePush( \@pathlist, "$root/$tag" ) if ( $tag );
-
 
9039
        }
-
 
9040
 
-
 
9041
        #   Add the root directory too
-
 
9042
        UniquePush( \@pathlist, $root) if $addRoot;
-
 
9043
 
-
 
9044
        MakeDefEntry ( $name , "+=", \@pathlist);
-
 
9045
    }
-
 
9046
 
-
 
9047
    MakeLocalPaths ( 'PINCDIRS_LOCAL', '$(INCDIR_LOCAL)', 1 );
-
 
9048
    MakeLocalPaths ( 'PLIBDIRS_LOCAL', '$(LIBDIR_LOCAL)', 0 );
-
 
9049
 
-
 
9050
 
9036
#-------------------------------------------------------------------------------
9051
#-------------------------------------------------------------------------------
9037
#   
9052
#   
9038
#
9053
#
9039
    MakeHeader ("Include Search Paths",
9054
    MakeHeader ("Include Search Paths",
9040
                "Local Include Paths",
9055
                "Local Include Paths",
Line 9054... Line 9069...
9054
    #       BuildPkgArchive
9069
    #       BuildPkgArchive
9055
    #       LinkPkgArchive
9070
    #       LinkPkgArchive
9056
    #   user-global
9071
    #   user-global
9057
    #
9072
    #
9058
 
9073
 
9059
    MakeDefEntry ( "\nLINCDIRS",    "= ", \@L_INCDIRS );     # .. Local
9074
    MakeDefEntry ( "\nLINCDIRS",    "= ", \@L_INCDIRS );                    # .. Local
9060
    MakeDefEntry ( "LINCDIRS",      "+=", MakePaths( '$(INCDIR_LOCAL)' ));     # .. Sandbox interface
9075
    MakeDefEntry ( "LINCDIRS",      "+=", '$(PINCDIRS_LOCAL)');             # .. Sandbox local
9061
    MakeDefEntry ( "LINCDIRS",      "+=", MakePaths( '$(INCDIR_INTERFACE)' )); # .. Sandbox interface
9076
    MakeDefEntry ( "LINCDIRS",      "+=", '$(PINCDIRS_INTERFACE)');         # .. Sandbox interface
9062
    MakeDefEntry ( "LINCDIRS",      "+=", \@G_INCDIRS );    # .. Global
9077
    MakeDefEntry ( "LINCDIRS",      "+=", \@G_INCDIRS );                    # .. Global
9063
 
9078
 
9064
    MakeDefEntry ( "INCDIRS",  "= ", '$(LINCDIRS)' );               # Local
9079
    MakeDefEntry ( "INCDIRS",  "= ", '$(LINCDIRS)' );                       # Local
9065
    MakeDefEntry ( "INCDIRS",  "+=", '$(PINCDIRS)' );               # Package
9080
    MakeDefEntry ( "INCDIRS",  "+=", '$(PINCDIRS)' );                       # Package
9066
    MakeDefEntry ( "LINCDIRS", "+=", \@S_INCDIRS );                 # System
9081
    MakeDefEntry ( "LINCDIRS", "+=", \@S_INCDIRS );                         # System
9067
 
9082
 
9068
    # Source search path
9083
    # Source search path
9069
 
9084
 
9070
    MakeDefEntry( "\nNODEPDIRS",        "=", \@NODEPDIRS );
9085
    MakeDefEntry( "\nNODEPDIRS",        "=", \@NODEPDIRS );
9071
 
9086
 
9072
    MakeDefEntry( "\nSRCDIRS","= "  , [ @L_SRCDIRS, @G_SRCDIRS ] ); # Local
9087
    MakeDefEntry( "\nSRCDIRS","= "  , [ @L_SRCDIRS, @G_SRCDIRS ] );         # Local
9073
    MakeDefEntry ( "SRCDIRS", "+=" , '$(PINCDIRS)' );               # Package
9088
    MakeDefEntry ( "SRCDIRS", "+=" , '$(PINCDIRS)' );                       # Package
9074
    MakeDefEntry ( "SRCDIRS", "+=" , \@S_INCDIRS );                 # System
9089
    MakeDefEntry ( "SRCDIRS", "+=" , \@S_INCDIRS );                         # System
9075
 
9090
 
9076
    # Library search path
9091
    # Library search path
9077
    #
9092
    #
9078
    #   user-local
9093
    #   user-local
9079
    #   local
9094
    #   local
9080
    #   interface
9095
    #   interface
9081
    #       BuildPkgArchive
9096
    #       BuildPkgArchive
9082
    #       LinkPkgArchive
9097
    #       LinkPkgArchive
9083
    #   user-global
9098
    #   user-global
-
 
9099
    #   
-
 
9100
    #   Kludge Note:
-
 
9101
    #       The LIBDIRS path needs an element with a directory seperator in it
-
 
9102
    #       Needed by (broken) cmdfile o determine the file seperator to use
-
 
9103
    #       
9084
 
9104
 
9085
    MakeDefEntry( "\nLIBDIRS",  "= ", '$(LIBDIR)' );                    # User Local
9105
    MakeDefEntry( "\nLIBDIRS",  "= ", '$(LIBDIR)' );                    # User Local
9086
    MakeDefEntry( "LIBDIRS",    "+=", \@L_LIBDIRS );                    # Local
9106
    MakeDefEntry( "LIBDIRS",    "+=", \@L_LIBDIRS );                    # Local
-
 
9107
    MakeDefEntry( "LIBDIRS",    "+=", '$(PLIBDIRS_LOCAL)' );            # Sandbox/local
9087
    MakeDefEntry( "LIBDIRS",    "+=", MakePaths( '$(LIBDIR_LOCAL)' ));  # Sandbox/interface
9108
    MakeDefEntry( "LIBDIRS",    "+=", '$(PLIBDIRS_INTERFACE)' );        # Sandbox/interface
9088
    MakeDefEntry( "LIBDIRS",    "+=", MakePaths( '$(LIBDIR_INTERFACE)' ));
9109
    MakeDefEntry( "LIBDIRS",    "+=", '$(LIBDIR_INTERFACE)' );          # Kludge. See note above
9089
    MakeDefEntry( "LIBDIRS",    "+=", \@G_LIBDIRS );                    # Global
9110
    MakeDefEntry( "LIBDIRS",    "+=", \@G_LIBDIRS );                    # Global
9090
    MakeDefEntry( "LIBDIRS",    "+=", '$(PLIBDIRS)' );                  # Package
9111
    MakeDefEntry( "LIBDIRS",    "+=", '$(PLIBDIRS)' );                  # Package
9091
    MakeDefEntry( "LIBDIRS",    "+=", \@S_LIBDIRS );                    # System
9112
    MakeDefEntry( "LIBDIRS",    "+=", \@S_LIBDIRS );                    # System
9092
 
9113
 
9093
#-------------------------------------------------------------------------------
9114
#-------------------------------------------------------------------------------
Line 9097... Line 9118...
9097
#   Deletion is done AFTER the toolset functions have been invoked to create the
9118
#   Deletion is done AFTER the toolset functions have been invoked to create the
9098
#   build artifacts so that the toolsets can create directories too
9119
#   build artifacts so that the toolsets can create directories too
9099
 
9120
 
9100
    MakeHeader ("Subdir creation");
9121
    MakeHeader ("Subdir creation");
9101
    CreateMkdirRules();
9122
    CreateMkdirRules();
9102
    MkdirRule( '$(OBJDIR)', 'OBJDIR', '--Extra=depend,depend.err' );  # Object build directory
9123
    MkdirRule( '$(OBJDIR)', 'OBJDIR', '--Extra=depend,depend.err' );    # Object build directory
9103
    MkdirRule( '$(OBJDIR)/'.$_ ) foreach (@SHLIBS);                     # Shared library build directory
9124
    MkdirRule( '$(OBJDIR)/'.$_ ) foreach (@SHLIBS);                     # Shared library build directory
9104
    MkdirRule( '$(LIBDIR)', 'LIBDIR' );                                 # Library directory
9125
    MkdirRule( '$(LIBDIR)', 'LIBDIR' );                                 # Library directory
9105
    MkdirRule( '$(BINDIR)', 'BINDIR' );                                 # Binary directory
9126
    MkdirRule( '$(BINDIR)', 'BINDIR' );                                 # Binary directory
9106
 
9127
 
9107
    #
9128
    #
Line 9199... Line 9220...
9199
    {
9220
    {
9200
        my $tname = "\$(BINDIR)/" . StripDir( $i );
9221
        my $tname = "\$(BINDIR)/" . StripDir( $i );
9201
 
9222
 
9202
 
9223
 
9203
        MakePrint( "$i:\t\tmakefile.pl\n" .
9224
        MakePrint( "$i:\t\tmakefile.pl\n" .
9204
            "\t\$(XX_PRE)if [ ! -f \"$i\" ]; then echo Script [$i] not found; exit 2; fi\n\n" );
9225
            "\t\$(XX_PRE)if [ ! -f \"$i\" ]; then echo 'Script [$i] not found'; exit 2; fi\n\n" );
9205
 
9226
 
9206
        #
9227
        #
9207
        #   Create a rule to copy the script into the BIN directory
9228
        #   Create a rule to copy the script into the BIN directory
9208
        #   Mark the script as executable - It can't hurt and its there
9229
        #   Mark the script as executable - It can't hurt and its there
9209
        #   to be run as part of a test.
9230
        #   to be run as part of a test.
Line 9614... Line 9635...
9614
        foreach (  @SHLIB_TARGETS )
9635
        foreach (  @SHLIB_TARGETS )
9615
        {
9636
        {
9616
            next test_copy_in if ( $i eq $_ );
9637
            next test_copy_in if ( $i eq $_ );
9617
        }
9638
        }
9618
        MakePrint( "\n$i:\t\tmakefile.pl\n" .
9639
        MakePrint( "\n$i:\t\tmakefile.pl\n" .
9619
            "\t\@if [ ! -f \"$i\" ]; then echo ERROR: CopyIn Script [$i] not found; exit 2; fi\n" );
9640
            "\t\@if [ ! -f \"$i\" ]; then echo 'ERROR: CopyIn Script [$i] not found'; exit 2; fi\n" );
9620
    }
9641
    }
9621
 
9642
 
9622
#-------------------------------------------------------------------------------
9643
#-------------------------------------------------------------------------------
9623
#   Deploy rules
9644
#   Deploy rules
9624
#
9645
#
Line 9690... Line 9711...
9690
        {
9711
        {
9691
            MakeEntry ( "", "", " \\\n\t\t", "", @{$i->{'preq'}} );
9712
            MakeEntry ( "", "", " \\\n\t\t", "", @{$i->{'preq'}} );
9692
            MakeEntry ( "", "", " \\\n\t\t", "", "phony_generate" ) if $i->{'preq_sus'};
9713
            MakeEntry ( "", "", " \\\n\t\t", "", "phony_generate" ) if $i->{'preq_sus'};
9693
            MakeEntry ( "", "", " \\\n\t\t", "", "\$(SCM_MAKEFILE)" );
9714
            MakeEntry ( "", "", " \\\n\t\t", "", "\$(SCM_MAKEFILE)" );
9694
 
9715
 
9695
            MakePrint ("\n\t" . "\@\$(echo) [$i->{'text'}] generating.." );
9716
            MakePrint ("\n\t" . "\@\$(echo) '[$i->{'text'}] generating..'" );
9696
            if ( $i->{'predelete'}  )
9717
            if ( $i->{'predelete'}  )
9697
            {
9718
            {
9698
                MakePrint ("\n\t" . "\$(XX_PRE)\$(call RmFiles,generate_gen_$gen_tag)" );
9719
                MakePrint ("\n\t" . "\$(XX_PRE)\$(call RmFiles,generate_gen_$gen_tag)" );
9699
            }
9720
            }
9700
            MakePrint ("\n\t" . "\$(XX_PRE)\$(call generate_$gen_tag,)" );
9721
            MakePrint ("\n\t" . "\$(XX_PRE)\$(call generate_$gen_tag,)" );
Line 9862... Line 9883...
9862
depend:			\$(OBJDIR)/depend
9883
depend:			\$(OBJDIR)/depend
9863
 
9884
 
9864
\$(OBJDIR)/depend:	\$(SCM_MAKEFILE) \$(GBE_OBJDIR)
9885
\$(OBJDIR)/depend:	\$(SCM_MAKEFILE) \$(GBE_OBJDIR)
9865
\$(OBJDIR)/depend:	\$(CSRCS) \$(CXXSRCS)
9886
\$(OBJDIR)/depend:	\$(CSRCS) \$(CXXSRCS)
9866
ifeq (\$(NODEPEND),0)
9887
ifeq (\$(NODEPEND),0)
9867
	\@echo [\$@] Doing a make depend..
9888
	\@echo '[\$@] Doing a make depend..'
9868
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
9889
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
9869
EOF
9890
EOF
9870
    $if->CCDepend( "\$(OBJDIR)/depend", "\$(CSRCS)" )
9891
    $if->CCDepend( "\$(OBJDIR)/depend", "\$(CSRCS)" )
9871
        if ( @CSRCS );
9892
        if ( @CSRCS );
9872
    $if->CXXDepend( "\$(OBJDIR)/depend", "\$(CXXSRCS)" )
9893
    $if->CXXDepend( "\$(OBJDIR)/depend", "\$(CXXSRCS)" )
9873
        if ( @CXXSRCS );
9894
        if ( @CXXSRCS );
9874
    MakePrint
9895
    MakePrint
9875
        "\t-\@\$(touch) -f \$(OBJDIR)/depend\n";
9896
        "\t-\@\$(touch) -f \$(OBJDIR)/depend\n";
9876
    print MAKEFILE <<EOF;
9897
    print MAKEFILE <<EOF;
9877
else
9898
else
9878
	\@echo [\$@] Skipping make depend..
9899
	\@echo '[\$@] Skipping make depend..'
9879
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
9900
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
9880
endif
9901
endif
9881
EOF
9902
EOF
9882
}
9903
}
9883
else
9904
else
Line 10426... Line 10447...
10426
# Inputs          : $subdir     - Symbolic name of the subdir $(OBJDIR)
10447
# Inputs          : $subdir     - Symbolic name of the subdir $(OBJDIR)
10427
#                   $alias      - Optional script alias for the dir 'OBJDIR' --> GBE_OBJDIR
10448
#                   $alias      - Optional script alias for the dir 'OBJDIR' --> GBE_OBJDIR
10428
#                   Options:
10449
#                   Options:
10429
#                       --Path=path             Optional value of $subdir '$(GBE_PLATFORM)$(GBE_TYPE).OBJ'
10450
#                       --Path=path             Optional value of $subdir '$(GBE_PLATFORM)$(GBE_TYPE).OBJ'
10430
#                       --RemoveAll             Remove all files on clean
10451
#                       --RemoveAll             Remove all files on clean
10431
#                       --Extra=file[,file]     Additiona files to remove
10452
#                       --Extra=file[,file]     Additional files to remove
10432
#                       --NoCreate              Do not Create the Directory, just delete it
10453
#                       --NoCreate              Do not Create the Directory, just delete it
10433
#
10454
#
10434
# Returns         : Nothing
10455
# Returns         : Nothing
10435
#
10456
#
10436
 
10457