OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [cdl-guide/] [ref.make-object.html] - Blame information for rev 661

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 unneback
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
2
<!-- This material may be distributed only subject to the terms      -->
3
<!-- and conditions set forth in the Open Publication License, v1.0  -->
4
<!-- or later (the latest version is presently available at          -->
5
<!-- http://www.opencontent.org/openpub/).                           -->
6
<!-- Distribution of the work or derivative of the work in any       -->
7
<!-- standard (paper) book form is prohibited unless prior           -->
8
<!-- permission is obtained from the copyright holder.               -->
9
<HTML
10
><HEAD
11
><TITLE
12
>make_object</TITLE
13
><meta name="MSSmartTagsPreventParsing" content="TRUE">
14
<META
15
NAME="GENERATOR"
16
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17
"><LINK
18
REL="HOME"
19
TITLE="The eCos Component Writer's Guide"
20
HREF="cdl-guide.html"><LINK
21
REL="UP"
22
TITLE="CDL Language Specification"
23
HREF="reference.html"><LINK
24
REL="PREVIOUS"
25
TITLE="make"
26
HREF="ref.make.html"><LINK
27
REL="NEXT"
28
TITLE="no_define"
29
HREF="ref.no-define.html"></HEAD
30
><BODY
31
CLASS="REFENTRY"
32
BGCOLOR="#FFFFFF"
33
TEXT="#000000"
34
LINK="#0000FF"
35
VLINK="#840084"
36
ALINK="#0000FF"
37
><DIV
38
CLASS="NAVHEADER"
39
><TABLE
40
SUMMARY="Header navigation table"
41
WIDTH="100%"
42
BORDER="0"
43
CELLPADDING="0"
44
CELLSPACING="0"
45
><TR
46
><TH
47
COLSPAN="3"
48
ALIGN="center"
49
>The <SPAN
50
CLASS="APPLICATION"
51
>eCos</SPAN
52
> Component Writer's Guide</TH
53
></TR
54
><TR
55
><TD
56
WIDTH="10%"
57
ALIGN="left"
58
VALIGN="bottom"
59
><A
60
HREF="ref.make.html"
61
ACCESSKEY="P"
62
>Prev</A
63
></TD
64
><TD
65
WIDTH="80%"
66
ALIGN="center"
67
VALIGN="bottom"
68
></TD
69
><TD
70
WIDTH="10%"
71
ALIGN="right"
72
VALIGN="bottom"
73
><A
74
HREF="ref.no-define.html"
75
ACCESSKEY="N"
76
>Next</A
77
></TD
78
></TR
79
></TABLE
80
><HR
81
ALIGN="LEFT"
82
WIDTH="100%"></DIV
83
><H1
84
><A
85
NAME="REF.MAKE-OBJECT"><SPAN
86
CLASS="PROPERTY"
87
>make_object</SPAN
88
></H1
89
><DIV
90
CLASS="REFNAMEDIV"
91
><A
92
NAME="AEN4770"
93
></A
94
><H2
95
>Name</H2
96
>Property <SPAN
97
CLASS="PROPERTY"
98
>make_object</SPAN
99
>&nbsp;--&nbsp;Define a custom build step, resulting in an object file
100
that should go into a library.</DIV
101
><DIV
102
CLASS="REFSYNOPSISDIV"
103
><A
104
NAME="AEN4774"><H2
105
>Synopsis</H2
106
><TABLE
107
BORDER="5"
108
BGCOLOR="#E0E0F0"
109
WIDTH="70%"
110
><TR
111
><TD
112
><PRE
113
CLASS="SYNOPSIS"
114
>cdl_option &lt;name&gt; {
115
    make_object [-library=&lt;library&gt;] [-priority=&lt;pri&gt;]  {
116
        &lt;custom build step&gt;
117
    }
118
    &#8230;
119
}</PRE
120
></TD
121
></TR
122
></TABLE
123
></DIV
124
><DIV
125
CLASS="REFSECT1"
126
><A
127
NAME="AEN4776"
128
></A
129
><H2
130
>Description</H2
131
><P
132
>When building an <SPAN
133
CLASS="APPLICATION"
134
>eCos</SPAN
135
> configuration the primary target is a single
136
library, <TT
137
CLASS="FILENAME"
138
>libtarget.a</TT
139
>. Most of the object files
140
which go into this library will be generated as a result of <SPAN
141
CLASS="PROPERTY"
142
>compile</SPAN
143
>
144
properties. Occasionally it may be necessary to have special build
145
steps for a given object file, and this can be achieved with a
146
<SPAN
147
CLASS="PROPERTY"
148
>make_object</SPAN
149
> property. The use of this property should be avoided
150
whenever possible because it greatly increases the risk of portability
151
problems, both on the host side because of possible problems with the
152
tools, and on the target side because a custom build step may not
153
allow adequately for the wide variety of architectures supported by
154
<SPAN
155
CLASS="APPLICATION"
156
>eCos</SPAN
157
>.</P
158
><P
159
>The <SPAN
160
CLASS="PROPERTY"
161
>make_object</SPAN
162
> property takes a single argument, which resembles a
163
makefile rule: it consists of a target, a list of dependencies, and
164
one or more commands that should be executed. The target should be an
165
object file. However the <SPAN
166
CLASS="PROPERTY"
167
>make_object</SPAN
168
> argument is not a makefile
169
fragment, and custom build steps may get executed in build
170
environments that do not involve make. For full details of custom
171
build steps see <A
172
HREF="build.make.html#BUILD.CUSTOM"
173
>the Section called <I
174
>Custom Build Steps</I
175
> in Chapter 4</A
176
>.</P
177
><DIV
178
CLASS="WARNING"
179
><P
180
></P
181
><TABLE
182
CLASS="WARNING"
183
BORDER="1"
184
WIDTH="100%"
185
><TR
186
><TD
187
ALIGN="CENTER"
188
><B
189
>Warning</B
190
></TD
191
></TR
192
><TR
193
><TD
194
ALIGN="LEFT"
195
><P
196
>The exact syntax and limitations of custom build steps have not yet
197
been finalized, and may change in future versions of the
198
configuration tools.</P
199
></TD
200
></TR
201
></TABLE
202
></DIV
203
><P
204
>The <SPAN
205
CLASS="PROPERTY"
206
>make_object</SPAN
207
> property takes an optional library argument. If no
208
library is specified then the default library for the current package
209
will be used, which will be <TT
210
CLASS="FILENAME"
211
>libtarget.a</TT
212
> unless
213
the <TT
214
CLASS="LITERAL"
215
>cdl_package</TT
216
> command contains a <SPAN
217
CLASS="PROPERTY"
218
>library</SPAN
219
> property.</P
220
><P
221
>The <SPAN
222
CLASS="PROPERTY"
223
>make_object</SPAN
224
> property also takes an optional priority argument
225
indicating the order in which build steps take place. This priority
226
complements the dependency list, and avoids problems with packages
227
needing to know details of custom build steps in other packages (which
228
may change between releases). The defined order is:</P
229
><P
230
></P
231
><DIV
232
CLASS="VARIABLELIST"
233
><DL
234
><DT
235
>Priority 0</DT
236
><DD
237
><P
238
>The header files exported by the current set of packages are copied
239
to the appropriate places in the
240
<TT
241
CLASS="FILENAME"
242
>include</TT
243
> subdirectory of the
244
install tree. Any unnecessary copies are avoided, to prevent rebuilds
245
of package and application source modules caused by header file dependencies.</P
246
><DIV
247
CLASS="NOTE"
248
><BLOCKQUOTE
249
CLASS="NOTE"
250
><P
251
><B
252
>Note: </B
253
>A possible future enhancement of the build system may result in the
254
build and install trees being updated automatically if there has been
255
a change to the <TT
256
CLASS="FILENAME"
257
>ecos.ecc</TT
258
> configuration savefile.</P
259
></BLOCKQUOTE
260
></DIV
261
></DD
262
><DT
263
>Priority 100</DT
264
><DD
265
><P
266
>All files specified in <SPAN
267
CLASS="PROPERTY"
268
>compile</SPAN
269
> properties will get built, producing
270
the corresponding object files. In addition any custom build steps
271
defined by <SPAN
272
CLASS="PROPERTY"
273
>make_object</SPAN
274
> properties get executed, unless there is a
275
<TT
276
CLASS="LITERAL"
277
>-priority=</TT
278
> option.</P
279
></DD
280
><DT
281
>Priority 200</DT
282
><DD
283
><P
284
>The libraries now get built using the appropriate object files.</P
285
></DD
286
><DT
287
>Priority 300</DT
288
><DD
289
><P
290
>Any custom build steps specified by <SPAN
291
CLASS="PROPERTY"
292
>make</SPAN
293
> properties now get
294
executed, unless the priority for a particular build step is changed
295
from its default.</P
296
></DD
297
></DL
298
></DIV
299
><P
300
>For example, if a custom build step needs to take place before any of
301
the normal source files get compiled then it should be given a
302
priority somewhere between 0 and 100. If a custom build step involves
303
post-processing an object file prior to its incorporation into a
304
library then a priority between 100 and 200 should be used. It is not
305
sensible to have a priority above 200, since that would imply building
306
an additional object file for a library that has already been created.</P
307
></DIV
308
><DIV
309
CLASS="REFSECT1"
310
><A
311
NAME="AEN4823"
312
></A
313
><H2
314
>Example</H2
315
><TABLE
316
BORDER="5"
317
BGCOLOR="#E0E0F0"
318
WIDTH="70%"
319
><TR
320
><TD
321
><PRE
322
CLASS="PROGRAMLISTING"
323
>cdl_option XXX {
324
    &#8230;
325
    make_object {
326
        parser.o: parser.y
327
                yacc $&lt;
328
                $(CC) $(CFLAGS) -o $@ y.tab.c
329
    }
330
}</PRE
331
></TD
332
></TR
333
></TABLE
334
></DIV
335
><DIV
336
CLASS="REFSECT1"
337
><A
338
NAME="AEN4826"
339
></A
340
><H2
341
>See Also</H2
342
><P
343
>Properties <A
344
HREF="ref.compile.html"
345
>compile</A
346
>,
347
<A
348
HREF="ref.make.html"
349
>make</A
350
> and
351
<A
352
HREF="ref.library.html"
353
>library</A
354
>.</P
355
></DIV
356
><DIV
357
CLASS="NAVFOOTER"
358
><HR
359
ALIGN="LEFT"
360
WIDTH="100%"><TABLE
361
SUMMARY="Footer navigation table"
362
WIDTH="100%"
363
BORDER="0"
364
CELLPADDING="0"
365
CELLSPACING="0"
366
><TR
367
><TD
368
WIDTH="33%"
369
ALIGN="left"
370
VALIGN="top"
371
><A
372
HREF="ref.make.html"
373
ACCESSKEY="P"
374
>Prev</A
375
></TD
376
><TD
377
WIDTH="34%"
378
ALIGN="center"
379
VALIGN="top"
380
><A
381
HREF="cdl-guide.html"
382
ACCESSKEY="H"
383
>Home</A
384
></TD
385
><TD
386
WIDTH="33%"
387
ALIGN="right"
388
VALIGN="top"
389
><A
390
HREF="ref.no-define.html"
391
ACCESSKEY="N"
392
>Next</A
393
></TD
394
></TR
395
><TR
396
><TD
397
WIDTH="33%"
398
ALIGN="left"
399
VALIGN="top"
400
><SPAN
401
CLASS="PROPERTY"
402
>make</SPAN
403
></TD
404
><TD
405
WIDTH="34%"
406
ALIGN="center"
407
VALIGN="top"
408
><A
409
HREF="reference.html"
410
ACCESSKEY="U"
411
>Up</A
412
></TD
413
><TD
414
WIDTH="33%"
415
ALIGN="right"
416
VALIGN="top"
417
><SPAN
418
CLASS="PROPERTY"
419
>no_define</SPAN
420
></TD
421
></TR
422
></TABLE
423
></DIV
424
></BODY
425
></HTML
426
>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.