Subversion Repositories DevTools

Rev

Rev 6177 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6177 Rev 6276
Line 1... Line -...
1
# -*- mode: perl; tabs: 8; indent-width: 4; show-tabs: yes; -*-
-
 
2
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
1
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
3
#
2
#
4
# Module name   : mos_mri
3
# Module name   : mos_mri
5
# Module type   : Makefile system
4
# Module type   : Makefile system
6
# Compiler(s)   : ANSI C
5
# Compiler(s)   : ANSI C
Line 11... Line 10...
11
#       This file provides Toolset initialisation and plugin functions
10
#       This file provides Toolset initialisation and plugin functions
12
#       to makelib.pl2
11
#       to makelib.pl2
13
#
12
#
14
# Contents:     MRI 68k/CF rules as used for the MOS
13
# Contents:     MRI 68k/CF rules as used for the MOS
15
#
14
#
16
# Revision History:
-
 
17
#       12-Feb-04   DDP     Started Work
-
 
18
#............................................................................#
15
#............................................................................#
19
 
16
 
20
use strict;
17
use strict;
21
use warnings;
18
use warnings;
22
 
19
 
Line 26... Line 23...
26
my $Toolset_DebugCode;
23
my $Toolset_DebugCode;
27
my $Toolset_DebugData;
24
my $Toolset_DebugData;
28
my $Toolset_Product = '';
25
my $Toolset_Product = '';
29
my $Toolset_Production_Only;
26
my $Toolset_Production_Only;
30
 
27
 
-
 
28
my $globName = 'glob$(GBE_TYPE)';               # Name of the MOS global library file
31
 
29
 
32
##############################################################################
30
##############################################################################
33
#   ToolsetInit()
31
#   ToolsetInit()
34
#       Runtime initialisation
32
#       Runtime initialisation
35
#
33
#
Line 274... Line 272...
274
        #   To enable 32-bit relative PC addressing on platforms that
272
        #   To enable 32-bit relative PC addressing on platforms that
275
        #   don't have this as a default
273
        #   don't have this as a default
276
        #
274
        #
277
        'longrelative'    => { 'USE_32BIT_RELATIVE' , '1' },
275
        'longrelative'    => { 'USE_32BIT_RELATIVE' , '1' },
278
        'nolongrelative'  => { 'USE_32BIT_RELATIVE' , undef },
276
        'nolongrelative'  => { 'USE_32BIT_RELATIVE' , undef },
-
 
277
 
-
 
278
        #
-
 
279
        #   Flag the buildng of the MOS OS
-
 
280
        #   
-
 
281
        'buildmosos'     => {'BUILD_MOS_OS', '1'},
279
        
282
        
280
    );
283
    );
281
 
284
 
282
    #
285
    #
283
    #   Set default options
286
    #   Set default options
284
    #       $::ScmCompilerOpts{'xxxx'} = 'yyy';
287
    #       $::ScmCompilerOpts{'xxxx'} = 'yyy';
285
    $::ScmCompilerOpts{'MODE_CCSUPERVISOR'} = '0';
288
    $::ScmCompilerOpts{'MODE_CCSUPERVISOR'} = '0';
286
    $::ScmCompilerOpts{'NO_OPT_GLOBAL'} = undef;
289
    $::ScmCompilerOpts{'NO_OPT_GLOBAL'} = undef;
287
    $::ScmCompilerOpts{'USE_32BIT_RELATIVE'} = undef;
290
    $::ScmCompilerOpts{'USE_32BIT_RELATIVE'} = undef;
-
 
291
    $::ScmCompilerOpts{'BUILD_MOS_OS'} = undef;
288
}
292
}
289
 
293
 
290
##############################################################################
294
##############################################################################
291
#   ToolsetPreprocess()
295
#   ToolsetPreprocess()
292
#       Process collected data before the makefile is generated
296
#       Process collected data before the makefile is generated
Line 330... Line 334...
330
                  sort( keys %need),
334
                  sort( keys %need),
331
                  "Check that the daf_tools and mos_tools packages are present" )
335
                  "Check that the daf_tools and mos_tools packages are present" )
332
            if ( scalar keys %need );
336
            if ( scalar keys %need );
333
 
337
 
334
        #
338
        #
-
 
339
        #   Determine the name of the MOS global library
-
 
340
        #   Old MOS builds provided a library named glob.lib
-
 
341
        #   Newer MOS builds provide a library name globP.lib or globD.lib
-
 
342
        #       When building the MOS OS use the newer form
-
 
343
        #
-
 
344
        my $globFound = '';
-
 
345
        my $globJatsFound = '' ;
-
 
346
        unless ($::ScmCompilerOpts{'BUILD_MOS_OS'}) {
-
 
347
            foreach my $entry ( getPackageList() ) {
-
 
348
                foreach my $libdir ($entry->getLibDirs(3)) {
-
 
349
                    $globFound     = $libdir if ( -f CatPaths($libdir, 'glob.lib') );
-
 
350
                    $globJatsFound = $libdir if ( -f CatPaths($libdir, 'globP.lib') );
-
 
351
                    $globJatsFound = $libdir if ( -f CatPaths($libdir, 'globD.lib') );
-
 
352
                }
-
 
353
            }
-
 
354
 
-
 
355
            unless ($globJatsFound) {
-
 
356
                $globName = 'glob';
-
 
357
            }
-
 
358
        }
-
 
359
 
-
 
360
        if ($globFound && $globJatsFound ) {
-
 
361
            Warning("Both glob.lib and glob[PD].lib found - using glob.lib")
-
 
362
        }
-
 
363
        ::Debug("Glob library: $globName");
-
 
364
 
-
 
365
        #
335
        #   Generate the definitions
366
        #   Generate the definitions
336
        #
367
        #
337
 
368
 
338
        ToolsetDefine ( "#################################################" );
369
        ToolsetDefine ( "#################################################" );
339
        ToolsetDefine ( "#  The path to tools required to build MOS Programs" );
370
        ToolsetDefine ( "#  The path to tools required to build MOS Programs" );
Line 641... Line 672...
641
#
672
#
642
#   Locate the true path of the head.asm file
673
#   Locate the true path of the head.asm file
643
#   This WILL be located within an external package as it is provided
674
#   This WILL be located within an external package as it is provided
644
#   by the MOS hardware package.
675
#   by the MOS hardware package.
645
#
676
#
-
 
677
if ($::ScmCompilerOpts{'BUILD_MOS_OS'})
-
 
678
{
-
 
679
    # Building the MOS OS
-
 
680
    # The head.asm file will be foound in the local in directory
-
 
681
    $head_file = '$(INCDIR_LOCAL)/head.asm';
-
 
682
}
-
 
683
else
-
 
684
{
-
 
685
    #
-
 
686
    #   Non-OS build
-
 
687
    #   The head.asm file will be found in an external package
-
 
688
    #   
646
    $head_file = MakeSrcResolveExtended ( 1, "head.asm" );
689
        $head_file = MakeSrcResolveExtended ( 1, "head.asm" );
-
 
690
}
647
 
691
 
648
#
692
#
649
#   If we are also creating an import (stub) library then remove
693
#   If we are also creating an import (stub) library then remove
650
#   the stub library object file from the list of user provided objects
694
#   the stub library object file from the list of user provided objects
651
#   Done to allow the use of @OBJS in a library object list
695
#   Done to allow the use of @OBJS in a library object list
Line 665... Line 709...
665
#   Extend the list of libraries with MOS specific libraries
709
#   Extend the list of libraries with MOS specific libraries
666
#   This list may need multiple passes and will be replicated. Do not include
710
#   This list may need multiple passes and will be replicated. Do not include
667
#   the compiler RTL library in this list as it will cause problems. It must be
711
#   the compiler RTL library in this list as it will cause problems. It must be
668
#   linked last and linked only once.
712
#   linked last and linked only once.
669
#
713
#
670
    push( @$pLibs, 'glob' );
714
    push( @$pLibs, $globName );
671
 
715
 
672
#   Create a list of system (RTL) libraries
716
#   Create a list of system (RTL) libraries
673
#   We only want to use the compiler RTL library as a last resort and will only
717
#   We only want to use the compiler RTL library as a last resort and will only
674
#   make one pass over it.
718
#   make one pass over it.
675
#
719
#
Line 907... Line 951...
907
#
951
#
908
#                 This class ISA ToolsetPrinter too
952
#                 This class ISA ToolsetPrinter too
909
#
953
#
910
# Parameters    : name      - Basic name of the library
954
# Parameters    : name      - Basic name of the library
911
#                 pObjs     - Ref to an array of object files to be linked
955
#                 pObjs     - Ref to an array of object files to be linked
912
#                 pLibs     - Ref to an array of librarus to be linked
956
#                 pLibs     - Ref to an array of libraries to be linked
913
#                 pSlibs    - Ref to an array of system libraries to be linked
957
#                 pSlibs    - Ref to an array of system libraries to be linked
914
#                             These libraries will only be linked ONCE
958
#                             These libraries will only be linked ONCE
915
#
959
#
916
package ABSRuleGenerator;
960
package ABSRuleGenerator;
917
 
961
 
Line 1024... Line 1068...
1024
    #   Must load GLOB.LIB first so that "well-known" variables
1068
    #   Must load GLOB.LIB first so that "well-known" variables
1025
    #   in zerovars are at a known location
1069
    #   in zerovars are at a known location
1026
    #
1070
    #
1027
    $io->Prt("#   Load the Global Library first\n");
1071
    $io->Prt("#   Load the Global Library first\n");
1028
    $io->Newline();
1072
    $io->Newline();
1029
    $io->LibList( $name, ["glob"], \&ToolsetLibRecipe );
1073
    $io->LibList( $name, [$globName], \&ToolsetLibRecipe );
1030
    $io->Newline();
1074
    $io->Newline();
1031
 
1075
 
1032
    $io->Prt("#   Load the module header and target specfic library\n");
1076
    $io->Prt("#   Load the module header and target specfic library\n");
1033
    $io->Prt("#\n");
1077
    $io->Prt("#\n");
1034
    $io->Cmd("LOAD    \$(OBJDIR)/${name}/head.$::o" );
1078
    $io->Cmd("LOAD    \$(OBJDIR)/${name}/head.$::o" );
Line 1038... Line 1082...
1038
    $io->Prt("#\n");
1082
    $io->Prt("#\n");
1039
 
1083
 
1040
    $io->ObjList( $name, \@allObjs, \&ToolsetObjRecipe );
1084
    $io->ObjList( $name, \@allObjs, \&ToolsetObjRecipe );
1041
    $io->Newline();
1085
    $io->Newline();
1042
 
1086
 
1043
    $io->Prt("#   Load the library files twice to overcome single pass linker problems\n");
1087
    $io->Prt("#   Load the library files three times to overcome single pass linker problems\n");
1044
    $io->Prt("#\n");
1088
    $io->Prt("#\n");
1045
 
1089
 
1046
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
1090
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
1047
    $io->Newline();
1091
    $io->Newline();
1048
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
1092
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );