Subversion Repositories DevTools

Rev

Rev 261 | Details | Compare with Previous | 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   : TOOLSET/gnupro_h8
4
# Module type   : Makefile system
5
# Environment(s):
6
#
7
# Description:
8
#   Cygnus C/C++ toolset
9
#   A very simple toolset to support
10
#       1) C/C++ compiliation
11
#       2) Generation of libaries
12
#       3) Merging of libraries
13
#
14
#   Does not support ( because its not needed )
15
#       a) Shared libraries
16
#       b) Executables
17
#       c) Assembler files
18
#
19
# Version   Who   Date     Description
20
#           DDP   23-Nov-04 Created
21
#............................................................................#
22
 
23
##############################################################################
24
#   ToolsetInit()
25
#       Runtime initialisation
26
#
27
##############################################################################
28
 
29
ToolsetInit();
30
 
31
sub ToolsetInit
32
{
33
    my $GnuProVersion = "2.95.2 19991024";
34
 
35
#.. Parse arguments
36
#
37
    foreach $_ ( @args ) {
38
        Message( "gnupro_h8: unknown option $_ -- ignored\n" );
39
    }
40
 
41
#.. Standard.rul requirements
42
#
261 dpurdie 43
    $s = 'asm';
44
    $o = 'o';
45
    $a = 'a';
227 dpurdie 46
    $exe = "";
47
 
48
#.. Define environment
49
#
50
    Init( "gnupro_h8" );
51
 
52
    ToolsetDefine( "#################################################" );
53
    ToolsetDefine( "# Compiler version" );
54
    ToolsetDefine( "#" );
55
    ToolsetDefine( "GnuPro_Version      = \"$GnuProVersion\"" );
56
    ToolsetDefine( "" );
57
    ToolsetDefine( "#" );
58
 
59
    ToolsetDefines( "gnupro_h8.def" );
60
    ToolsetRules  ( "gnupro_h8.rul" );
61
    ToolsetRules  ( "standard.rul" );
62
}
63
 
64
 
65
###############################################################################
66
#   ToolsetCC( $source, $obj, \@args )
67
#       This subroutine takes the user options and builds the rule(s)
68
#       required to compile the source file 'source' to 'obj'
69
#
70
###############################################################################
71
 
72
sub ToolsetCC
73
{
74
    my( $source, $obj, $pArgs ) = @_;
75
 
76
    Debug( "CC:  $source -> $obj" );
77
    foreach ( @$pArgs ) {
78
        Debug( "option:    $_" );
79
        if ( /--Shared$/ ) {                    # Building a 'shared' object
80
            $cflags = "$cflags \$(SHCFLAGS)";
81
            Debug( "CC:    as shared object" );
82
        } else {                                # unknown option
83
            Message( "CC: unknown option $_ -- ignored\n" );
84
        }
85
    }
86
 
87
    MakePrint( "\n\t\$(CC)\n" );
88
    MakePrint( "\$(OBJDIR)/$i.${o}:\tCFLAGS +=$cflags\n" )
89
        if ( $cflags );
90
}
91
 
92
###############################################################################
93
#   ToolsetCCDepend( $depend, \@sources )
94
#       This subroutine takes the user options and builds the
95
#       rule(s) required to build the dependencies for the source
96
#       files 'sources' to 'depend'.
97
#
98
###############################################################################
99
 
100
sub ToolsetCCDepend
101
{
102
    MakePrint( "\t\$(CCDEPEND)\n" );
103
}
104
 
105
 
106
###############################################################################
107
#   ToolsetCXX( $source, $obj, \@args )
108
#       This subroutine takes the user options and builds the rule(s)
109
#       required to compile the source file 'source' to 'obj'
110
#
111
###############################################################################
112
 
113
sub ToolsetCXX
114
{
115
    my( $source, $obj, $pArgs ) = @_;
116
    my( $cflags ) = "";
117
 
118
    Debug( "CCX: $source -> $obj" );
119
    foreach ( @$pArgs ) {
120
        Debug( "option:    $_" );
121
        if ( /--Shared$/ ) {                    # Building a 'shared' object
122
            $cflags = "$cflags \$(SHCXXFLAGS)";
123
            Debug( "CCX:    as shared object" );
124
        } else {
125
            Message( "CCX: unknown option $_ -- ignored\n" );
126
        }
127
    }
128
 
129
    MakePrint( "\n\t\$(CXX)\n" );
130
    MakePrint( "\$(OBJDIR)/$i.${o}:\tCXXFLAGS +=$cflags\n" )
131
        if ( $cflags );
132
}
133
 
134
 
135
###############################################################################
136
#   ToolsetCXXDepend( $depend, \@sources )
137
#       This subroutine takes the user options and builds the
138
#       rule(s) required to build the dependencies for the source
139
#       files 'sources' to 'depend'.
140
#
141
###############################################################################
142
 
143
sub ToolsetCXXDepend
144
{
287 dpurdie 145
    ToolsetCCDepend();
227 dpurdie 146
}
147
 
148
###############################################################################
149
#   ToolsetAR( $name, \@args, \@objs )
150
#       This subroutine takes the user options and builds the rules
151
#       required to build the library 'name'.
152
#
153
#   Arguments:
154
#       n/a
155
#
156
#   Output:
157
#       [ $(BINDIR)/name$.${a}:   .... ]
158
#           $(AR)
159
#
160
###############################################################################
161
 
162
sub ToolsetAR
163
{
164
    my( $name, $pArgs, $pObjs ) = @_;
165
 
166
#.. Parse arguments
167
#
168
    foreach $_ ( @$pArgs ) 
169
    {
170
        Message( "AR: unknown option $_ -- ignored\n" );
171
    }
172
 
173
#
174
    MakeEntry( "\$(LIBDIR)/$name\$(GBE_TYPE).${a}:\t", "", " \\\n\t\t", ".${o}", @$pObjs );
175
 
176
#.. Build library rule (just append to standard rule)
177
#
178
    MakePrint( "\n\t\$(AR)\n\n" );
179
}
180
 
181
 
182
###############################################################################
183
#   ToolsetARMerge()
184
#       Generate the recipe to merge libraries.
185
#       The dependency list is created by the caller.
186
#
187
###############################################################################
188
 
189
sub ToolsetARMerge
190
{
191
    MakePrint( "\n\t\$(ARMERGE)\n\n" );
192
}
193
 
194
 
195
#.. Successful termination
196
1;
197