-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsfdc.txt
283 lines (202 loc) · 11.6 KB
/
sfdc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
[1mNAME[0m
sfdc - Compile SFD files into someting useful
[1mSYNOPSIS[0m
sfdc [options] file1.sfd [file2.sfd ...]
Options:
--addvectors=TYPE Add default functions
--gateprefix=PREFIX Prefix for gatestub functions
--help -h Show full help message and exit
--libarg=LOCATION Where to pass the libbase
--libprefix=PREFIX Prefix for library functions
--sdi SDI header compatibility mode
--man Show full manual page and exit
--mode=MODE What to do
--output=FILE -o FILE Where to store the output
--quiet -q Be quiet
--target=TARGET Specifies the machine target
--version -v Show version and exit
[1mOPTIONS[0m
[1m--addvectors[0m
This flag adds the standard library/device/BOOPSI functions to
the list of function entries to process. Possible values are
[1mnone[0m, [1mlibrary[0m, [1mdevice[0m and [1mboopsi[0m. The default is [1mnone[0m. Useful
when generating gate stub functions.
[1m--gateprefix[0m
Sets a function name prefix for the gate stub functions when
generating gatestubs or gateproto files.
[1m--help[0m Show the full help message and exit.
[1m--libarg[0m
Specifies where to place the library base argument when
generating gatestubs or gateproto and libproto files. Possible
values are [1mnone[0m, [1mfirst[0m and [1mlast[0m. The default is [1mnone[0m.
[1m--libprefix[0m
Sets a function name prefix for the local library functions when
generating gatestubs or libproto files.
[1m--sdi[0m Turns on the SDI header compatibility mode. This will make sure
that all header files (especially the gatestub and gateproto
files are generated to be used in a SDI compatible environment.
[1m--man[0m Show the complete manual page and exit.
[1m--mode[0m Instructs [36msfdc[0m what to do. [36msfdc[0m can handle the following
arguments:
[1mautoopen[0m
Generate C code for automatically opening the module. It is
usually placed in a link library together with C stub
functions.
[1mclib[0m
Generate C prototypes to be placed in [36mInclude/clib/[0m.
[1mdump[0m
Dumps all information gathered from the SFD file.
[1mfd[0m Generate an old-style FD file.
[1mfunctable[0m
Generate a list of function names suitable for inclusion in
a library function table. By defining the preprocessor
symbol [1m__SFDC_FUNCTABLE_M68K__[0m, the list of functions will
be modified so it's suitable for AmigaOS 4's m68k function
table.
[1mgateproto[0m
Generate a prototype header file for library gate stubs.
Useful for library and device developers.
[1mgatestubs[0m
Generate library gate stubs. Useful for library and device
developers.
[1minterface[0m
Generate a struct with function pointers, like that uses in
AmigaOS 4.
[1mlibproto[0m
Generate a prototype header file for library functions. This
is almost like [1mclib[0m, but for internal use by library and
device developers.
[1mlvo[0m Generate an assembler LVO include file.
[1mmacros[0m
Generate a header file containing [36mgcc[0m specific preprocessor
macros, similar to [36mfd2inline[0m's [1m--new[0m switch. For AROS
targets, it generates a file suitable to be placed in the
[36mInclude/defines/[0m directory.
[1mproto[0m
Generate header file to be placed in [36mInclude/proto/[0m that
includes the C prototypes as well as compiler-specific
inlines or pragma files.
[1mpragmas[0m
Generate a [36mSAS/C[0m/[36mLATTICE[0m/[36mDICE[0m and [36mMaxon C[0m/[36mStorm C[0m/[36mAztec C[0m
pragma file.
[1mstubs[0m
Generate C library stubs suitable to be compiled and
archived into [36mlibamiga.a[0m, [36mlibamigastubs.a[0m or [36mlib[33m<module>[0m.a[0m.
Using the [1m%f[0m escape sequence in the [1m--output[0m switch or a
tool like [36msplitasm.awk[0m strongly is recommended.
[1mverify[0m
Just loads and parses the SFD file. This is the default.
[1m--output[0m
Specifies where the result will be stored. The following escape
sequencies are allowed in the file name. If the sequence [1m%f[0m is
present in the name, a new file will be created for each
function processed.
[1m%b[0m The library base variable name ("DOSBase", for example).
[1m%f[0m The current funcion name ("Open", for example).
[1m%l[0m The name of the library or device ([36mdos.library[0m, for
example).
[1m%n[0m The base name of the library or device ("dos", for example).
If omitted, the result will be sent to the standard output
instead of a file.
[1m--quiet[0m Be quiet.
[1m--target[0m
Specifies the target when generating macros etc. The target
names follow the GNU autoconf standard. Some possible values are
listed below. The default is [1mm68k-unknown-amigaos[0m.
[1mi?86-pc-aros[0m, [1mi?86-linux-aros[0m, [1mppc-aros[0m ...
AROS. Anything goes, as long as it ends in "-aros".
[1mi?86be-pc-amithlon[0m, [1mi?86be-amithlon[0m
Amithlon/big endian IA32.
[1mm68k-unknown-amigaos[0m, [1mm68k-amigaos[0m
Traditional AmigaOS/m68k.
[1mm68kvbcc-unknown-amigaos[0m, [1mm68k-amigaos[0m
Traditional AmigaOS/m68k but with the VBCC compiler.
[1mppc-unknown-amigaos[0m, [1mppc-amigaos[0m
AmigaOS 4/PowerPC.
[1mpowerpc-unknown-morphos[0m, [1mppc-morphos[0m
MorphOS/PowerPC.
[1m--version[0m
Prints the version and exits.
[1mDESCRIPTION[0m
[36msfdc[0m is an open source replacement for Amiga, Inc.'s [36msfd[0m tool,
distributed with [1mNDK 3.9[0m. It is also an replacement for [36mfd2inline[0m from
GeekGadgets and the MorphOS team, later improved to death by Martin
Blom. It's now a complete mess and needs a replacement. SFD files and
[36msfdc[0m might to be a good start.
For developers using [36mgcc[0m, [36msfdc[0m aims to handle all your needs when it
comes to libraries, devices, datatypes, BOOPSI classes or similar
modules. [36msfdc[0m can also generate [36mSAS/C[0m, [36mDICE[0m and [36mStorm C[0m files for end
users of such modules.
The basis for all work performed by [36msfdc[0m is the [1mSFD[0m file, which contains
all required information about the module and the functions provided.
From this information, [36msfdc[0m can:
* Generate an old-style [1mFD[0m file for futher processing with other
tools.
* Generate a [1mC prototype file[0m, such as those normally found in the
[36mInclude/clib/[0m directory.
* Generate [36mgcc[0m [1minlines[0m (actually preprocessor macros) or [1mpragmas[0m for
direct library function calls (without going via library stubs).
* Generate the [36mInclude/proto/[0m file, which includes the [36mInclude/clib/[0m
file and either the inlines or pragmas.
* Generate an [1massembler LVO[0m file, which contains the library offset of
all functions in the library.
* Generate [1mC stubs[0m, which can be compiled and archived into a stub
library. It can also generate auto-open and auto-close code.
* Generate library [1mgateway stubs[0m, which can be used as part of your
module as glue between the module function table and your C
functions.
Additionally, [36msfdc[0m does all this for several Amiga-like operating
systems: traditional [1mAmigaOS[0m, native [1mAmithlon[0m, [1mAROS[0m and [1mMorphOS[0m.
[36msfdc[0m uses [36mautoconf[0m style identifies for the operating systems, making it
easy to generate the correct output. Just make sure [36mconfigure.in[0m
contains the [1mAC_CANONICAL_SYSTEM[0m command and use [1m@host@[0m in your
[36mMakefile.in[0m. Using [36mautoconf[0m and [36msfdc[0m, it's easy to make for example a
library that can be compiled or cross-compiiled for any of the mentioned
architectures.
[1mRETURN VALUE[0m
Returns 0 on success and 10 on errors.
[1mNOTES[0m
Had I seen [36mcvinclude.pl[0m before I started writing this program, I might
still have been using fd/clib files. Or maybe not.
[1mAUTHOR[0m
Martin Blom <[email protected]>
[1mHISTORY[0m
* [1m1.0 (2003-07-27)[0m
Initial release.
* [1m1.1 (2003-12-22)[0m
Added workaround for workbench.library (base name is "wb"). Added
AmigaOS 4 support. Added the [1m--addvectors[0m switch.
* [1m1.2 (2004-06-16)[0m
Generates files for mathieeedoub*, though probably broken. Well they
are the same as fd2inline generates at least.
* [1m1.2a (2004-06-20)[0m
Replace AROS_LP with AROS_LD. Because it is guaranteed to define the
function prototype. [verhaegs]
* [1m1.3 (2004-11-12)[0m
Correctly handle the argument "type **arg", where there is no
whitespace between the argument type and the argument name.
* Correctly handle the prototype "void function (void)", were there is
a whitespace between the function name and the parenthesis and
"void" is used to indicate no arguments.
* Replace "-" with "_" in base/library name.
* New special keyword for register specification (in addition to [1msysv[0m
and [1mbase[0m): [1mautoreg[0m, which automatically allocates m68k registers for
the arguments.
* [1msysv[0m now works correctly with varargs functions. [1msysv[0m combined with
[1mgatestubs[0m work for m68k and i386 only for now. For AROS targets in
[1mmacros[0m, the correct AROS macro is used to fetch the function to be
called.
* New [1m--mode[0m: [1mfunctable[0m. For proper code generation in AROS, make sure
gateprotos are included before you include the functable.
* [1mproto[0m files now include [36mInclude/defines/[0m files when used in AROS.
* [1m1.4 (2005-09-23)[0m
Added AmigaOS 4-style interfaces (C++ only for non-OS4 targets, and
without implementation).
* The library base in the [1mproto[0m file is now defined for AmigaOS 4 too.
* AmigaOS 4 [1mclib[0m files now add [1m__attribute__((linearvarargs))[0m to
varargs functions.
* Added AmigaOS 4 support for [1mstubs[0m files.
* Added support for the 'iptr' gcc attribute.
* Added [1m__SFDC_FUNCTABLE_M68K__[0m check in the [1mfunctable[0m mode.
* Added m68k stub functions to AmigaOS 4's [1mgatestubs[0m and [1mgateproto[0m.
* Added the [1mautoopen[0m mode.