Subversion Repositories DevTools

Rev

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

Rev 301 Rev 303
Line 2268... Line 2268...
2268
#                       --c             - Hint: Its a "C" file
2268
#                       --c             - Hint: Its a "C" file
2269
#                       --cpp           - Hint: Its a C++ file
2269
#                       --cpp           - Hint: Its a C++ file
2270
#                       --asm           - Hint: Its an ASM file
2270
#                       --asm           - Hint: Its an ASM file
2271
#                       -*              - Save as argument attached to the file
2271
#                       -*              - Save as argument attached to the file
2272
#
2272
#
2273
# Returns         : 
2273
# Returns         : Number of 'source' file
2274
#
2274
#
2275
sub GenerateSrcFile                             # Internal Function - no $platform
2275
sub GenerateSrcFile                             # Internal Function - no $platform
2276
{
2276
{
2277
    my( $generated, @elements ) = @_;
2277
    my( $generated, @elements ) = @_;
2278
    my( $type, @args );
2278
    my( $type, @args );
-
 
2279
    my $result = 0;
2279
 
2280
 
2280
    Debug2( "GenerateSrcFile($generated,@elements)" );
2281
    Debug2( "GenerateSrcFile($generated,@elements)" );
2281
 
2282
 
2282
    #.. Collect arguments
2283
    #.. Collect arguments
2283
    #
2284
    #
Line 2339... Line 2340...
2339
        #
2340
        #
2340
        my $src_file_type = __AddSourceFile( 1, $basename );
2341
        my $src_file_type = __AddSourceFile( 1, $basename );
2341
        if ($generated == 1 || ($src_file_type && $generated > 1) )
2342
        if ($generated == 1 || ($src_file_type && $generated > 1) )
2342
        {
2343
        {
2343
            push(@GENERATED, $source);
2344
            push(@GENERATED, $source);
-
 
2345
            $result++;
2344
        }
2346
        }
2345
        else
2347
        else
2346
        {
2348
        {
2347
            push(@GENERATED_NOTSRC, $source);
2349
            push(@GENERATED_NOTSRC, $source);
2348
        }
2350
        }
2349
    }
2351
    }
-
 
2352
 
-
 
2353
    return $result;
2350
}
2354
}
2351
 
2355
 
2352
#-------------------------------------------------------------------------------
2356
#-------------------------------------------------------------------------------
2353
# Function        : GenerateFiles
2357
# Function        : GenerateFiles
2354
#
2358
#
Line 2496... Line 2500...
2496
    my @tool_args;
2500
    my @tool_args;
2497
    my $no_warn;
2501
    my $no_warn;
2498
    my $clean_tag;
2502
    my $clean_tag;
2499
    my $text;
2503
    my $text;
2500
    my $gtype = 1;
2504
    my $gtype = 1;
-
 
2505
    my @has_source;
2501
    my @var_opts;
2506
    my @var_opts;
2502
    my @genreq_seen;
2507
    my @genreq_seen;
2503
    my $predelete;
2508
    my $predelete;
2504
 
2509
 
2505
    #
2510
    #
Line 2813... Line 2818...
2813
            #
2818
            #
2814
            #   Examine the file and see if it needs to be compiled
2819
            #   Examine the file and see if it needs to be compiled
2815
            #   Add to the list of source files
2820
            #   Add to the list of source files
2816
            #
2821
            #
2817
            push @genreq_seen, $arg;
2822
            push @genreq_seen, $arg;
-
 
2823
            if ( UniquePush (\@gen_files, $fn) )
-
 
2824
            {
2818
            GenerateSrcFile ( $gtype, $fn  )
2825
                if ( GenerateSrcFile ( $gtype, $fn  ) && $gtype == 2 )
-
 
2826
                {
2819
                if ( UniquePush (\@gen_files, $fn) );
2827
                    push @has_source, $fn;
-
 
2828
                }
2820
 
2829
            }
2821
            Debug( "GenerateFiles: ExtraCreated: $fn" );
2830
            Debug( "GenerateFiles: ExtraCreated: $fn" );
2822
            next;
2831
            next;
2823
        }
2832
        }
2824
 
2833
 
2825
        if ( $arg =~ /^--Clean($|=(.*))/ )
2834
        if ( $arg =~ /^--Clean($|=(.*))/ )
Line 2943... Line 2952...
2943
                #
2952
                #
2944
                #   Save for later user
2953
                #   Save for later user
2945
                #   Flag the file as a generated file
2954
                #   Flag the file as a generated file
2946
                #
2955
                #
2947
                push @genreq_seen, $cmd;
2956
                push @genreq_seen, $cmd;
-
 
2957
                if ( UniquePush (\@gen_files, $fn) )
-
 
2958
                {
2948
                GenerateSrcFile ( $gtype, $fn  )
2959
                    if ( GenerateSrcFile ( $gtype, $fn  ) && $gtype == 2 )
-
 
2960
                    {
2949
                    if ( UniquePush (\@gen_files, $fn) );
2961
                        push @has_source, $fn;
-
 
2962
                    }
-
 
2963
                }
2950
 
2964
 
2951
                #
2965
                #
2952
                #   Use the directory or the full name
2966
                #   Use the directory or the full name
2953
                #   If using the directory then ensure that we have a name
2967
                #   If using the directory then ensure that we have a name
2954
                #   even if its "."
2968
                #   even if its "."
Line 3000... Line 3014...
3000
 
3014
 
3001
            #
3015
            #
3002
            #   Minor kludge under windows. Ensure directores have a "\" sep
3016
            #   Minor kludge under windows. Ensure directores have a "\" sep
3003
            #   Unless the user has specified a straight shell command
3017
            #   Unless the user has specified a straight shell command
3004
            #
3018
            #
3005
            $fn =~ s~/~\\~g
3019
            $fn = "\$(subst /,\\,$fn)"
3006
                if ( $::ScmHost eq "WIN" && ! defined($shell_script) );
3020
                if ( $::ScmHost eq "WIN" && ! defined($shell_script) );
3007
 
3021
 
3008
            #
3022
            #
3009
            #   Replace the found string with the real name of the file
3023
            #   Replace the found string with the real name of the file
3010
            #   Note: 4 argument version of substr is not always available
3024
            #   Note: 4 argument version of substr is not always available
Line 3025... Line 3039...
3025
 
3039
 
3026
    #
3040
    #
3027
    #   Sanity test. Ensure that some file have been marged as generated
3041
    #   Sanity test. Ensure that some file have been marged as generated
3028
    #                Warn if no prerequisites found
3042
    #                Warn if no prerequisites found
3029
    #
3043
    #
3030
 
-
 
-
 
3044
    Warning( "GenerateFiles. --AutoGenerate option has no effect",
-
 
3045
             "The following files are 'source' files",  @has_source ) if ( @has_source );
3031
    Warning( "No Prerequisite files found in $tool",@tool_args) unless ( $no_warn || $#preq_files >= 0 );
3046
    Warning( "No Prerequisite files found in $tool",@tool_args) unless ( $no_warn || $#preq_files >= 0 );
3032
    Error  ( "No generated files found in $tool",@tool_args) unless ($#gen_files >= 0);
3047
    Error  ( "No generated files found in $tool",@tool_args) unless ($#gen_files >= 0);
3033
 
3048
 
3034
 
3049
 
3035
    #
3050
    #
Line 4685... Line 4700...
4685
 
4700
 
4686
            #
4701
            #
4687
            #   Minor kludge under windows. Ensure directores have a "\" sep
4702
            #   Minor kludge under windows. Ensure directores have a "\" sep
4688
            #   Unless the user has specified a straight shell command
4703
            #   Unless the user has specified a straight shell command
4689
            #
4704
            #
4690
            $fn =~ s~/~\\~g
4705
            $fn = "\$(subst /,\\,$fn)"
4691
                if ( $::ScmHost eq "WIN" && $winprog );
4706
                if ( $::ScmHost eq "WIN" && $winprog );
4692
 
4707
 
4693
            #
4708
            #
4694
            #   Replace the found string with the real name of the file
4709
            #   Replace the found string with the real name of the file
4695
            #   Note: 4 argument version of substr is not always available
4710
            #   Note: 4 argument version of substr is not always available