Subversion Repositories DevTools

Rev

Rev 245 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
#..
2
# Copyright (C) 1998-2005 ERG Transit Systems, All rights reserved
3
#
4
# Module name   : m16c
5
# Module type   : Makefile system
6
# Compiler(s)   : None
7
# Environment(s): All
8
#
9
# Description:
10
#       This file provides Toolset initialisation and plugin functions
11
#       to makelib.pl2
12
#
13
# Contents:
14
#
15
# Revision History:
16
#       26-Oct-05   DDP     Created
17
#............................................................................#
18
 
19
use strict;
20
 
21
our $s;
22
our $o;
23
our $so;
24
our $exe;
25
 
26
our @ScmToolsetArgs;
27
our @ScmPlatformArgs;
28
our $ScmToolsetVersion;
29
our $ScmToolsetGenerate;
30
our $ScmToolsetIFLAG3;
31
our $ScmToolsetProgDependancies;
32
our %ScmCompilerOpts;
33
our %SRCS;
34
our $ScmBuildVersion;
35
our @PROGS;
36
 
37
##############################################################################
38
#   ToolsetInit()
39
#       Runtime initialisation
40
#
41
##############################################################################
42
 
43
ToolsetInit();
44
 
45
sub ToolsetInit
46
{
47
    my( @args ) = @ScmToolsetArgs;             # Toolset arguments
48
    my( $version, $product );
49
 
50
#.. Parse arguments
51
#
52
    Debug( "m16c(@args)\n" );
53
 
54
    foreach $_ ( @args ) {
55
        Message( "m16c: unknown toolset argument $_ -- ignored\n" );
56
    }
57
 
58
#.. Parse Platform Arguments
59
#
60
    my( @args ) = @ScmPlatformArgs;             # Platform arguments
61
    foreach $_ ( @args ) {
62
        if (/^--product=(.*)/) {                # GBE product
63
            $product = $1;
64
        } else {
65
            Message( "m16c: unknown platform argument $_ -- ignored\n" );
66
        }
67
    }
68
 
69
#.. Standard.rul requirements
70
#
71
    $s =   'asm';           # Assembler source file
72
    $o =   'R30';           # Object files
73
    $a =   'lib';           # Library file
74
    $so =  undef;           # Shared library (not supported)
75
    $exe = '.bin';          # Program File (also .thx)
76
 
77
#.. Toolset configuration
78
#
79
    $ScmToolsetVersion = "1.0.0";               # our version
80
    $ScmToolsetGenerate = 0;                    # generate optional
81
    $ScmToolsetIFLAG3 = 1;                      # supports IFLAG3
82
    $ScmToolsetProgDependancies = 0;            # handle Prog dependancies myself
83
 
84
#.. Define the environment
85
#
86
    #
87
    #   Define initialisation targets
88
    #   These will be used to ensure that correct versions of the toolset are present
89
    #
90
    Init( "m16c" );
91
 
92
    ToolsetDefine ( "#################################################" );
93
    ToolsetDefine ( "# Mitsubishi m16c compiler" );
94
    ToolsetDefine ( "#" );
95
 
96
    ToolsetDefines( "m16c.def" );
97
    ToolsetRules  ( "m16c.rul" );
98
    ToolsetRules  ( "standard.rul" );
99
 
100
    #
101
    #   Other toolsets used
102
    #
103
#    PlatformDefine ("LINT_COFILE\t= m16c.lnt");
104
#    PlatformDefine ("LINT_PRJ_FILE\t=lint.m16c");
105
#    ToolsetRequire( "pclint" );                 # using pclint
106
 
107
 
108
#.. Extend the CompilerOption directive
109
#   Create a standard data structure
110
#   This is a hash of hashes
111
#       The first hash is keyed by CompileOption keyword
112
#       The second hash contains pairs of values to set or remove
113
#
114
    %::ScmToolsetCompilerOptions =
115
    (
116
    );
117
 
118
#
119
#   Allow .THX files to be process as 'cc' source files
120
#   Indicate that JATS is to generate objects for these files
121
#
122
AddSourceType ('.thx', '.cc' );
123
 
124
 
125
#
126
#   Install defaults
127
#    $ScmCompilerOpts{'xxxxx'} = "yyyyy";
128
#
129
 
130
}
131
 
132
##############################################################################
133
#   ToolsetPreprocess()
134
#       Process collected data before the makefile is generated
135
#       This, optional, routine is called from within MakefileGenerate()
136
#       It allows the toolset to massage any of the collected data before
137
#       the makefile is created
138
#
139
##############################################################################
140
 
141
sub ToolsetPreprocess
142
{
143
    #
144
    #   If the user has specified a Prog or Shared library, then the
145
    #   tools within this file will need to be able to access
146
    #   a few external resouces. These will be provided by packages
147
    #   that should exist
148
    #
149
    #
150
    if ( $#::TESTPROGS >= 0 || $#::PROGS >= 0 || $#::SHLIBS >= 0)
151
    {
152
        my %need = ( "fontconv.exe"     => "TOOL_FONTCONV",
153
                     "modcrc.exe"       => "TOOL_MODCRC",
154
                     "appcrc.exe"       => "TOOL_APPCRC",
155
                     "mcrpld.pl"        => "TOOL_MCRPLD",
156
                   );
157
        my %found = ();
158
 
159
        #
160
        #   Locate the required files
161
        #
162
        for my $program ( keys( %need ))
163
        {
164
            if ( my $path = ToolExtensionProgram( $program ) )
165
            {
166
                $found{ $need{$program} } = $path;
167
                delete( $need{$program} );
168
            }
169
        }
170
 
171
        ::Warning( "Tool program(s) required by toolset not found:",
172
                  sort( keys %need),
173
                  "Check that the mos_tools and mcr_tools packages are present" )
174
            if ( scalar keys %need );
175
 
176
        #
177
        #   Generate the definitions
178
        #
179
 
180
        ToolsetDefine ( "#################################################" );
181
        ToolsetDefine ( "#  The path to tools required to build MOS Programs" );
182
        ToolsetDefine ( "#" );
183
        for my $defn ( keys %found )
184
        {
185
            ToolsetDefine ( "$defn := $found{$defn}" );
186
        }
187
        ToolsetDefine ( "" );
188
    }
189
}
190
 
191
 
192
###############################################################################
193
#   ToolsetCC( $source, $obj, \@args )
194
#       This subroutine takes the user options and builds the rule(s)
195
#       required to compile the source file 'source' to 'obj'
196
#
197
###############################################################################
198
 
199
sub ToolsetCC
200
{
201
    MakePrint( "\n\t\$(CC)\n\n" );
202
}
203
 
204
 
205
 
206
###############################################################################
207
#   ToolsetCCDepend( $depend, \@sources )
208
#       This subroutine takes the user options and builds the
209
#       rule(s) required to build the dependencies for the source
210
#       files 'sources' to 'depend'.
211
#
212
###############################################################################
213
 
214
sub ToolsetCCDepend
215
{
216
    MakePrint( "\t\$(CCDEPEND)\n\n" );
217
}
218
 
219
###############################################################################
220
#   ToolsetCXX( $source, $obj, \@args )
221
#       This subroutine takes the user options and builds the rule(s)
222
#       required to compile the source file 'source' to 'obj'
223
#
224
#
225
#   In this toolset the source files WILL be .thx files that are to be
226
#   converted to "C" files and then to object files
227
#
228
#   On entry JATS has created the basic part of the recipe. The object file
229
#   is dependant on the source file and the makefile
230
#
231
#   This function must generate the body of the recipe
232
#
233
###############################################################################
234
 
235
sub ToolsetCXX
236
{
237
    my ($source, $obj, @args) = @_;
238
    my $name = $source;
239
    my $odir = "\$(OBJDIR)";
240
    my $tname = "$odir/${obj}";
241
 
242
    #
243
    #   Ensure that we have a .THX file
244
    #
245
    Error("Unknown file type: $source")
246
        unless ( $source =~ /\.thx$/i );
247
 
248
    #
249
    #   THX files are processed by:
250
    #       .thx    -> modcrc      ->   .bin
251
    #       .bin    -> fontcrc     ->   .c
252
    #       .c      -> compiler    ->   .r30
253
    #
254
    MakePrint( "\n\t\$(call THX2R30,$source,$tname)\n\n" );
255
 
256
    #
257
    #   Override the C source filename when building this target
258
    #   This is required as the C source is in the OBJ directory
259
    #
260
    MakePrint( "\$(OBJDIR)/$obj.$::o:", "\tcc_source_file=${tname}.c\n\n" );
261
 
262
 
263
    #
264
    #   Cleanup files that may be generated
265
    #
266
    ToolsetGenerate( "$tname.c" );
267
    ToolsetGenerate( "$tname.bin" );
268
    ToolsetGenerate( "$tname.thx" );
269
    ToolsetGenerate( "$tname.nul" );
270
}
271
 
272
###############################################################################
273
#   ToolsetCXXDepend( $depend, \@sources )
274
#       This subroutine takes the user options and builds the
275
#       rule(s) required to build the dependencies for the source
276
#       files 'sources' to 'depend'.
277
#
278
###############################################################################
279
 
280
sub ToolsetCXXDepend
281
{
282
}
283
 
284
###############################################################################
285
#   ToolsetAS( $source, $obj, \@args )
286
#       This subroutine takes the user options and builds the rule(s)
287
#       required to compile the source file 'source' to 'obj'
288
#
289
###############################################################################
290
 
291
sub ToolsetAS
292
{
293
    my( $source, $obj, @args) = @_;
294
    MakePrint( "\n\t\$(AS)\n" );
295
    ToolsetGenerate( "\$(OBJDIR)/$obj.lst" );
296
}
297
 
298
sub ToolsetASDepend
299
{
300
}
301
 
302
###############################################################################
303
#   ToolsetAR( $name, \@args, \@objs )
304
#       This subroutine takes the user options and builds the rules
305
#       required to build the library 'name'.
306
 
307
#
308
#   Arguments:
309
#       --xxx                   No arguments currently defined
310
#
311
#   Output:
312
#       [ $(BINDIR)/name$.${a}:   .... ]
313
#           $(AR)
314
#
315
###############################################################################
316
 
317
sub ToolsetAR
318
{
319
    my( $name, $pArgs, $pObjs ) = @_;
320
 
321
    Debug("ToolsetAR");
322
 
323
#.. Parse arguments
324
#
325
    foreach $_ ( @$pArgs ) {
326
        if (/^--/) {
327
            Message( "AR: unknown option $_ -- ignored\n" );
328
        }
329
    }
330
 
331
#.. Target
332
#
333
    MakeEntry( "\$(LIBDIR)/$name\$(GBE_TYPE).${a}:\t", "", " \\\n\t\t", ".${o}", @$pObjs );
334
 
335
#.. Build library rule (just append to standard rule)
336
#
337
    MakePrint( "\n\t\$(AR)\n\n" );
338
 
339
#.. Generated files
340
#
341
    ToolsetGenerate( "\$(LIBDIR)/$name\$(GBE_TYPE).${a}.ar" );
342
}
343
 
344
 
345
###############################################################################
346
#   ToolsetLD( $name, \@args, \@objs, \@libraries )
347
#       This subroutine takes the user options and builds the rules
348
#       required to link the program 'name'.
349
#
350
#   The process of creating a THX files consists of:
351
#       1) Link .R30 object files to create a .X30 file
352
#       2) Process the .X30 file to create a .raw file
353
#       3) Use 'modcrc' to create a .thx file
354
#       4) Use 'modcrc' to create a .mod file (a MOS .bin file)
355
#
356
#   Note: This toolset will handle the generation of the dependancies
357
#         by itself. This allows complete control over the generation
358
#         of the dependancies. Required as the process of creating
359
#         a THX is complex.
360
#
361
#   Arguments:
362
#       --Set=Name=Value            Linker -LOC data
363
#       --Rel=Name                  Rel file base for MODCRC
364
#       --NoThx                     Suppress the creation of THX files
365
#       --NoPayload                 Suppress the creation of Payload files
366
#       --MotOnly                   Only Generate the MOT file
367
#                                   Forces --NoThx and --NoPayload
368
#
369
###############################################################################
370
 
371
sub ToolsetLD
372
{
373
    my ( $name, $pArgs, $pObjs, $pLibs ) = @_;
374
    my ( @slist );
375
    my $lib = $name;
376
    my %loc_list;
377
    my ($u_rel_file, $rel_file);
378
    my $no_thx;
379
    my $no_payload;
380
    my $mot_only;
381
    my @builds;
382
 
383
#.. Parse arguments
384
#
385
    foreach $_ ( @$pArgs ) {
386
        if ( /^--Set=(.*)=(.*)/ ) {
387
            $loc_list{$1} = $2;
388
 
389
        } elsif (/^--Rel=(.*)/ ) {
390
            $u_rel_file = $1;
391
 
392
        } elsif (/^--NoThx/ ) {
393
            $no_thx = 1;
394
 
395
        } elsif (/^--NoPayload/ ) {
396
            $no_payload = 1;
397
 
398
        } elsif (/^--MotOnly/ ) {
399
            $mot_only = 1;
400
            $no_thx = 1;
401
            $no_payload = 1;
402
 
403
        } else {
404
            Message( "m16c LD: unknown option $_ -- ignored\n" );
405
        }
406
    }
407
 
408
    #
409
    #   Post processing
410
    #
411
    if ( $u_rel_file )
412
    {
413
        #
414
        #   Locate the true path of the provided REL file
415
        #   If it is a generate file it will be in the SRCS hash
416
        #   Otherwise the user will have to use Src to locate the file
417
        #
418
        $rel_file = MakeSrcResolve ( $u_rel_file );
419
    }
420
 
421
    #
422
    #   Prepare version information
423
    #
424
    my @ver_data = split( /\./, $ScmBuildVersion);
425
 
426
    #
427
    #   Create a printer tool instance
428
    #
429
    my $io = ToolsetPrinter::New();
430
 
431
    unless ( $no_payload )
432
    {
433
        ####################################################################
434
        #
435
        #   Build the .payload file from the .bin file
436
        #
437
        my $pl_file = "\$(BINDIR)/${lib}_$ver_data[0].$ver_data[1].$ver_data[2].payload";
438
        $io->Label( "Payload Module", $name );
439
        $io->Prt( "$pl_file :" .
440
                  "\\\n\t\t\$(BINDIR)/$lib.bin ".
441
                  "\n\t\t\$(call MCRPLD,$ver_data[0].$ver_data[1].$ver_data[2])\n"
442
                );
443
        $io->Newline();
444
 
445
        #
446
        #   Register generated file for cleanup
447
        #
448
        ToolsetGenerate( $pl_file );
449
 
450
        #
451
        #   Specify the files to be packaged as part of the shared library
452
        #
453
        PackageProgAddFiles( $name, $pl_file );
454
        ProgAddExtra( $name, $pl_file );
455
        push @builds, $pl_file;
456
    }
457
 
458
 
459
    unless ( $no_thx )
460
    {
461
        ####################################################################
462
        #
463
        #   Build the .thx file from the .raw file
464
        #
465
        my $rel_mod = "\$(BINDIR)/$name.rel";
466
        $io->Label( "THX Module", $name );
467
        $io->Prt( "\$(BINDIR)/$lib.thx :" .
468
                  "\\\n\t\t\$(BINDIR)/$lib.raw ".
469
                  "\\\n\t\t$rel_mod ".
470
                  "\n\t\t\$(call MODCRC,$rel_mod)\n"
471
                );
472
        $io->Newline();
473
 
474
        #
475
        #   Register generated file for cleanup
476
        #   The MODCRC process generates a .bak file. Ensure that it gets removed
477
        #
478
        ToolsetGenerate( "\$(BINDIR)/$lib.thx" );
479
        ToolsetGenerate( "\$(BINDIR)/$lib.bak" );
480
        ToolsetGenerate( "\$(BINDIR)/$lib.mod" );
481
 
482
        #
483
        #   Specify the files to be packaged as part of the shared library
484
        #
485
        PackageProgAddFiles( $name, "\$(BINDIR)/$lib.thx" );
486
        PackageProgAddFiles( $name, "\$(BINDIR)/$lib.mod" );
487
        ProgAddExtra( $name, "\$(BINDIR)/$lib.thx" );
488
        ProgAddExtra( $name, "\$(BINDIR)/$lib.mod" );
489
        push @builds, "\$(BINDIR)/$lib.thx";
490
        push @builds, "\$(BINDIR)/$lib.mod";
491
 
492
        #
493
        #   Generate the .rel files needed by MODCRC in the generation
494
        #   of the .THX file
495
        #
496
        #   Need to massage the version number
497
        #   Can't do this at 'make time'
498
        #
499
        my $ver = ($ver_data[0] << 8) + $ver_data[1];
500
 
501
        $io->Prt( "$rel_mod :" .
502
                  "\\\n\t\t$rel_file ".
503
                  "\\\n\t\t\$(GBE_PLATFORM).mk " .
504
                  "\n\t\t\$(XX_PRE)\$(echo) > $rel_mod \"version=$ver\"\n" );
505
        $io->Prt ( "\t\t\$(XX_PRE)\$(grep) < $rel_file >> $rel_mod -v \"^version\"\n" ) if($rel_file);
506
        $io->Newline();
507
        ToolsetGenerate( $rel_mod );
508
    }
509
 
510
    unless ( $mot_only )
511
    {
512
        ####################################################################
513
        #
514
        #   Build the .raw file from the .X30 file
515
        #   Build a .bin file in the process that has a version number embedded
516
        #   in the name of the file
517
        #
518
        my $bin = $lib . "_$ver_data[0].$ver_data[1].$ver_data[2]";
519
        $bin = "\$(BINDIR)/$bin.bin";
520
 
521
        $io->Label( "Raw Binary Image", $name );
522
        $io->Prt( "\$(BINDIR)/$lib.raw \\\n" .
523
                  "\$(BINDIR)/$lib.bin \\\n" .
524
                  "$bin \\\n" .
525
                  "\$(BINDIR)/$lib.mot:" .
526
                  "\\\n\t\t\$(BINDIR)/$lib.X30 ".
527
                  "\n\t\t\$(call LMC,$bin)\n"
528
                );
529
        $io->Newline();
530
 
531
        PackageProgAddFiles( $name, $bin );
532
        ProgAddExtra( $name, $bin );
533
        push @builds, $bin;
534
 
535
        PackageProgAddFiles( $name, "\$(BINDIR)/$lib.bin" );
536
        ProgAddExtra($name, "\$(BINDIR)/$lib.bin" );
537
        push @builds, "\$(BINDIR)/$lib.bin";
538
 
539
        #
540
        #   Register generated file for cleanup
541
        #
542
        ToolsetGenerate( "\$(BINDIR)/$lib.mot" );
543
        ToolsetGenerate( "\$(BINDIR)/$lib.bin" );
544
        ToolsetGenerate( $bin );
545
        ToolsetGenerate( "\$(BINDIR)/$lib.raw" );
546
 
547
    }
548
    else
549
    {
550
        ####################################################################
551
        #
552
        #   Build the .mot file from the .X30 file
553
        #   Build a .mot file that has a version number embedded in the name of the file
554
        #
555
        my $bin = $lib . "_$ver_data[0].$ver_data[1].$ver_data[2]";
556
        $bin = "\$(BINDIR)/$bin.mot";
557
 
558
        $io->Label( "MOT Image", $name );
559
        $io->Prt( "\$(BINDIR)/$lib.mot \\\n" .
560
                  "$bin:" .
561
                  "\\\n\t\t\$(BINDIR)/$lib.X30 ".
562
                  "\n\t\t\$(call LMC_MOT,$bin)\n"
563
                );
564
        $io->Newline();
565
 
566
        PackageProgAddFiles( $name, $bin );
567
        ProgAddExtra( $name, $bin );
568
        push @builds, $bin;
569
 
570
        PackageProgAddFiles( $name, "\$(BINDIR)/$lib.mot" );
571
        ProgAddExtra($name, "\$(BINDIR)/$lib.mot" );
572
        push @builds, "\$(BINDIR)/$lib.mot";
573
 
574
        #
575
        #   Register generated file for cleanup
576
        #
577
        ToolsetGenerate( "\$(BINDIR)/$lib.mot" );
578
        ToolsetGenerate( $bin );
579
    }
580
 
581
    ####################################################################
582
    #
583
    #   Build the .X30 file from the .R30 object files
584
    #
585
    $io->Label( "Link Object Files", $name );
586
    my $Xname = "\$(BINDIR)/$lib";
587
    my $Tname = "$Xname.X30";
588
 
589
    $io->Prt( "$Tname:\tSHBASE=${lib}\n" );
590
    $io->Prt( "$Tname:\tSHNAME=${lib}\n" );
591
#    $io->Prt( "$Tname:\tCFLAGS+=\$(SHCFLAGS)\n" );
592
#    $io->Prt( "$Tname:\tCXXLAGS+=\$(SHCXXFLAGS)\n" );
593
    $io->Entry( "$Tname :\t", "", "\\\n\t\t", ".$::o ", @$pObjs );
594
    $io->Prt( "\\\n\t\t\$(GBE_PLATFORM).mk " );
595
    $io->Prt( "\\\n\t\t$Xname.dep " );
596
    $io->Prt( "\n\t\$(LD)\n" );
597
    $io->Newline();
598
 
599
    #
600
    #   Add the MAP file to the program package
601
    #
602
    PackageProgAddFiles( $name, "\$(BINDIR)/${name}.map" , 'Class=map' );
603
 
604
    #
605
    #   Register generated file for cleanup
606
    #
607
    ToolsetGenerate( "$Xname.X30" );
608
    ToolsetGenerate( "$Xname.dep" );
609
    ToolsetGenerate( "$Xname.map" );
610
 
611
    ####################################################################
612
    #
613
    #   Build the linker command file
614
    #
615
    #   Now the fun part... piecing together a variable ${name}_ld
616
    #   which ends up in the command file.
617
    #
618
    $io->Label( "Linker commands", $name );     # label
619
    $io->SetTag( "${lib}_ld" );                 # command tag
620
 
621
    $io->Cmd( "-O \$(subst /,\\,$Xname.X30)" );
622
    $io->Cmd( "-G" );
623
    $io->Cmd( "-MS" );
624
    $io->Cmd( "-." );
625
 
626
    #
627
    #   User specified locations
628
    #
629
    for (keys %loc_list ) {
630
        $io->Cmd( "-LOC $_=$loc_list{$_}" );
631
    }
632
 
633
                                            # object list
634
    $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );
635
 
636
                                            # library list
637
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
638
 
639
    #
640
    #   System libraries last
641
    #
642
    $io->Cmd( "-L \$(LIB30)\\\\nc30lib.lib" );
643
 
644
 
645
    $io->Newline();
646
    ToolsetGenerate( "$Xname.ld" );
647
 
648
    ####################################################################
649
    #
650
    #   Build the linker dependancy file
651
    #   This will be used to generate associations between the .X30 file
652
    #   and libraries used to create the .X30 file
653
    #
654
    #   This information is calculated at 'make' time
655
    #
656
    $io->Label( "Linker dependancy rules", $name );     # label
657
    $io->SetTag( "${lib}_dp" );                         # command tag
658
    $io->DepRules( $lib, $pLibs,                        # library depends rules
659
            \&ToolsetLibRecipe, "$Xname.X30" );
660
 
661
    #
662
    #   Generate Shared Library dependency information
663
    #
664
    $io->LDDEPEND( $lib );                # std LDDEPEND rules
665
 
666
 
667
    #
668
    #   The Program that 'should' be created by this function does not always
669
    #   get produced. The name MUST be retained, but it is a PHONY.
670
    #   Create a recipe to build the bits we really need
671
    #
672
    my %builds;
673
    $builds{$_} = 1 foreach @builds;
674
    my $prog_target = "\$(BINDIR)/$name$exe";
675
    unless ( exists ($builds{$prog_target} ))
676
    {
677
        #
678
        $io->Label( "Phony Program", $name );
679
        $io->PrtLn( ".PHONY: $prog_target" );
680
        $io->Entry( "$prog_target :\t", "", "\\\n\t\t", "", @builds );
681
        $io->Newline();
682
    }
683
 
684
}
685
 
686
########################################################################
687
#
688
#   Generate a linker object recipe.  This is a helper function used 
689
#   within this toolset.
690
#
691
#   Arguments:
692
#       $io         I/O stream
693
#       $target     Name of the target
694
#       $obj        Library specification
695
#
696
########################################################################
697
 
698
sub ToolsetObjRecipe
699
{
700
    my ($io, $target, $obj) = @_;
701
 
702
    $io->Cmd("\$(subst /,\\\\,$obj.$::o)");
703
}
704
 
705
########################################################################
706
#
707
#   Generate a linker/depend library recipe.  This is a helper function
708
#   used within this toolset.
709
#
710
#   Arguments:
711
#       $io         I/O stream
712
#       $target     Name of the target
713
#       $lib        Library specification
714
#       $dp         If building a depend list, the full target name.
715
#
716
########################################################################
717
 
718
sub ToolsetLibRecipe
719
{
720
    my ($io, $target, $lib, $dp) = @_;
721
 
722
    if ( !defined($dp) ) {                      # linker
723
        $io->Cmd("-L @(vpath2,$lib.$::a,M16C_LIB)" );
724
 
725
    } else {                                    # depend
726
        $io->Cmd( "$dp:\t@(vlib2,$lib.$::a,M16C_LIB)" );
727
    }
728
}
729
 
730
 
731
1;
732