2 ### Help message and manual page ##############################################
8 sfdc - Compile SFD files into someting useful
12 sfdc [options] file1.sfd [file2.sfd ...]
15 --addvectors=TYPE Add default functions
16 --gateprefix=PREFIX Prefix for gatestub functions
17 --help -h Show full help message and exit
18 --libarg=LOCATION Where to pass the libbase
19 --libprefix=PREFIX Prefix for library functions
20 --man Show full manual page and exit
21 --mode=MODE What to do
22 --output=FILE -o FILE Where to store the output
24 --target=TARGET Specifies the machine target
25 --version -v Show version and exit
34 This flag adds the standard library/device/BOOPSI functions to the
35 list of function entries to process. Possible values are B<none>,
36 B<library>, B<device> and B<boopsi>. The default is B<none>. Useful
37 when generating gate stub functions.
42 Sets a function name prefix for the gate stub functions when
43 generating gatestubs or gateproto files.
48 Show the full help message and exit.
53 Specifies where to place the library base argument when generating
54 gatestubs or gateproto and libproto files. Possible values are
55 B<none>, B<first> and B<last>. The default is B<none>.
60 Sets a function name prefix for the local library functions when
61 generating gatestubs or libproto files.
66 Show the complete manual page and exit.
71 Instructs F<sfdc> what to do. F<sfdc> can handle the
78 Generate C prototypes to be placed in F<Include/clib/>.
83 Dumps all information gathered from the SFD file.
88 Generate an old-style FD file.
93 Generate a prototype header file for library gate stubs. Useful for
94 library and device developers.
99 Generate library gate stubs. Useful for library and device developers.
104 Generate a prototype header file for library functions. This is almost
105 like B<clib>, but for internal use by library and device developers.
110 Generate an assembler LVO include file.
115 Generate a header file containing F<gcc> specific preprocessor macros,
116 similar to F<fd2inline>'s B<--new> switch. For AROS targets, it
117 generates a file suitable to be placed in the F<Include/defines/>
123 Generate header file to be placed in F<Include/proto/> that includes
124 the C prototypes as well as compiler-specific inlines or pragma files.
129 Generate a F<SAS/C>/F<LATTICE>/F<DICE> and F<Maxon C>/F<Storm
130 C>/F<Aztec C> pragma file.
135 Generate C library stubs suitable to be compiled and archived into
136 F<libamiga.a>, F<libamigastubs.a> or
137 F<libI<E<lt>moduleE<gt>>.a>. Using the B<%f> escape sequence in the
138 B<--output> switch or a tool like F<splitasm.awk> strongly is
143 Just loads and parses the SFD file. This is the default.
150 Specifies where the result will be stored. The following escape
151 sequencies are allowed in the file name. If the sequence B<%f> is
152 present in the name, a new file will be created for each function
159 The library base variable name (C<DOSBase>, for example).
163 The current funcion name (C<Open>, for example).
167 The name of the library or device (F<dos.library>, for example).
171 The base name of the library or device (C<dos>, for example).
175 If omitted, the result will be sent to the standard output instead of
185 Specifies the target when generating macros etc. The target names
186 follow the GNU autoconf standard. Some possible values are listed
187 below. The default is B<m68k-unknown-amigaos>.
191 =item B<i?86-pc-aros>, B<i?86-linux-aros>, B<ppc-aros> ...
193 AROS. Anything goes, as long as it ends in C<-aros>.
196 =item B<i?86be-pc-amithlon>, B<i?86be-amithlon>
198 Amithlon/big endian IA32.
201 =item B<m68k-unknown-amigaos>, B<m68k-amigaos>
203 Traditional AmigaOS/m68k.
206 =item B<powerpc-unknown-morphos>, B<ppc-morphos>
217 Prints the version and exits.
224 F<sfdc> is an open source replacement for Amiga, Inc.'s F<sfd> tool,
225 distributed with B<NDK 3.9>. It is also an replacement for
226 F<fd2inline> from GeekGadgets and the MorphOS team, later improved to
227 death by Martin Blom. It's now a complete mess and needs a
228 replacement. SFD files and F<sfdc> might to be a good start.
230 For developers using F<gcc>, F<sfdc> aims to handle all your needs
231 when it comes to libraries, devices, datatypes, BOOPSI classes or
232 similar modules. F<sfdc> can also generate F<SAS/C>, F<DICE> and
233 F<Storm C> files for end users of such modules.
235 The basis for all work performed by F<sfdc> is the B<SFD> file, which
236 contains all required information about the module and the functions
237 provided. From this information, F<sfdc> can:
243 Generate an old-style B<FD> file for futher processing with other tools.
248 Generate a B<C prototype file>, such as those normally found in the
249 F<Include/clib/> directory.
254 Generate F<gcc> B<inlines> (actually preprocessor macros) or
255 B<pragmas> for direct library function calls (without going via
261 Generate the F<Include/proto/> file, which includes the
262 F<Include/clib/> file and either the inlines or pragmas.
267 Generate an B<assembler LVO> file, which contains the library offset
268 of all functions in the library.
273 Generate B<C stubs>, which can be compiled and archived into a stub
279 Generate library B<gateway stubs>, which can be used as part of your
280 module as glue between the module function table and your C functions.
286 Additionally, F<sfdc> does all this for several Amiga-like operating
287 systems: traditional B<AmigaOS>, native B<Amithlon>, B<AROS> and
290 F<sfdc> uses F<autoconf> style identifies for the operating systems,
291 making it easy to generate the correct output. Just make sure
292 F<configure.in> contains the B<AC_CANONICAL_SYSTEM> command and use
293 B<@host@> in your F<Makefile.in>. Using F<autoconf> and F<sfdc>, it's
294 easy to make for example a library that can be compiled or
295 cross-compiiled for any of the mentioned architectures.
300 Returns 0 on success and 10 on errors.
305 Had I seen F<cvinclude.pl> before I started writing this program, I
306 might still have been using fd/clib files. Or maybe not.
310 Martin Blom <martin@blom.org>
316 =item B<1.0 (2003-07-27)>
321 =item B<1.1 (2003-12-22)>
323 Added workaround for workbench.library (base name is "wb").
324 Added AmigaOS 4 support.
325 Added the --addvectors switch.
328 =item B<1.2 (2004-06-16)>
330 Generates files for mathieeedoub*, though probably broken. Well they
331 are the same as fd2inline generates at least.
334 =item B<1.2a (2004-06-20)>
336 Replace AROS_LP with AROS_LD. Because it is guaranteed to define the
337 function prototype. [verhaegs]
339 =item B<1.3 (2004-11-12)>
341 Correctly handle the argument C<type **arg>, where there is no
342 whitespace between the argument type and the argument name.
344 Correctly handle the prototype C<void function (void)>, were there is
345 a whitespace between the function name and the parenthesis and "void"
346 is used to indicate no arguments.
348 Replace C<-> with C<_> in base/library name.
350 New special keyword for register specification (in addition to B<sysv>
351 and B<base>): B<autoreg>, which automatically allocates m68k registers
354 B<sysv> now works correctly with varargs functions. B<sysv> combined
355 with B<gatestubs> work for m68k and i386 only for now. For AROS
356 targets in B<macros>, the correct AROS macro is used to fetch the
357 function to be called.
359 New B<--mode>: B<functable>. For proper code generation in AROS, make
360 sure gateprotos are included before you include the functable.
362 B<proto> files now include F<Include/defines/> files when used in AROS.