Subversion Repositories DevTools

Rev

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

Rev 261 Rev 263
Line 280... Line 280...
280
 
280
 
281
our @TESTS_TO_RUN           = ();
281
our @TESTS_TO_RUN           = ();
282
our @TESTPROJECT_TO_URUN    = ();
282
our @TESTPROJECT_TO_URUN    = ();
283
our @TESTPROJECT_TO_ARUN    = ();
283
our @TESTPROJECT_TO_ARUN    = ();
284
my  $TESTS_TO_AUTORUN       = undef;
284
my  $TESTS_TO_AUTORUN       = undef;
-
 
285
my  $TESTS_TO_RUN           = undef;
285
 
286
 
286
#our $CurrentTime           = "";
287
#our $CurrentTime           = "";
287
#our $CurrentDate           = "";
288
#our $CurrentDate           = "";
288
#our $Cwd                   = "";
289
#our $Cwd                   = "";
289
 
290
 
Line 2309... Line 2310...
2309
#                               The script may be generated and need not exist
2310
#                               The script may be generated and need not exist
2310
#                               at the time the makefile is created.
2311
#                               at the time the makefile is created.
2311
#                       --Shell
2312
#                       --Shell
2312
#                               The command line argument is a shell script that
2313
#                               The command line argument is a shell script that
2313
#                               will be passed to a simple shell.
2314
#                               will be passed to a simple shell.
-
 
2315
#                       --Prog=name
-
 
2316
#                               Resolve to a program generated within this makefile
2314
#
2317
#
2315
#
2318
#
2316
#                   The command line argument contains keywords to allow
2319
#                   The command line argument contains keywords to allow
2317
#                   information to be extracted from the line. Keywords are:
2320
#                   information to be extracted from the line. Keywords are:
2318
#
2321
#
Line 2389... Line 2392...
2389
#                                                 tools is to be run.
2392
#                                                 tools is to be run.
2390
#                                                 Must be before any options that declare
2393
#                                                 Must be before any options that declare
2391
#                                                 creation of files.
2394
#                                                 creation of files.
2392
#                       --Text=<text>           - Display text for command
2395
#                       --Text=<text>           - Display text for command
2393
#
2396
#
2394
#                       --Clean[=arg]           - Call script with arg[-clean] for cleaning. 
2397
#                       --Clean[=arg]           - Call script with arg[-clean] for cleaning.
-
 
2398
#                       --PreDelete             - Delete generated files before running the command
2395
#
2399
#
2396
#               Eg: GenerateFiles ( '*', "--Tool=mod_if.pl",
2400
#               Eg: GenerateFiles ( '*', "--Tool=mod_if.pl",
2397
#                                        "-src --Prerequisite(udh_module.cfg)",
2401
#                                        "-src --Prerequisite(udh_module.cfg)",
2398
#                                        "-direct -hdr --Generated(udp.h) -quiet" );
2402
#                                        "-direct -hdr --Generated(udp.h) -quiet" );
2399
#
2403
#
Line 2416... Line 2420...
2416
    my $clean_tag;
2420
    my $clean_tag;
2417
    my $text;
2421
    my $text;
2418
    my $gtype = 1;
2422
    my $gtype = 1;
2419
    my @var_opts;
2423
    my @var_opts;
2420
    my @genreq_seen;
2424
    my @genreq_seen;
-
 
2425
    my $predelete;
2421
 
2426
 
2422
    #
2427
    #
2423
    #   Process the first argument - this describes the program that will be used
2428
    #   Process the first argument - this describes the program that will be used
2424
    #   to generate the files. It may be:
2429
    #   to generate the files. It may be:
2425
    #       --Tool          - A Jats Tool or Plugin
2430
    #       --Tool          - A Jats Tool or Plugin
Line 2622... Line 2627...
2622
    #   These will be command line arguments or options/flags
2627
    #   These will be command line arguments or options/flags
2623
    #   Command line arguments are concatenated together
2628
    #   Command line arguments are concatenated together
2624
    #
2629
    #
2625
    for my $arg (@args)
2630
    for my $arg (@args)
2626
    {
2631
    {
-
 
2632
        if ( $arg =~ /^--PreDelete$/ )
-
 
2633
        {
-
 
2634
            #
-
 
2635
            #   Delete generated files before running the generation process
-
 
2636
            #   Some programs refuse to overwrite existing files
-
 
2637
            #
-
 
2638
            $predelete = 1;
-
 
2639
            next;
-
 
2640
        }
-
 
2641
        
2627
        if ( $arg =~ /^--NoVarTag$/ )
2642
        if ( $arg =~ /^--NoVarTag$/ )
2628
        {
2643
        {
2629
            #
2644
            #
2630
            #   Modify the operation of --Var to supress the tags
2645
            #   Modify the operation of --Var to supress the tags
2631
            #   Should be usd early as will only affect following --Var usage
2646
            #   Should be usd early as will only affect following --Var usage
Line 2951... Line 2966...
2951
    $gen_data{'tool'}       = $tool;
2966
    $gen_data{'tool'}       = $tool;
2952
    $gen_data{'toolargs'}   = \@tool_args;
2967
    $gen_data{'toolargs'}   = \@tool_args;
2953
    $gen_data{'clean'}      = $clean_tag;
2968
    $gen_data{'clean'}      = $clean_tag;
2954
    $gen_data{'text'}       = $text || $gen_files[0];
2969
    $gen_data{'text'}       = $text || $gen_files[0];
2955
    $gen_data{'preq_sus'}   = 1 if ( $preq_unknown );
2970
    $gen_data{'preq_sus'}   = 1 if ( $preq_unknown );
-
 
2971
    $gen_data{'predelete'}  = 1 if ( $predelete );
2956
 
2972
 
2957
    push(@GENERATE_FILES, \%gen_data);
2973
    push(@GENERATE_FILES, \%gen_data);
2958
 
2974
 
2959
    Debug2( "GenerateFiles: cmd: $tool @tool_args" );
2975
    Debug2( "GenerateFiles: cmd: $tool @tool_args" );
2960
}
2976
}
Line 5042... Line 5058...
5042
    $PROJECTS{$proj}{'unittest'} = $unit_tests if ( $unit_tests );
5058
    $PROJECTS{$proj}{'unittest'} = $unit_tests if ( $unit_tests );
5043
    $PROJECTS{$proj}{'autotest'} = $auto_tests if ( $auto_tests );
5059
    $PROJECTS{$proj}{'autotest'} = $auto_tests if ( $auto_tests );
5044
    UniquePush (\@PROJECTS_ORDER, $proj);
5060
    UniquePush (\@PROJECTS_ORDER, $proj);
5045
 
5061
 
5046
    $TESTS_TO_AUTORUN = 1 if ( $auto_tests );
5062
    $TESTS_TO_AUTORUN = 1 if ( $auto_tests );
-
 
5063
    $TESTS_TO_RUN = 1 if ( $unit_tests || $auto_tests );
5047
 
5064
 
5048
    #
5065
    #
5049
    #   Validate some of the arguments
5066
    #   Validate some of the arguments
5050
    #
5067
    #
5051
    Error ("MakeAnt. Conflicting options --Debug and --Prod" )
5068
    Error ("MakeAnt. Conflicting options --Debug and --Prod" )
Line 5780... Line 5797...
5780
        my %package_entry;
5797
        my %package_entry;
5781
        #
5798
        #
5782
        #   Special cases: Provide make-style $ escape processing.
5799
        #   Special cases: Provide make-style $ escape processing.
5783
        #       Allow files with a $ in the name
5800
        #       Allow files with a $ in the name
5784
        #       Allow files with a space in the name
5801
        #       Allow files with a space in the name
-
 
5802
        #   Only for file names that don't look like $(GBE_...) as these
-
 
5803
        #   may be generated internally
5785
        #
5804
        #
-
 
5805
        unless ( m~\$\(GBE_.+\)~ )
-
 
5806
        {
5786
        s~\$~\$\$~g;
5807
            s~\$~\$\$~g;
5787
        s~ ~\\ ~g;
5808
            s~ ~\\ ~g;
-
 
5809
        }
5788
 
5810
 
5789
        if ( ! /^--(.*)/ )
5811
        if ( ! /^--(.*)/ )
5790
        {
5812
        {
5791
            $name = $_;
5813
            $name = $_;
5792
            $basename = StripDir( $name );
5814
            $basename = StripDir( $name );
Line 8572... Line 8594...
8572
    foreach my $i ( @GENERATE_FILES )
8594
    foreach my $i ( @GENERATE_FILES )
8573
    {
8595
    {
8574
        my $gen_tag = $i->{'index'};
8596
        my $gen_tag = $i->{'index'};
8575
 
8597
 
8576
        #
8598
        #
-
 
8599
        #   If predelete is enabled, then create a list of files to delete
-
 
8600
        #
-
 
8601
        if ( $i->{'predelete'}  )
-
 
8602
        {
-
 
8603
            MakeDefEntry( "generate_gen_$gen_tag", "=",  $i->{'gen'} );
-
 
8604
            MakePrint("\n")
-
 
8605
        }
-
 
8606
 
-
 
8607
 
-
 
8608
        #
8577
        #   Generate the basic generate rule and recipe
8609
        #   Generate the basic generate rule and recipe
8578
        #   together with the prerequisites
8610
        #   together with the prerequisites
8579
        #
8611
        #
8580
        MakeEntry ( "", ":", "", " ", @{$i->{'gen'}} );
8612
        MakeEntry ( "", ":", "", " ", @{$i->{'gen'}} );
8581
 
8613
 
Line 8584... Line 8616...
8584
            MakeEntry ( "", "", " \\\n\t\t", "", @{$i->{'preq'}} );
8616
            MakeEntry ( "", "", " \\\n\t\t", "", @{$i->{'preq'}} );
8585
            MakeEntry ( "", "", " \\\n\t\t", "", "phony_generate" ) if $i->{'preq_sus'};
8617
            MakeEntry ( "", "", " \\\n\t\t", "", "phony_generate" ) if $i->{'preq_sus'};
8586
            MakeEntry ( "", "", " \\\n\t\t", "", "\$(SCM_MAKEFILE)" );
8618
            MakeEntry ( "", "", " \\\n\t\t", "", "\$(SCM_MAKEFILE)" );
8587
 
8619
 
8588
            MakePrint ("\n\t" . "\@\$(echo) [$i->{'text'}] generating.." );
8620
            MakePrint ("\n\t" . "\@\$(echo) [$i->{'text'}] generating.." );
-
 
8621
            if ( $i->{'predelete'}  )
-
 
8622
            {
-
 
8623
                MakePrint ("\n\t" . "\$(XX_PRE)\$(call RmFiles,generate_gen_$gen_tag)" );
-
 
8624
            }
8589
            MakePrint ("\n\t" . "\$(XX_PRE)\$(call generate_$gen_tag,)" );
8625
            MakePrint ("\n\t" . "\$(XX_PRE)\$(call generate_$gen_tag,)" );
8590
        }
8626
        }
8591
 
8627
 
8592
        #
8628
        #
8593
        #   Generate 'clean' rules and recipes
8629
        #   Generate 'clean' rules and recipes
Line 9319... Line 9355...
9319
    Maketag( "make_mlib",           @mlibdep );
9355
    Maketag( "make_mlib",           @mlibdep );
9320
    Maketag( "make_install_shlib",  %INSTALL_SHLIBS || @shlibdep);
9356
    Maketag( "make_install_shlib",  %INSTALL_SHLIBS || @shlibdep);
9321
    Maketag( "make_script",         @scriptdep );
9357
    Maketag( "make_script",         @scriptdep );
9322
    Maketag( "make_prog",           @progdep || @projectdep );
9358
    Maketag( "make_prog",           @progdep || @projectdep );
9323
    Maketag( "make_test",           @testprogdep );
9359
    Maketag( "make_test",           @testprogdep );
9324
    Maketag( "run_tests",           @TESTS_TO_RUN || @TESTPROJECT_TO_URUN);
9360
    Maketag( "run_tests",           @TESTS_TO_RUN || @TESTPROJECT_TO_URUN || $TESTS_TO_RUN);
9325
    Maketag( "run_unit_tests",      $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN);
9361
    Maketag( "run_unit_tests",      $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN);
9326
    Maketag( "install_hdr",         %INSTALL_HDRS );
9362
    Maketag( "install_hdr",         %INSTALL_HDRS );
9327
    Maketag( "install_class",       %INSTALL_CLSS );
9363
    Maketag( "install_class",       %INSTALL_CLSS );
9328
    Maketag( "install_lib",         %INSTALL_LIBS );
9364
    Maketag( "install_lib",         %INSTALL_LIBS );
9329
    Maketag( "install_prog",        %INSTALL_PROGS );
9365
    Maketag( "install_prog",        %INSTALL_PROGS );