Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: perl; tabs: 8; indent-width: 4; show-tabs: yes; -*-
2
#
3
# Module name   : mri68k
4
# Module type   : Makefile system
5
# Compiler(s)   : ANSI C
6
# Environment(s): AMX/EOS
7
#
8
#                       ! WARNING - do not detab !
9
#
10
# Description:
11
#       MRI 68k toolset
12
#
13
# Version   Who      Date        Description
14
# 1.0       APY      07/05/99    Created
15
# 1.3       APY      06/12/99    NetTcp/NetUdp linker options
16
#                    09/12/99    ToolsetProg()
17
# 1.5                06/01/00    Linker --Kdb support
18
#                    07/01/00    ifeq "$(IFLAG)" "2"
19
#                                  around -include directives
20
#                    14/03/99    vpath2() for remove abs depend issues
21
#                    15/03/00    Wasn't build dependency list for binaries.
22
# 1.9       APY      16/03/00    --Section switch
23
# 1.10      APY      06/04/00    MRI version (4.4) support
24
#                    26/04/00    --NetTcpx
25
#           APY      13/11/00    ${exe} now embeddes '.' if required.
26
# 2.0	    APY	     26/02/02    Build system +v2 support.
27
#                                - reconstructed isp creation
28
#                                - replaced ToolsetProg() with ToolsetGenerate().
29
#                                - ToolsetCC and ToolsetCXX switch processing
30
#                    30/04/02    --Isp must allow multiple specifications.
31
#                    07/05/02    --Section
32
#
33
# $Name:  $
34
# $Source: /cvsroot/etm/devl/CFG/TOOLSET/MRI68K,v $
35
# $Revision: 1.3 $ $Date: 2004/09/03 10:25:23 $ $State: Exp $
36
# $Author: ayoung $ $Locker:  $
37
#............................................................................#
38
 
39
##############################################################################
40
#   ToolsetInit()
41
#       Runtime initialisation
42
#
43
##############################################################################
44
 
45
ToolsetInit();
46
 
47
$MriVersion                = "4.3";            # Compiler version
48
 
49
sub ToolsetInit
50
{
51
    my( @args ) = @ScmToolsetArgs;             # Toolset arguments
52
 
53
#.. Parse arguments
54
#
55
    Debug( "mri68k(@args)" );
56
 
57
    foreach $_ ( @args ) {
58
        if (/^--Version=(.*)/) {                # Compiler version
59
            $MriVersion = "$1";
60
 
61
        } else {                                # Unknown option
62
            Message( "mri68k: unknown option $_ -- ignored\n" );
63
        }
64
    }
65
 
66
#.. Standard.rul requirements
67
#
68
    $s   = asm;         # Assembler source file
69
    $o   = obj;         # Object file
70
    $a	 = lib;         # Library file
71
    $exe = "";          # Dummy, real image is either 'abs' or 'bin'
72
 
73
#.. Define MRI environment
74
#
75
    Init( "mri", "mri2" );
76
    ToolsetDefine( "#################################################" );
77
    ToolsetDefine( "# MRI compiler version" );
78
    ToolsetDefine( "#" );
79
    ToolsetDefine( "mri_ver         = $MriVersion" );
80
    ToolsetDefine( "" );
81
    ToolsetDefine( "#" );
82
    ToolsetDefines( "mri68k.def" );
83
    ToolsetRules( "mri68k.rul" );
84
    ToolsetRules( "standard.rul" );
85
}
86
 
87
###############################################################################
88
#   ToolsetCC( $source, $obj, \@args )
89
#       This subroutine takes the user options and builds the rule(s)
90
#       required to compile the source file 'source' to 'obj'
91
#
92
###############################################################################
93
 
94
sub ToolsetCC
95
{
96
    my( $source, $obj, $pArgs ) = @_;
97
 
98
    Debug( "CC:  $source -> $obj" );
99
    foreach ( @$pArgs ) {
100
        Debug( "option:    $_" );
101
	if ( /--Shared$/ ) {                    # Building a 'shared' object
102
            $cflags = "$cflags \$(SHCFLAGS)";
103
            Debug( "CC:    as shared object" );
104
 
105
        } else {                                # unknown option
106
            Message( "CC: unknown option $_ -- ignored\n" );
107
        }		
108
    }	
109
 
110
    MakePrint( "\n\t\$(CC)\n" );
111
    MakePrint( "\$(OBJDIR)/$i.${o}:\tCFLAGS +=$cflags\n" )
112
        if ( $cflags );
113
}
114
 
115
###############################################################################
116
#   ToolsetCCDepend( $depend, \@sources )
117
#       This subroutine takes the user options and builds the
118
#       rule(s) required to build the dependencies for the source
119
#       files 'sources' to 'depend'.
120
#
121
###############################################################################
122
 
123
sub ToolsetCCDepend
124
{
125
    MakePrint( "\t\$(CCDEPEND)\n" );
126
}
127
 
128
 
129
###############################################################################
130
#   ToolsetCXX( $source, $obj, \@args )
131
#       This subroutine takes the user options and builds the rule(s)
132
#       required to compile the source file 'source' to 'obj'
133
#
134
###############################################################################
135
 
136
sub ToolsetCXX
137
{
138
    MakePrint( "\n\t\$(CXX)\n" );
139
}
140
 
141
###############################################################################
142
#   ToolsetCXXDepend( $depend, \@sources )
143
#       This subroutine takes the user options and builds the
144
#       rule(s) required to build the dependencies for the source
145
#       files 'sources' to 'depend'.
146
#
147
###############################################################################
148
 
149
sub ToolsetCXXDepend
150
{
151
    #ToolsetCCDepend() handles both CC and CXX source
152
}
153
 
154
 
155
###############################################################################
156
#   ToolsetCXX( $source, $obj, \@args )
157
#       This subroutine takes the user options and builds the rule(s)
158
#       required to compile the source file 'source' to 'obj'
159
#
160
###############################################################################
161
 
162
sub ToolsetCXX
163
{
164
    my( $source, $obj, $pArgs ) = @_;
165
    my( $cflags ) = "";
166
 
167
    Debug( "CCX: $source -> $obj" );
168
    foreach ( @$pArgs ) {
169
        Debug( "option:    $_" );
170
	if ( /--Shared$/ ) {			 # Building a 'shared' object
171
            $cflags = "$cflags \$(SHCXXFLAGS)";		
172
            Debug( "CCX:    as shared object" );
173
 
174
        } else {
175
            Message( "CCX: unknown option $_ -- ignored\n" );
176
        }		
177
    }	
178
 
179
    MakePrint( "\n\t\$(CXX)\n" );		
180
    MakePrint( "\$(OBJDIR)/$i.${o}:\tCXXFLAGS +=$cflags\n" )
181
        if ( $cflags );
182
}	
183
 
184
 
185
###############################################################################
186
#   ToolsetAS( $source, $obj, \@args )
187
#       This subroutine takes the user options and builds the rule(s)
188
#       required to compile the source file 'source' to 'obj'
189
#
190
###############################################################################
191
 
192
sub ToolsetAS
193
{
194
    my( $source, $obj, $pArgs ) = @_;
195
 
196
    foreach $_ ( @$pArgs ) {
197
        Message( "CC: unknown option $_ -- ignored\n" );
198
    }	
199
 
200
    MakePrint( "\n\t\$(AS)\n" );
201
}
202
 
203
sub ToolsetASDepend
204
{
205
}
206
 
207
 
208
###############################################################################
209
#   ToolsetAR( $name, \@args, \@objs )
210
#       This subroutine takes the user options and builds the rules
211
#       required to build the library 'name'.
212
#
213
#   Arguments:
214
#       --Amx[=prefix]          local AMX configuration (defaults to platform)
215
#       --Isp=name              ISP module
216
#       --[wlib|386lib]         Librarian (todo)
217
#
218
#   Output:
219
#       [ $(LIBDIR)/name$.${a}:   .... ]
220
#           $(AR)
221
#
222
###############################################################################
223
 
224
sub ToolsetAR
225
{
226
    my( $name, $pArgs, $pObjs ) = @_;
227
    my( $amx, @isp, $insight );
228
 
229
    local( $name_ld );
230
 
231
#.. Parse arguments
232
#
233
    $amx = $insight = 0;        		# options
234
    foreach $_ ( @$pArgs ) {
235
        if (/^--Amx$/) {                        # Local AMX config
236
            $amx     = "\$(SCM_PLATFORM)";
237
        } elsif (/^--Amx=(.*)/) {               # Specific AMX config
238
            $amx     = "$1";
239
        } elsif (/^--Isp=(.*)/) {               # ISP module
240
	    push( @isp, "$1" );
241
 
242
        } elsif (/^--Insight$/) {               # Enable insight
243
            $insight = 1;
244
        } elsif (/^--Insight=(.*)/) {           # Specific insight
245
            $insight = "$1";
246
 
247
        } else {
248
            Message( "AR: unknown option $_ -- ignored\n" );
249
        }
250
    }
251
 
252
#.. Standard library builds, plus AMX configuration				
253
#			
254
    MakeEntry( "\$(LIBDIR)/$name\$(SCM_TYPE).${a}:\t",
255
                  "", "\\\n\t\t", ".${o} ", @$pObjs );
256
 
257
#.. Build library with AMX configuration
258
#
259
    foreach (@isp) {
260
        AmxLibISP( $name, $_ );
261
    }
262
    AmxLib( $name, $amx, $insight )
263
        if ( $amx );
264
 
265
#.. Build library rule (just append to standard rule)
266
#
267
    MakePrint( "\n\t\$(AR)\n\n" );
268
}
269
 
270
 
271
###############################################################################
272
#   ToolsetLD( $name, \@args, \@objs, \@libraries )
273
#       This subroutine takes the user options and builds the rules
274
#       required to link the program 'name'.
275
#
276
#   Arguments:
277
#       EOS specific:
278
#       --Eos                   EOS application
279
#       --Eosx                  Extended EOS application
280
#       --EosRom                EOS BOOTROM application
281
#       --EosRomx               Extended EOS BOOTROM application
282
#       --NetUdp[P]             Networking with UDP support
283
#       --NetTcp[P]             Networking with TCP support (static routing)
284
#       --NetTcpx[P]            Networking with TCP support (router)
285
#       --Kdb                   Kernel debugger
286
#
287
#       AMX specific:
288
#       --Amx[=prefix]          Local AMX configuration (defaults to platform)
289
#       --Isp=name              ISP module
290
#       --Insight[=prefix]      Enable insight (default to platform.icf)
291
#                               (incomplete)
292
#
293
#       Linker specific:
294
#       --Bin=LoadAddr          Download image
295
#       --Abs                   Absoluate image (Powerscope/VisionClick)
296
#       --Section=...           Linker sector order directives
297
#
298
#   Output:                     (also mri68k.rul)
299
#
300
# 	$(BINDIR)/name${exe}:
301
#       	        $(BINDIR)/name.dep \
302
#       	        $(BINDIR)/name.[abs|bin]
303
#
304
#       .PHONY:                 $(BINDIR)/name${exe}:
305
#
306
#       $(BINDIR)/name.dep:     $(SCM_PLATFORM).mk
307
#               $(LDDEPEND)
308
#
309
#       ifeq "$(IFLAG)" "2"
310
#       -include	"$(BINDIR)/name.dep"
311
#       endif
312
#
313
# 	$(BINDIR)/name.[abs|bin]
314
#                       objs ...
315
#               {$(LDABS)|$(LDBIN)}
316
#
317
#       name_ld += ...  Linker command file
318
#           :
319
#
320
#       name_dp += ...  Dependency list
321
#           :
322
#
323
###############################################################################
324
 
325
sub ToolsetLD
326
{
327
    my( $name, $pArgs, $pObjs, $pLibs ) = @_;
328
    my( $linker, $flags, $amx, $insight );
329
    my( $laddr, $lsize, $section );
330
    my( $cond );
331
    local( $varname );
332
 
333
#.. Parse arguments
334
#
335
    $amx = $flags = $insight = 0;               # generic options
336
    $section = ""; $laddr = 0;                  # toolset options
337
 
338
    foreach $_ ( @$pArgs )
339
    {
340
    #.. EOS
341
    #
342
        if (/--Eos$/) {                         # EOS standard
343
            $flags     = $flags | $EOS_LNK;
344
        } elsif (/^--Eosx$/) {                  # EOS extended
345
            $flags     = $flags | $EOS_LNK | $EOS_EXT;
346
        } elsif (/^--EosRom$/) {                # ROM image
347
            $flags     = $flags | $EOS_LNK | $EOS_ROM;
348
        } elsif (/^--EosRomx$/) {               # ROM image extended
349
            $flags     = $flags | $EOS_LNK | $EOS_ROM | $EOS_EXT;
350
 
351
        } elsif (/^--NetUdp$/) {
352
            $flags     = $flags | $NET_UDP;
353
        } elsif (/^--NetTcp$/) {                # TCP with static router
354
            $flags     = $flags | $NET_TCP;
355
        } elsif (/^--NetTcpx$/) {               # TCP with router
356
            $flags     = $flags | $NET_TCP | $NET_ROUTER;
357
 
358
        } elsif (/^--NetUdpP$/) {
359
            $flags     = $flags | $NET_UDP | $NET_PROD;
360
        } elsif (/^--NetTcpP$/) {               # TCP with static router
361
            $flags     = $flags | $NET_TCP | $NET_PROD;
362
        } elsif (/^--NetTcpxP$/) {              # TCP with router
363
            $flags     = $flags | $NET_TCP | $NET_ROUTER | $NET_PROD;
364
 
365
        } elsif (/^--Kdb/) {                    # Kernel debugger
366
            $flags = $flags | $EOS_KDB;
367
 
368
    #.. AMX
369
    #
370
        } elsif (/^--Amx$/) {                   # Local AMX config
371
            $amx     = "\$(SCM_PLATFORM)";
372
        } elsif (/^--Amx=(.*)/) {               # Specific AMX config
373
            $amx     = "$1";
374
 
375
        } elsif (/^--Isp=(.*)/) {               # ISP module
376
            if ( ! $flags && ! $amx ) {
377
                Message( "LD: --Isp requires either a EOS or AMX application");
378
            } else {
379
                AmxLinkISP( $name, "$1", $pObjs, $pLibs );
380
            }
381
 
382
        } elsif (/^--Insight$/) {               # Enable insight
383
            $insight = "\$(SCM_PLATFORM)";
384
        } elsif (/^--Insight=(.*)/) {           # Specific insight
385
            $insight = "$1";
386
 
387
    #.. Target specific
388
    #
389
        } elsif (/^--Abs/) {                    # Absolute image
390
            $lsize = $lsize = "";
391
 
392
        } elsif (/^--Bin$/) {                   # Binary 'S-Record' image
393
            $flags = $flags | $EOS_BIN;
394
            $laddr = "0";                       # Load address
395
 
396
        } elsif (/^--Bin=(.*)/) {               # Download image
397
            $flags = $flags | $EOS_BIN;
398
            $laddr = "$1";                      # Load address
399
 
400
        } elsif (/^--Bin=(.*),(.*)/) {          # Download image
401
            $flags = $flags | $EOS_BIN;
402
            $laddr = "$1";                      # Load address
403
            $lsize = "$2";                      # Image size
404
 
405
        } elsif (/^--Section=(.*)/) {           # Section directives
406
            $section = "$1";
407
 
408
    #.. Toolset specific
409
    #
410
        } else {
411
            Message( "LD: unknown option $_ -- ignored\n" );
412
        }
413
    }
414
 
415
#.. Command file, EOS and/or AMX dependencies
416
#
417
#   Library search order,
418
#	Application
419
#	EOS
420
#	AMX
421
#	Toolset
422
#
423
    if ( $flags & $EOS_LNK ) {
424
        EosLink( $name, $flags, $pObjs, $pLibs );
425
        if ( $amx ) {
426
            AmxLinkCfg( $name, $amx, $insight, $pObjs, $pLibs );
427
        } else {
428
            AmxLinkStd( $name, $pObjs, $pLibs );
429
        }
430
    } elsif ( $amx ) {
431
        AmxLinkCfg( $name, $amx, $insight, $pObjs, $pLibs );
432
    }
433
    push( @$pLibs, "\$(mri)/68020/mcc68kab" );
434
 
435
#.. Link rules
436
#
437
if ($flags & $EOS_BIN) 
438
{
439
    MakePrint( "\\\n\t\t\$(BINDIR)/${name}.dep " .
440
               "\\\n\t\t\$(BINDIR)/${name}.bin\n\n" .
441
               ".PHONY:\t\t\t\$(BINDIR)/${name}${exe}\n\n" );
442
 
443
    MakePrint( "\$(BINDIR)/${name}.dep:\t\$(SCM_PLATFORM).mk\n".
444
 	            "\t\$(LDDEPEND)\n\n" );
445
 
446
    MakePrint( "ifeq \"\$(IFLAG)\" \"2\"\n" .
447
               "-include\t\$(BINDIR)/${name}.dep\n" .
448
               "endif\n\n" );
449
 
450
    MakePrint( "\$(BINDIR)/${name}.bin:\tLADDR=$laddr\n" )
451
        if ( $laddr );
452
    MakePrint( "\$(BINDIR)/${name}.bin:\tLSIZE=$lsize\n" )
453
        if ( $lsize );
454
 
455
    MakePrint( "\$(BINDIR)/${name}.bin:" );
456
    foreach $i ( @$pObjs ) {
457
        MakePrint( " \\\n\t\t$i.${o}" );
458
    }
459
    MakePrint( "\n\t\$(LDBIN)\n" );
460
}
461
else
462
{
463
    MakePrint( "\\\n\t\t\$(BINDIR)/${name}.dep " .
464
               "\\\n\t\t\$(BINDIR)/${name}.abs\n\n" .
465
               ".PHONY:\t\t\t\$(BINDIR)/${name}${exe}\n\n" );
466
 
467
    MakePrint( "\$(BINDIR)/${name}.dep:\t\$(SCM_PLATFORM).mk\n".
468
 	            "\t\$(LDDEPEND)\n\n" );
469
 
470
    MakePrint( "ifeq \"\$(IFLAG)\" \"2\"\n" .
471
               "-include\t\$(BINDIR)/${name}.dep\n" .
472
               "endif\n\n" );
473
 
474
    MakePrint( "\$(BINDIR)/${name}.abs:" );
475
    foreach $i ( @$pObjs ) {
476
        MakePrint( " \\\n\t\t$i.${o}" );
477
    }
478
    MakePrint( "\n\t\$(LDABS)\n" );
479
}
480
    MakePrint( "\n" );
481
 
482
#.. Cleanup rules
483
#
484
    ToolsetGenerate( "\$(BINDIR)/${name}.ld" );
485
    ToolsetGenerate( "\$(BINDIR)/${name}.dep" );
486
if ($laddr) {
487
    ToolsetGenerate( "\$(BINDIR)/${name}.bin" );
488
} else {
489
    ToolsetGenerate( "\$(BINDIR)/${name}.abs" );
490
}
491
    ToolsetGenerate( "\$(BINDIR)/${name}.map" );
492
 
493
#.. Linker command file
494
#
495
#       Now the fun part... piecing together a variable $(name_ld)
496
#       which ends up in the command file.
497
#
498
    $varname = "${name}_ld";
499
    sub VarCmd {
500
        MakeQuote "$varname += @_\\n\n";
501
    }
502
    sub VarPrt {
503
        MakePrint "@_\n";
504
    }
505
 
506
       VarCmd("CASE");                          #preserve symbols case
507
       VarCmd("WARN	356");                  #warning for undef sections
508
       VarCmd("CHIP	CPU32");                #68xxx (68332/68340/68341)
509
       VarCmd("INITDATA	vars");                 #initialise 'vars' section
510
 
511
   if ($section) {
512
       VarPrt("#.. User specified section directives");
513
       VarCmd("$section");
514
 
515
   } else {
516
    if (($flags & $EOS_LNK) || $amx) {
517
 
518
     if ($flags & $EOS_ROM) {                   #BOOTROM
519
      if ($flags & $EOS_BIN) {
520
       VarPrt("#.. Linking an EOS-AMX/ROM image (Binary image)");
521
      } else {
522
       VarPrt("#.. Linking an EOS-AMX/ROM image (Powerscope image)");
523
      }
524
 
525
       VarCmd("extern	_BootVectors");         #create an external reference
526
       VarCmd("alias	code CODE");            #CODE alias
527
       VarCmd("align	vectors 4");            #align on quad boundaries
528
       VarCmd("align	ramVectors 4");         #..
529
       VarCmd("align	header 4");             #..
530
       VarCmd("align	(CODE)=4");             #..
531
       VarCmd("align	(DATA)=4");             #..
532
       VarCmd("align	(ROMDATA)=4");          #..
533
 
534
      if ($flags & $EOS_ROM) {
535
       VarCmd("order	SysRom");               #boot ROM/flash
536
      } else {
537
       VarCmd("order	SysRam");
538
      }
539
       VarCmd("order	vectors,header,startup,code");
540
       VarCmd("order	const,literals,strings,??INITDATA");
541
 
542
      if ($flags & $EOS_ROM) {
543
       # Note:  Shall generate a order warning if the ROM load address
544
       #        is NOT positioned at $0.
545
       #
546
       # eg.    "(374) ORDER command could not be obeyed for section SysRam."
547
       #..
548
       VarCmd("order	SysRam,PLoadEnv");      #program loader RAM
549
      }
550
 
551
       VarCmd("order	preserve,protected,ramVectors");
552
       VarCmd("order	vars,zerovars");        #MRI specific
553
       VarCmd("order	ioports,tags");         #..
554
       VarCmd("order	0")                     #..
555
          if ($MriVersion ne "4.4");
556
 
557
       VarCmd("order	BootStack,BootData");
558
 
559
     } else {                                   #application
560
      if ($flags & $EOS_BIN) {
561
       VarPrt("#.. Linking an EOS-AMX/Application image (Binary image)");
562
      } else {
563
       VarPrt("#.. Linking an EOS-AMX/Application image (Powerscope image)");
564
      }
565
 
566
       VarCmd("extern	_AsReset");             #create an external reference
567
       VarCmd("alias	code CODE");            #CODE alias
568
       VarCmd("align	vectors 4");            #align on quad boundaries
569
       VarCmd("align	ramVectors 4");         #..
570
       VarCmd("align	header 4");             #..
571
       VarCmd("align	(CODE)=4");             #..
572
       VarCmd("align	(DATA)=4");             #..
573
       VarCmd("align	(ROMDATA)=4");          #..
574
       VarCmd("order	SysRam");               #define sections to go into RAM
575
                                                #EOS/AS (start of RAM)
576
       VarCmd("order	preserve,protected,ramVectors");
577
       VarCmd("order	vars,zerovars");        #MRI specific
578
       VarCmd("order	ioports,tags");         #..
579
       VarCmd("order	0")                     #..
580
          if ($MriVersion ne "4.4");
581
       VarCmd("order	stack");                #application stack
582
 
583
       if ($flags & $EOS_BIN) {
584
        VarCmd("order	SysFlash");             #code image into FLASH
585
       }
586
 
587
       VarCmd("order	header,vectors");       #EOS/AS (start of FLASH)
588
       VarCmd("order	startup,code");         #..
589
       VarCmd("order	const");                #constant data sections
590
       VarCmd("order	literals");
591
       VarCmd("order	strings");
592
       VarCmd("order	??INITDATA");           #data to copy into RAM
593
     }
594
    } else {
595
       VarPrt("#.. Link a generic 68k image");
596
       VarCmd("sect	vectors  0000");
597
       VarCmd("sectsize	vectors= 1024");
598
       VarCmd("common	stack=   1024");
599
       VarCmd("sectsize	stack=   4096");
600
       VarCmd("order	vectors,stack,code");
601
       VarCmd("order	literals,strings,const");
602
       VarCmd("order	??INITDATA,vars,zerovars");
603
    }
604
}
605
 
606
        VarPrt("#.. The following are cmdfile macros, with libraries");
607
        VarPrt("#   repeated due to single pass linker wierdness");
608
    foreach $i ( @$pObjs ) {
609
        VarCmd("LOAD	@(dosify,$i.${o})" );
610
    }
611
 
612
                                                # Libraries
613
    $cond = "";
614
    foreach $_ ( @$pLibs ) {
615
        if (/^--ifdef=(.*)/) {                  # .. conditionals
616
            $cond = "$1";
617
            VarPrt( "ifdef $cond" );
618
            next;
619
        } elsif (/^--ifndef=(.*)/) {
620
            $cond = "$1";
621
            VarPrt( "ifndef $cond" );
622
            next;
623
        } elsif (/^--*/) {                      # .. unknown
624
            Message( "LD: unknown lib option $_ -- ignored\n" );
625
            next;
626
        }
627
                                                # .. entry
628
        VarCmd("LOAD	@(dosify,@(vpath2,$_.${a},MRI_LIB))" );
629
 
630
        if ($cond) {                            # .. end condition
631
            VarPrt("endif\t# $cond");
632
            $cond = "";
633
        }
634
    }
635
 
636
                                                # single pass linker wierdness
637
    foreach $_ ( @$pLibs ) {
638
        if (/^--ifdef=(.*)/) {                  # .. conditionals
639
            $cond = "$1";
640
            VarPrt( "ifdef $cond" );
641
            next;
642
        } elsif (/^--ifndef=(.*)/) {
643
            $cond = "$1";
644
            VarPrt( "ifndef $cond" );
645
            next;
646
        } elsif (/^--*/) {                      # .. unknown (warning only once)
647
            next;
648
        }
649
                                                # .. entry
650
        VarCmd("LOAD	@(dosify,@(vpath2,$_.${a},MRI_LIB))" );
651
 
652
        if ($cond) {                            # .. end condition
653
            VarPrt("endif\t# $cond");
654
            $cond = "";
655
        }
656
    }
657
 
658
 
659
        VarPrt("#.. Map file options");
660
        VarCmd("LISTABS	INTERNALS, PUBLICS");
661
        VarCmd("LISTMAP	LENGTH 64");            # map file page length");
662
        VarCmd("LISTMAP	CROSSREF,INTERNALS,PUBLICS/by_addr");
663
        VarCmd("DEBUG_SYMBOLS");
664
        VarCmd("END");
665
        VarPrt( "" );
666
 
667
#.. Dependency link,
668
#
669
#       Now piece together a variable $(name_dp) which ends up in
670
#       the command file building the application dependency list.
671
#
672
    $varname = "${name}_dp";
673
 
674
    $cond = "";
675
    foreach $_ ( @$pLibs ) {
676
        if (/^--ifdef=(.*)/) {               # .. conditionals
677
            $cond = "$1";
678
            VarPrt( "ifdef $cond\n" );
679
            next;
680
        } elsif (/^--ifndef=(.*)/) {
681
            $cond = "$1";
682
            VarPrt( "ifndef $cond\n" );
683
            next;
684
        } elsif (/^--*/) {                   # .. unknown (warning only once)
685
            next;
686
        }
687
                                             # .. entry
688
        if ($laddr) {
689
             VarCmd("\$(BINDIR)/${name}.bin:	@(vpath2,$_.${a},MRI_LIB)" );
690
        } else {
691
             VarCmd("\$(BINDIR)/${name}.abs:	@(vpath2,$_.${a},MRI_LIB)" );
692
        }
693
 
694
        if ($cond) {                         # .. end condition
695
            VarPrt("endif\t# $cond\n");
696
            $cond = "";
697
        }
698
    }
699
 
700
#end ...
701
}
702
 
703
#.. Successful termination
704
1;
705