Subversion Repositories DevTools

Rev

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

Rev 295 Rev 335
Line 158... Line 158...
158
 
158
 
159
    #.. Toolset configuration
159
    #.. Toolset configuration
160
    #
160
    #
161
    $::ScmToolsetVersion = "1.0.0";               # our version
161
    $::ScmToolsetVersion = "1.0.0";               # our version
162
    $::ScmToolsetGenerate = 0;                    # generate optional
162
    $::ScmToolsetGenerate = 0;                    # generate optional
-
 
163
    $::ScmToolsetProgDependancies = 0;            # handle Prog dependancies myself
163
 
164
 
164
#.. Cleanup rules
165
#.. Cleanup rules
165
#
166
#
166
#   9 Files that appear to be created by the USB licsence dongle
167
#   9 Files that appear to be created by the USB licsence dongle
167
#
168
#
Line 462... Line 463...
462
 
463
 
463
#
464
#
464
#   Create a ToolsetPrinter
465
#   Create a ToolsetPrinter
465
#
466
#
466
    my ($io) = ToolsetPrinter::New();
467
    my ($io) = ToolsetPrinter::New();
-
 
468
    my $dep = $io->SetLdTarget( $name );
-
 
469
 
-
 
470
#
-
 
471
#   Determine the target output name
-
 
472
#
-
 
473
    my $root = "\$(BINDIR)/$name";
-
 
474
    my $full = $root . $::exe;
-
 
475
    my $map = $root . '.map';
-
 
476
    my $d90 = $root . '.d90';
-
 
477
    my $s19 = $root . '.s19';
-
 
478
    
467
 
479
 
468
########################################################################
480
########################################################################
469
#
481
#
470
#   Before this function was called, makelib.pl2 has generated a
482
#   Before this function was called, makelib.pl2 has generated a
471
#   partial rule consisting of:
483
#   partial rule consisting of:
Line 478... Line 490...
478
#   created when a "program" is required
490
#   created when a "program" is required
479
#
491
#
480
#       These are:
492
#       These are:
481
#               User linker script file
493
#               User linker script file
482
#               Library dependency file
494
#               Library dependency file
483
#               Loader file ( optional )
-
 
484
 
495
# 
-
 
496
    $io->Label( "Program", $name );                     # label
-
 
497
    $io->Prt( "$full : \t$dep" );                       # Dependencies
485
    $io->Prt( "\\\n\t\t$script" .
498
    $io->Prt( "\\\n\t\t$script" );
486
              " \\\n\t\t\$(BINDIR)/${name}.dep" );
-
 
487
    $io->Prt( " \\\n\t\t$loader_file" ) if ($loader_file);
499
    $io->Prt( " \\\n\t\t$loader_file" ) if ($loader_file);
488
    $io->Prt( "\n" .
500
    $io->Entry( "", "", "\\\n\t", ".$::o ", @$pObjs );  # Object Files
489
              "\t\$(LD_IAR)\n" );
501
    $io->Prt( "\n\t\$(LD_IAR)\n" );
490
 
502
 
491
    #
503
    #
492
    #   Insert post processing call if a program loader is needed
504
    #   Insert post processing call if a program loader is needed
493
    #
505
    #
494
    $io->Prt( "\t\$(call LD_IAR_PROCESS, \\" .
506
    $io->Prt( "\t\$(call LD_IAR_PROCESS, \\" .
495
              "\n\t\t\$(BINDIR)/${name}$exe, \\" .
507
              "\n\t\t$full, \\" .
496
              "\n\t\t$loader_file)\n"
508
              "\n\t\t$loader_file)\n"
497
            ) if ($loader_file);
509
            ) if ($loader_file);
498
 
510
 
499
    $io->Newline();
511
    $io->Newline();
500
 
512
 
501
    #
513
    #
502
    #   Specify files created by the linker
514
    #   Specify files created by the linker
503
    #   These will be added to the clean list
515
    #   These will be added to the clean list
504
    #
516
    #
505
    ToolsetGenerate( "\$(BINDIR)/${name}.d90" );
517
    ToolsetGenerate( $d90 );
506
    ToolsetGenerate( "\$(BINDIR)/${name}.map" );
518
    ToolsetGenerate( $map );
507
    ToolsetGenerate( "\$(BINDIR)/${name}.dep" );
519
    ToolsetGenerate( "$full.keep" );
508
    ToolsetGenerate( "\$(BINDIR)/${name}$exe.keep" );
-
 
509
 
520
 
510
    #
521
    #
511
    #   Create a linker command file
522
    #   Create a linker command file
512
    #   Piecing together a variable $(name_ld) which ends up in the command file.
523
    #   Piecing together a variable $(name_ld) which ends up in the command file.
513
    #   This bit of magic will be performed by the LD_IAR recipe
524
    #   This bit of magic will be performed by the LD_IAR recipe
514
    #
525
    #
515
    $io->SetTag( "${name}_ld" );                            # macro tag
526
    $io->SetTag( "${name}_ld" );                            # macro tag
516
    $io->Label( "Linker commands", $name );                 # label
527
    $io->Label( "Linker commands", $name );                 # label
517
 
528
 
518
    $io->Cmd("-S" );                                        # Silent
529
    $io->Cmd("-S" );                                        # Silent
519
    $io->Cmd("-Omotorola=\$(BINDIR)/${name}.s19" );         # Output file
530
    $io->Cmd("-Omotorola=$s19" );                           # Output file
520
    $io->Cmd("-o \$(BINDIR)/${name}.d90" );                 # Output file
531
    $io->Cmd("-o $d90" );                                   # Output file
521
    $io->Cmd("-l \$(BINDIR)/${name}.map" );                 # Map file
532
    $io->Cmd("-l $map" );                                   # Map file
522
    $io->Cmd("-r" );                                        # Output with debug
533
    $io->Cmd("-r" );                                        # Output with debug
523
    $io->Cmd("-z" );                                        # Reduce segment overlap errors
534
    $io->Cmd("-z" );                                        # Reduce segment overlap errors
524
    $io->Cmd("-xmsn" );                                     # Add info to the map file
535
    $io->Cmd("-xmsn" );                                     # Add info to the map file
525
    $io->Cmd("-p100" );                                     # Number of line per page
536
    $io->Cmd("-p100" );                                     # Number of line per page
526
    $io->Cmd("-f $script" );                                # User script file
537
    $io->Cmd("-f $script" );                                # User script file
Line 532... Line 543...
532
    #
543
    #
533
    $io->Cmd( '"-I$(avr_linker_lib_dir)"' );                # Toolset library directory
544
    $io->Cmd( '"-I$(avr_linker_lib_dir)"' );                # Toolset library directory
534
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );      # Specify the libraries too
545
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );      # Specify the libraries too
535
    $io->Newline();
546
    $io->Newline();
536
 
547
 
537
    #
548
    #.. Dependency link,
538
    #   Create a library dependency file
549
    #   Create a library dependency file
-
 
550
    #       Create command file to build applicaton dependency list
539
    #   Rules and recipe to create the .dep file
551
    #       from the list of dependent libraries
540
    #
552
    #
541
    #       Now piece together a variable $(name_dp) which ends up in
553
    #       Create makefile directives to include the dependency
542
    #       the command file building the application dependency list.
554
    #       list into the makefile.
543
    #
555
    #
544
    $io->SetTag( "${name}_dp" );                            # macro tag
-
 
545
    $io->DepRules( $name, $pLibs,                           # library depends rules
-
 
546
            \&ToolsetLibRecipe, "\$(BINDIR)/${name}.s19" );
556
    $io->DepRules( $pLibs, \&ToolsetLibRecipe, $s19 );
547
    $io->LDDEPEND( $name );                                 # std LDDEPEND rules
557
    $io->LDDEPEND(); 
548
 
-
 
549
 
558
 
550
    #
559
    #
551
    #   Add the MAP file to the program package
560
    #   Add the MAP file to the program package
552
    #
561
    #
-
 
562
    PackageProgAddFiles ( $name, $full );
553
    PackageProgAddFiles( $name, "\$(BINDIR)/${name}.map" , 'Class=map' );
563
    PackageProgAddFiles ( $name, $map , 'Class=map' );
554
 
564
 
555
 
565
 
556
    #
566
    #
557
    #   Create the .sxml file
567
    #   Create the .sxml file
558
    #
568
    #
559
    my $sxml = "\$(BINDIR)/${name}.sxml";
569
    my $sxml = "\$(BINDIR)/${name}.sxml";
560
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($ScmBuildVersionFull);
570
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($ScmBuildVersionFull);
561
 
571
 
562
    $io->Label( "SXML File", $name );
572
    $io->Label( "SXML File", $name );
563
    $io->Prt( "$sxml: \$(BINDIR)/${name}.s19\n");
573
    $io->Prt( "$sxml: $s19\n");
564
    $io->Prt( "\t\$(call GENERATE_SXML, \\" .
574
    $io->Prt( "\t\$(call GENERATE_SXML, \\" .
565
              "\n\t\t\$(BINDIR)/${name}$exe, \\" .
575
              "\n\t\t\$(BINDIR)/${name}$exe, \\" .
566
              "\n\t\t$sxml,$type_text,$major,$minor,$patch,$build)\n"
576
              "\n\t\t$sxml,$type_text,$major,$minor,$patch,$build)\n"
567
              );
577
              );
568
    $io->Newline();
578
    $io->Newline();