Subversion Repositories DevTools

Rev

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

Rev 341 Rev 343
Line 446... Line 446...
446
#
446
#
447
#                   If the toolset doesn't support Debug and Prod, then
447
#                   If the toolset doesn't support Debug and Prod, then
448
#                   The library name will not have the suffix
448
#                   The library name will not have the suffix
449
#
449
#
450
# Inputs          : arg0        - Base name of the library
450
# Inputs          : arg0        - Base name of the library
-
 
451
#                   arg1        - Mode: 1 == Plain. No P or D
451
#
452
#
452
# Returns         : Name of the library as used in the makefiles
453
# Returns         : Name of the library as used in the makefiles
453
#                   Does not include base directory
454
#                   Does not include base directory
454
#
455
#
455
sub GenLibName
456
sub GenLibName
456
{
457
{
457
    if ( $ScmToolsetSingleType ) {
458
    if ( $ScmToolsetSingleType || $_[1] ) {
458
        return "$_[0].$::a"
459
        return "$_[0].$::a"
459
    } else {
460
    } else {
460
        return "$_[0]\$(GBE_TYPE).$::a"
461
        return "$_[0]\$(GBE_TYPE).$::a"
461
    }
462
    }
462
}
463
}
Line 819... Line 820...
819
 
820
 
820
#
821
#
821
#   Add arguments to the ScmPlatformArgs, but remove "Global" arguments
822
#   Add arguments to the ScmPlatformArgs, but remove "Global" arguments
822
#       --OnlyDebug
823
#       --OnlyDebug
823
#       --OnlyProduction
824
#       --OnlyProduction
-
 
825
#       --NoToolSet
824
#
826
#
825
#   Capture OnlyDebug and OnlyProd information
827
#   Capture OnlyDebug and OnlyProd information
826
#   Will be sanitized by caller.
828
#   Will be sanitized by caller.
827
#
829
#
828
sub AddPlatformArg
830
sub AddPlatformArg
Line 832... Line 834...
832
    {
834
    {
833
        if ( m~^--OnlyDebug~ ) {
835
        if ( m~^--OnlyDebug~ ) {
834
            $ScmBuildType = 'D';
836
            $ScmBuildType = 'D';
835
        } elsif ( m~--OnlyProd~ ) {
837
        } elsif ( m~--OnlyProd~ ) {
836
            $ScmBuildType = 'P';
838
            $ScmBuildType = 'P';
-
 
839
        } elsif ( m~--NoToolSet~ ) {
-
 
840
            $ScmNoToolsTest = 1;
837
        } else {
841
        } else {
838
            UniquePush( \@::ScmPlatformArgs, @_ );
842
            UniquePush( \@::ScmPlatformArgs, $_ );
839
        }
843
        }
840
    }
844
    }
841
 
845
 
842
    Debug("AddPlatformArg: Result: @::ScmPlatformArgs" );
846
    Debug("AddPlatformArg: Result: @::ScmPlatformArgs" );
843
    1;
847
    1;
Line 2813... Line 2817...
2813
            #   Add the files to the list of generated files
2817
            #   Add the files to the list of generated files
2814
            #
2818
            #
2815
            my $type = $1;
2819
            my $type = $1;
2816
            my $fn = $2;
2820
            my $fn = $2;
2817
 
2821
 
-
 
2822
            #
-
 
2823
            #   Append object suffix to CreatedObject
-
 
2824
            #
2818
            $fn .= '.' . $::o
2825
            $fn .= '.' . $::o
2819
                if ( $type =~ m/Object/ );
2826
                if ( $type =~ m/Object/ );
2820
 
2827
 
-
 
2828
            #
-
 
2829
            #   If the files is 'created' in a subdir, then add the dir
-
 
2830
            #   as a prerequisite.
-
 
2831
            #
-
 
2832
            if ( $type =~ m/Prog/ ) {
2821
            $fn = "\$(OBJDIR)/$fn"
2833
                $fn = "\$(BINDIR)/$fn";
-
 
2834
                UniquePush (\@preq_files, '$(GBE_BINDIR)');
-
 
2835
                
2822
                if ( $type !~ m/Common/ );
2836
            } elsif ( $type !~ m/Common/ ) {
2823
            $fn = "\$(BINDIR)/$fn"
2837
                $fn = "\$(OBJDIR)/$fn";
2824
                if ( $type =~ m/Prog/ );
2838
                UniquePush (\@preq_files, '$(GBE_OBJDIR)');
-
 
2839
            }
2825
 
2840
 
2826
            #
2841
            #
2827
            #   Examine the file and see if it needs to be compiled
2842
            #   Examine the file and see if it needs to be compiled
2828
            #   Add to the list of source files
2843
            #   Add to the list of source files
2829
            #
2844
            #
Line 2886... Line 2901...
2886
            my $mb = $-[0];                     # Match begin offset
2901
            my $mb = $-[0];                     # Match begin offset
2887
            my $me = $+[0];                     # Match end
2902
            my $me = $+[0];                     # Match end
2888
            my $flags = '';                     # Optional flags ( --dir or --file )
2903
            my $flags = '';                     # Optional flags ( --dir or --file )
2889
            my $raw_arg = $ufn;                 # Raw arguments
2904
            my $raw_arg = $ufn;                 # Raw arguments
2890
            my $all = substr( $arg, $mb, $me ); # All of match. Avoid use of $&
2905
            my $all = substr( $arg, $mb, $me ); # All of match. Avoid use of $&
-
 
2906
            my $is_path = 1;
2891
            
2907
            
2892
 
2908
 
2893
            Error ("GenerateFiles. Empty element not allowed: $all")
2909
            Error ("GenerateFiles. Empty element not allowed: $all")
2894
                unless ( defined($ufn) );
2910
                unless ( defined($ufn) );
2895
 
2911
 
Line 2901... Line 2917...
2901
                $ufn = $1;
2917
                $ufn = $1;
2902
                $flags = $2;
2918
                $flags = $2;
2903
            }
2919
            }
2904
 
2920
 
2905
            my $fn = $ufn ;                     # Replacement filename
2921
            my $fn = $ufn ;                     # Replacement filename
-
 
2922
            my $fnp = '';                       # Prefix to $fn
2906
            Error ("GenerateFiles. Empty element not allowed: $all" )
2923
            Error ("GenerateFiles. Empty element not allowed: $all" )
2907
                if ( length ($ufn) <= 0 );
2924
                if ( length ($ufn) <= 0 );
2908
 
2925
 
2909
            #
2926
            #
2910
            #   Process found user command
2927
            #   Process found user command
2911
            #
2928
            #
2912
            if ( $cmd =~ /^Generated/ )
2929
            if ( $cmd =~ /^Generated/ )
2913
            {
2930
            {
2914
                my $use_dir = "";
2931
                my $use_dir = "";
-
 
2932
 
2915
                #
2933
                #
2916
                #   Generated filename
2934
                #   Generated filename
2917
                #       Determine the target directory
2935
                #       Determine the target directory
2918
                #       Determine the full name of the file.
2936
                #       Determine the full name of the file.
2919
                #       Flag the file as generated
2937
                #       Flag the file as generated
Line 2923... Line 2941...
2923
                    #
2941
                    #
2924
                    #   Generated Prog are generated in the BIN directory
2942
                    #   Generated Prog are generated in the BIN directory
2925
                    #   Ensure the directory exists by using its symbolic name
2943
                    #   Ensure the directory exists by using its symbolic name
2926
                    #   as a prerequisite.
2944
                    #   as a prerequisite.
2927
                    #
2945
                    #
2928
                    $use_dir = "\$(BINDIR)";
2946
                    $use_dir = '$(BINDIR)';
2929
                    UniquePush (\@preq_files, "\$(GBE_BINDIR)");
2947
                    UniquePush (\@preq_files, '$(GBE_BINDIR)');
2930
                }
2948
                }
2931
                elsif ( $cmd !~ /Common/ )
2949
                elsif ( $cmd !~ /Common/ )
2932
                {
2950
                {
2933
                    #
2951
                    #
2934
                    #   Files that are not Common are generated in the
2952
                    #   Files that are not Common are generated in the
Line 2936... Line 2954...
2936
                    #   symbolic name GBE_OBJDIR is made a prerequisite too.
2954
                    #   symbolic name GBE_OBJDIR is made a prerequisite too.
2937
                    #
2955
                    #
2938
                    #   If the file is a header file, then add the directory
2956
                    #   If the file is a header file, then add the directory
2939
                    #   to the include search path too.
2957
                    #   to the include search path too.
2940
                    #
2958
                    #
2941
                    $use_dir = "\$(OBJDIR)";
2959
                    $use_dir = '$(OBJDIR)';
2942
                    UniquePush (\@preq_files, "\$(GBE_OBJDIR)");
2960
                    UniquePush (\@preq_files, '$(GBE_OBJDIR)');
2943
                    AddIncDir( $platforms , "\$(OBJDIR)", '--NoWarn' )
2961
                    AddIncDir( $platforms , '$(OBJDIR)', '--NoWarn' )
2944
                        if ( $ScmSourceTypes{ StripFile($fn) } && $ScmSourceTypes{ StripFile($fn) } eq ".h" );
2962
                        if ( $ScmSourceTypes{ StripFile($fn) } && $ScmSourceTypes{ StripFile($fn) } eq ".h" );
2945
                }
2963
                }
2946
 
2964
 
2947
 
2965
 
2948
                #
2966
                #
Line 3004... Line 3022...
3004
            {
3022
            {
3005
                $fn = GetPackageInfo( "GenerateFiles", $raw_arg );
3023
                $fn = GetPackageInfo( "GenerateFiles", $raw_arg );
3006
            }
3024
            }
3007
            elsif ( $cmd =~ /^Var/ )
3025
            elsif ( $cmd =~ /^Var/ )
3008
            {
3026
            {
3009
                ($fn) = ExpandGenVar( "GenerateFiles", $raw_arg, @var_opts );
3027
                ($fnp, $fn, $is_path) = ExpandGenVar( "GenerateFiles", $raw_arg, @var_opts );
3010
                $flags = '';
3028
                $flags = '';
-
 
3029
                if ( $raw_arg eq 'ObjDir' ) {
-
 
3030
                    UniquePush (\@preq_files, '$(GBE_OBJDIR)');
-
 
3031
                } elsif ( $raw_arg eq 'BinDir' ) {
-
 
3032
                    UniquePush (\@preq_files, '$(GBE_BINDIR)');
-
 
3033
                } elsif ( $raw_arg eq 'LibDir' ) {
-
 
3034
                    UniquePush (\@preq_files, '$(GBE_LIBDIR)');
-
 
3035
                }
3011
            }
3036
            }
3012
            else
3037
            else
3013
            {
3038
            {
3014
                Warning ("GenerateFiles: Unknown replacement command: $cmd");
3039
                Warning ("GenerateFiles: Unknown replacement command: $cmd");
3015
                $fn = $ufn;
3040
                $fn = $ufn;
Line 3023... Line 3048...
3023
            #
3048
            #
3024
            #   Minor kludge under windows. Ensure directores have a "\" sep
3049
            #   Minor kludge under windows. Ensure directores have a "\" sep
3025
            #   Unless the user has specified a straight shell command
3050
            #   Unless the user has specified a straight shell command
3026
            #
3051
            #
3027
            $fn = "\$(subst /,\\,$fn)"
3052
            $fn = "\$(subst /,\\,$fn)"
3028
                if ( $::ScmHost eq "WIN" && ! defined($shell_script) );
3053
                if ( $is_path && $::ScmHost eq "WIN" && ! defined($shell_script) );
3029
 
3054
 
3030
            #
3055
            #
-
 
3056
            #   Prepend any $fn Prefix
-
 
3057
            #   This will be a tag and is not subject to path processing
-
 
3058
            #
-
 
3059
            $fn = $fnp . $fn;
-
 
3060
                
-
 
3061
            #
3031
            #   Replace the found string with the real name of the file
3062
            #   Replace the found string with the real name of the file
3032
            #   Note: 4 argument version of substr is not always available
3063
            #   Note: 4 argument version of substr is not always available
3033
            #         so we must do it the hard way
3064
            #         so we must do it the hard way
3034
            #               substr( $arg, $mb, $me - $mb, $fn);
3065
            #               substr( $arg, $mb, $me - $mb, $fn);
3035
            #
3066
            #
Line 3352... Line 3383...
3352
#                                       --notag
3383
#                                       --notag
3353
#                                       --tag=<SomeTag>
3384
#                                       --tag=<SomeTag>
3354
#                                       --absdrive
3385
#                                       --absdrive
3355
#                                       --abspath
3386
#                                       --abspath
3356
#                                       --default=text
3387
#                                       --default=text
-
 
3388
#                                       --allownone
3357
#                                   Not all options are avalaible on all variables
3389
#                                   Not all options are avalaible on all variables
3358
#                   @opts           - Options
3390
#                   @opts           - Options
3359
#                                       --notag     - Default is --notag
3391
#                                       --notag     - Default is --notag
3360
#
3392
#
3361
# Returns         : String
3393
# Returns         : Tag             - Any tag component of the expansion
-
 
3394
#                   Path/Value      - Path/Value of the component
3362
#                   is_path
3395
#                   is_path         - Above is a path
3363
#                   is_abs
3396
#                   is_abs          - Path is absolute
3364
#
3397
#
3365
 
3398
 
3366
#
3399
#
3367
#   Create a Hash to simplify the process of converting Var names
3400
#   Create a Hash to simplify the process of converting Var names
-
 
3401
#   into makefile variables. There are two data items, separated by a comma.
-
 
3402
#       The first is the runtime expansion value
3368
#   into makefile variables.
3403
#       The second describes the first:
-
 
3404
#           NotPresent  - Expansion is not a path
-
 
3405
#           '-'         - Expansion is a path and is relative to CWD
-
 
3406
#           '+'         - Expansion is a path and is absolute
3369
#
3407
#
3370
my %ExpandGenVarConvert = (
3408
my %ExpandGenVarConvert = (
3371
    'BuildName'         => '$(GBE_PBASE)',
3409
    'BuildName'         => '$(GBE_PBASE)',
3372
    'BuildVersion'      => '$(BUILDVER)',
3410
    'BuildVersion'      => '$(BUILDVER)',
3373
    'BuildVersionNum'   => '$(BUILDVERNUM)',
3411
    'BuildVersionNum'   => '$(BUILDVERNUM)',
Line 3507... Line 3545...
3507
            Error ("$dname: Unsupported option($opt) for --Var(@_)");
3545
            Error ("$dname: Unsupported option($opt) for --Var(@_)");
3508
        }
3546
        }
3509
    }
3547
    }
3510
 
3548
 
3511
    Debug ("ExpandGenVar: args $args --> $prefix$expansion");
3549
    Debug ("ExpandGenVar: args $args --> $prefix$expansion");
3512
    return $prefix . $expansion, $is_path ? 1 : 0, $is_abs;
3550
    return $prefix , $expansion, $is_path ? 1 : 0, $is_abs;
3513
 
3551
 
3514
}
3552
}
3515
 
3553
 
3516
#-------------------------------------------------------------------------------
3554
#-------------------------------------------------------------------------------
3517
# Function        : ProcessPathName
3555
# Function        : ProcessPathName
Line 4688... Line 4726...
4688
                $ufn = $1;
4726
                $ufn = $1;
4689
                $flags = $2;
4727
                $flags = $2;
4690
            }
4728
            }
4691
 
4729
 
4692
            my $fn = $ufn ;                     # Replacement filename
4730
            my $fn = $ufn ;                     # Replacement filename
-
 
4731
            my $fnp = '';                       # Prefix to $fn
4693
            Error ("RunTest. Empty element not allowed: $all" )
4732
            Error ("RunTest. Empty element not allowed: $all" )
4694
                if ( length ($ufn) <= 0 );
4733
                if ( length ($ufn) <= 0 );
4695
 
4734
 
4696
            #
4735
            #
4697
            #   Process found user command
4736
            #   Process found user command
Line 4719... Line 4758...
4719
            {
4758
            {
4720
                $fn = GetPackageInfo( "RunTest", $raw_arg );
4759
                $fn = GetPackageInfo( "RunTest", $raw_arg );
4721
            }
4760
            }
4722
            elsif ( $cmd =~ /^Var/ )
4761
            elsif ( $cmd =~ /^Var/ )
4723
            {
4762
            {
4724
                ($fn, $is_path, $is_abs) = ExpandGenVar( "RunTest", $raw_arg );
4763
                ($fnp, $fn, $is_path, $is_abs) = ExpandGenVar( "RunTest", $raw_arg );
4725
                $flags = '';
4764
                $flags = '';
4726
            }
4765
            }
4727
            elsif ( $cmd =~ /^Local/ )
4766
            elsif ( $cmd =~ /^Local/ )
4728
            {
4767
            {
4729
                $fn = '$(LOCALDIR)/' . $ufn ;
4768
                $fn = '$(LOCALDIR)/' . $ufn ;
Line 4765... Line 4804...
4765
            #
4804
            #
4766
            $fn = "\$(subst /,\\,$fn)"
4805
            $fn = "\$(subst /,\\,$fn)"
4767
                if ( $::ScmHost eq "WIN" && $winprog );
4806
                if ( $::ScmHost eq "WIN" && $winprog );
4768
 
4807
 
4769
            #
4808
            #
-
 
4809
            #   Prepend any $fn Prefix
-
 
4810
            #   This will be a tag and is not subject to path processing
-
 
4811
            #
-
 
4812
            $fn = $fnp . $fn;
-
 
4813
 
-
 
4814
            #
4770
            #   Replace the found string with the real name of the file
4815
            #   Replace the found string with the real name of the file
4771
            #   Note: 4 argument version of substr is not always available
4816
            #   Note: 4 argument version of substr is not always available
4772
            #         so we must do it the hard way
4817
            #         so we must do it the hard way
4773
            #               substr( $arg, $mb, $me - $mb, $fn);
4818
            #               substr( $arg, $mb, $me - $mb, $fn);
4774
            #
4819
            #
Line 8143... Line 8188...
8143
    #
8188
    #
8144
    my( $if ) = MakeIf::Factory();              # build interface
8189
    my( $if ) = MakeIf::Factory();              # build interface
8145
    $if->Preprocess();
8190
    $if->Preprocess();
8146
 
8191
 
8147
    #
8192
    #
-
 
8193
    #   If we have supressed the Toolset use, then we need to sanity test
-
 
8194
    #   the use of the toolset
-
 
8195
    #
-
 
8196
    if ( $ScmNoToolsTest )
-
 
8197
    {
-
 
8198
        ReportError ("Building programs not supported with --NoToolset") if ( @PROGS || @TESTPROGS );
-
 
8199
        ReportError ("Building libraries not supported with --NoToolset") if ( @LIBS || @MLIBS || @SHLIBS );
-
 
8200
        ReportError ("Building projects not supported with --NoToolset") if ( %PROJECTS );
-
 
8201
        ErrorDoExit();
-
 
8202
    }
-
 
8203
 
-
 
8204
    #
8148
    #   Auto package the 'descpkg' file
8205
    #   Auto package the 'descpkg' file
8149
    #   If this makefile packages any files, then it can also package the descpkg file
8206
    #   If this makefile packages any files, then it can also package the descpkg file
8150
    #   The descpkg will be piggybacked into all makefiles that do a package
8207
    #   The descpkg will be piggybacked into all makefiles that do a package
8151
    #
8208
    #
8152
    if ( %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS || %PACKAGE_LIBS
8209
    if ( %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS || %PACKAGE_LIBS
Line 8172... Line 8229...
8172
    #
8229
    #
8173
    open( MAKEFILE, '>', $Makefile ) || Error( "Cannot create $Makefile" );
8230
    open( MAKEFILE, '>', $Makefile ) || Error( "Cannot create $Makefile" );
8174
    ::MakefileHeader( *MAKEFILE,
8231
    ::MakefileHeader( *MAKEFILE,
8175
                      'Auto-generated Platform Dependent Makefile',
8232
                      'Auto-generated Platform Dependent Makefile',
8176
                      "$ScmMakelib (version $ScmVersion)",
8233
                      "$ScmMakelib (version $ScmVersion)",
8177
                      "# Copyright (C) 1995-$::CurrentYear ERG Transit Systems, All rights reserved",
8234
                      "# Copyright (C) 1995-$::CurrentYear Vix-ERG, All rights reserved",
8178
                      '#',
8235
                      '#',
8179
                      "# Located in $::Cwd",
8236
                      "# Located in $::Cwd",
8180
                      "# Platform $::ScmPlatform",
8237
                      "# Platform $::ScmPlatform",
8181
                      '#' . ('-' x 79),
8238
                      '#' . ('-' x 79),
8182
                      );
8239
                      );
Line 8203... Line 8260...
8203
    print MAKEFILE <<EOF;
8260
    print MAKEFILE <<EOF;
8204
 
8261
 
8205
#
8262
#
8206
#   Basic definitions
8263
#   Basic definitions
8207
#
8264
#
8208
GBE_ROOT	:= $gbe_root
8265
GBE_ROOT      := $gbe_root
8209
GBE_ROOT_ABS	:= \$(abspath \$(GBE_ROOT))
8266
GBE_ROOT_ABS  := \$(abspath \$(GBE_ROOT))
8210
GBE_HOST	:= $::ScmHost
8267
GBE_HOST      := $::ScmHost
8211
GBE_HOSTMACH	:= $::GBE_MACHTYPE
8268
GBE_HOSTMACH  := $::GBE_MACHTYPE
8212
GBE_TARGET	:= $::ScmTarget
8269
GBE_TARGET    := $::ScmTarget
8213
GBE_MACHTYPE	:= $::ScmMachType
8270
GBE_MACHTYPE  := $::ScmMachType
8214
GBE_PLATFORM	:= $::ScmPlatform
8271
GBE_PLATFORM  := $::ScmPlatform
8215
GBE_PBASE	:= $::Pbase
8272
GBE_PBASE     := $::Pbase
8216
ifeq "\$(DEBUG)" "0"
8273
GBE_TYPE      := \$(if \$(findstring 1,\$(DEBUG)),D,P)
8217
GBE_TYPE	:= P
-
 
8218
else
-
 
8219
GBE_TYPE	:= D
-
 
8220
endif
-
 
8221
EOF
8274
EOF
8222
 
8275
 
8223
MakePrint( "GBE_ARGS\t:= @ScmPlatformArgs\n" )
8276
MakePrint( "GBE_ARGS      := @ScmPlatformArgs\n" )
8224
    if ( scalar @ScmPlatformArgs );
8277
    if ( scalar @ScmPlatformArgs );
8225
 
8278
 
8226
MakePrint( "GBE_PRODUCT\t:= $ScmProduct\n" )
8279
MakePrint( "GBE_PRODUCT   := $ScmProduct\n" )
8227
    if ( $ScmProduct ne "" );
8280
    if ( $ScmProduct ne "" );
8228
 
8281
 
8229
MakePrint( "GBE_OS_COMMON\t:= $::BUILDINFO{$ScmPlatform}{OS_COMMON}\n" )
8282
MakePrint( "GBE_OS_COMMON := $::BUILDINFO{$ScmPlatform}{OS_COMMON}\n" )
8230
    if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) );
8283
    if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) );
8231
 
8284
 
8232
 
8285
 
8233
    print MAKEFILE <<EOF;
8286
    print MAKEFILE <<EOF;
8234
 
8287
 
8235
SHELL           := \$(GBE_BIN)/sh
8288
SHELL           := \$(GBE_BIN)/sh
8236
SHELLARGS       :=
8289
SHELLARGS       :=
8237
EXTENDED_LINE   := \$(GBE_BIN)/extend.lst
8290
EXTENDED_LINE   := \$(GBE_BIN)/extend.lst
8238
export EXTENDED_LINE MAKE
8291
export EXTENDED_LINE MAKE
8239
 
8292
 
8240
MFLAGS		:= --no-print --warn -r
8293
MFLAGS           := --no-print --warn -r
8241
BUILDNAME	:= $::ScmBuildName
8294
BUILDNAME        := $::ScmBuildName
8242
BUILDVER	:= $::ScmBuildVersionFull
8295
BUILDVER         := $::ScmBuildVersionFull
8243
BUILDVERNUM	:= $::ScmBuildVersion
8296
BUILDVERNUM      := $::ScmBuildVersion
8244
BUILDPREVIOUSVER := $::ScmBuildPreviousVersion
8297
BUILDPREVIOUSVER := $::ScmBuildPreviousVersion
8245
DEPLOYPATCH	:= $ScmDeploymentPatch
8298
DEPLOYPATCH      := $ScmDeploymentPatch
8246
GBE_NOTOOLSTEST := $ScmNoToolsTest
8299
GBE_NOTOOLSTEST  := $ScmNoToolsTest
8247
 
8300
 
8248
#
8301
#
8249
#   Ensure PWD is correctly set
8302
#   Ensure PWD is correctly set
8250
#
8303
#
8251
PWD             := \$(CURDIR)
8304
PWD             := \$(CURDIR)
Line 8394... Line 8447...
8394
    #         end up with two (or more in the environment)
8447
    #         end up with two (or more in the environment)
8395
    #
8448
    #
8396
    #
8449
    #
8397
    if ( $put_LD_LIBRARY_PATH )
8450
    if ( $put_LD_LIBRARY_PATH )
8398
    {
8451
    {
8399
    MakePrint( "export LD_LIBRARY_PATH\n" );
8452
        MakePrint( "export LD_LIBRARY_PATH\n" );
8400
    }
8453
    }
8401
 
8454
 
8402
    if ( $put_PATH )
8455
    if ( $put_PATH )
8403
    {
8456
    {
8404
    MakePrint( "Path := \$(PATH)\n" );
8457
        MakePrint( "Path := \$(PATH)\n" );
8405
    MakePrint( "export PATH Path\n" );
8458
        MakePrint( "export PATH Path\n" );
8406
    }
8459
    }
8407
 
8460
 
8408
#-------------------------------------------------------------------------------
8461
#-------------------------------------------------------------------------------
8409
#   
8462
#   
8410
#
8463
#
Line 8545... Line 8598...
8545
#   Deletion is done AFTER the toolset functions have been invoked to create the
8598
#   Deletion is done AFTER the toolset functions have been invoked to create the
8546
#   build artifacts so that the toolsets can create directories too
8599
#   build artifacts so that the toolsets can create directories too
8547
 
8600
 
8548
    MakeHeader ("Subdir creation");
8601
    MakeHeader ("Subdir creation");
8549
    CreateMkdirRules();
8602
    CreateMkdirRules();
8550
    MkdirRule( "\$(OBJDIR)", 'OBJDIR' );                # Object build directory
8603
    MkdirRule( '$(OBJDIR)', 'OBJDIR' );                # Object build directory
8551
    MkdirRule( "\$(OBJDIR)/$_" ) foreach (@SHLIBS);     # Shared library build directory
8604
    MkdirRule( '$(OBJDIR)/'.$_ ) foreach (@SHLIBS);    # Shared library build directory
8552
    MkdirRule( "\$(LIBDIR)", 'LIBDIR' );                # Library directory
8605
    MkdirRule( '$(LIBDIR)', 'LIBDIR' );                # Library directory
8553
    MkdirRule( "\$(BINDIR)", 'BINDIR' );                # Binary directory
8606
    MkdirRule( '$(BINDIR)', 'BINDIR' );                # Binary directory
8554
 
8607
 
8555
    #
8608
    #
8556
    #   Create a directory for library merge tool to work within
8609
    #   Create a directory for library merge tool to work within
8557
    #
8610
    #
8558
    MkdirRule( "\$(MLIBDIR)", 'MLIBDIR', '--Path=$(GBE_PLATFORM).MRG', '--RemoveAll' ) if (@MLIBS);
8611
    MkdirRule( "\$(MLIBDIR)", 'MLIBDIR', '--Path=$(GBE_PLATFORM).MRG', '--RemoveAll' ) if (@MLIBS);
Line 8695... Line 8748...
8695
            #   Each library name may contains one embedded option which
8748
            #   Each library name may contains one embedded option which
8696
            #   specifies the source directory
8749
            #   specifies the source directory
8697
            #       libname[,--Option | BaseSubdir]
8750
            #       libname[,--Option | BaseSubdir]
8698
            #
8751
            #
8699
            my ($slib, $sdir) = split( ',', $lib );
8752
            my ($slib, $sdir) = split( ',', $lib );
-
 
8753
            my $mode;
8700
 
8754
 
8701
            #
8755
            #
8702
            #   By default the librares are pulled from LOCAL unless the
8756
            #   By default the librares are pulled from LOCAL unless the
8703
            #   library is built in this directory, in which case it will
8757
            #   library is built in this directory, in which case it will
8704
            #   be used.
8758
            #   be used.
Line 8714... Line 8768...
8714
            #   otherwise       - Pull library from specified subdirectory
8768
            #   otherwise       - Pull library from specified subdirectory
8715
            #
8769
            #
8716
            if ($sdir eq '--Interface') {
8770
            if ($sdir eq '--Interface') {
8717
                $sdir = '$(LIBDIR_INTERFACE)/$(GBE_PLATFORM)';
8771
                $sdir = '$(LIBDIR_INTERFACE)/$(GBE_PLATFORM)';
8718
 
8772
 
-
 
8773
 
-
 
8774
            } elsif ($sdir eq '--InterfacePlain') {
-
 
8775
                $sdir = '$(LIBDIR_INTERFACE)/$(GBE_PLATFORM)';
-
 
8776
                $mode = 1;
-
 
8777
                
8719
            } elsif ( $sdir eq '--Local') {
8778
            } elsif ( $sdir eq '--Local') {
8720
                $sdir = $PackageInfo{'Lib'}{'IBase'} .  # Base of Installed libs
8779
                $sdir = $PackageInfo{'Lib'}{'IBase'} .  # Base of Installed libs
8721
                        $PackageInfo{'Lib'}{'Dir'};     # Default subdir
8780
                        $PackageInfo{'Lib'}{'Dir'};     # Default subdir
8722
 
8781
 
8723
            } elsif ( $sdir =~ m~^--SubDir=(.*)~ ) {
8782
            } elsif ( $sdir =~ m~^--SubDir=(.*)~ ) {
Line 8728... Line 8787...
8728
 
8787
 
8729
            } else {
8788
            } else {
8730
                $sdir .= '/$(LIBDIR)';
8789
                $sdir .= '/$(LIBDIR)';
8731
            }
8790
            }
8732
 
8791
 
8733
            MakePrint " \\\n\t\t${sdir}/" . GenLibName($slib);
8792
            MakePrint " \\\n\t\t${sdir}/" . GenLibName($slib, $mode);
8734
            push @flib, "${sdir}/${slib}";
8793
            push @flib, "${sdir}/${slib}";
8735
        }
8794
        }
8736
        return \@flib;
8795
        return \@flib;
8737
    }
8796
    }
8738
 
8797
 
Line 9094... Line 9153...
9094
        #
9153
        #
9095
        if ( $i->{'clean'} )
9154
        if ( $i->{'clean'} )
9096
        {
9155
        {
9097
            MakePrint ("\n\nPHONY: clean_generate_$gen_tag" );
9156
            MakePrint ("\n\nPHONY: clean_generate_$gen_tag" );
9098
            MakePrint ("\nclean_generate_$gen_tag:" );
9157
            MakePrint ("\nclean_generate_$gen_tag:" );
9099
            MakePrint ("\n\t" . "\@\$(call generate_$gen_tag,$i->{'clean'})" );
9158
            MakePrint ("\n\t" . "\$(XX_PRE)-\$(call generate_$gen_tag,$i->{'clean'})" );
9100
        }
9159
        }
9101
 
9160
 
9102
        #
9161
        #
9103
        #   Define a function to contain the body of the generation call
9162
        #   Define a function to contain the body of the generation call
9104
        #   The first argument will be a 'clean' argument
9163
        #   The first argument will be a 'clean' argument
Line 9595... Line 9654...
9595
    sub InstallTarget
9654
    sub InstallTarget
9596
    {
9655
    {
9597
        my( $target, $hashp, $prereq, $fprereq ) = @_;
9656
        my( $target, $hashp, $prereq, $fprereq ) = @_;
9598
        my( $element );
9657
        my( $element );
9599
 
9658
 
-
 
9659
        MakePrint ".PHONY:\t\t"."$target\n";
9600
        MakePrint "$target:";
9660
        MakePrint "$target:";
9601
        MakePrint "\t$fprereq" if ($fprereq);
9661
        MakePrint "\t$fprereq" if ($fprereq);
9602
 
9662
 
9603
        foreach my $element ( sort keys %{$hashp} )
9663
        foreach my $element ( sort keys %{$hashp} )
9604
        {
9664
        {