Alien-TinyCC
view release on metacpan or search on metacpan
src/tcc-doc.texi view on Meta::CPAN
@ignore
Because multiple C files are specified, @option{--} are necessary to clearly
separate the program arguments from the TCC options.
@end ignore
@item @samp{tcc -o myprog a.c b.c}
Compile @file{a.c} and @file{b.c}, link them and generate the executable @file{myprog}.
@item @samp{tcc -o myprog a.o b.o}
link @file{a.o} and @file{b.o} together and generate the executable @file{myprog}.
@item @samp{tcc -c a.c}
Compile @file{a.c} and generate object file @file{a.o}.
@item @samp{tcc -c asmfile.S}
Preprocess with C preprocess and assemble @file{asmfile.S} and generate
object file @file{asmfile.o}.
@item @samp{tcc -c asmfile.s}
Assemble (but not preprocess) @file{asmfile.s} and generate object file
@file{asmfile.o}.
@item @samp{tcc -r -o ab.o a.c b.c}
Compile @file{a.c} and @file{b.c}, link them together and generate the object file @file{ab.o}.
@end table
Scripting:
TCC can be invoked from @emph{scripts}, just as shell scripts. You just
need to add @code{#!/usr/local/bin/tcc -run} at the start of your C source:
@example
#!/usr/local/bin/tcc -run
#include <stdio.h>
int main()
@{
printf("Hello World\n");
return 0;
@}
@end example
TCC can read C source code from @emph{standard input} when @option{-} is used in
place of @option{infile}. Example:
@example
echo 'main()@{puts("hello");@}' | tcc -run -
@end example
@c man end
@section Option summary
General Options:
@c man begin OPTIONS
@table @option
@item -c
Generate an object file.
@item -o outfile
Put object file, executable, or dll into output file @file{outfile}.
@item -run source [args...]
Compile file @var{source} and run it with the command line arguments
@var{args}. In order to be able to give more than one argument to a
script, several TCC options can be given @emph{after} the
@option{-run} option, separated by spaces:
@example
tcc "-run -L/usr/X11R6/lib -lX11" ex4.c
@end example
In a script, it gives the following header:
@example
#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11
@end example
@item -dumpversion
Print only the compiler version and nothing else.
@item -v
Display TCC version.
@item -vv
Show included files. As sole argument, print search dirs (as below).
@item -bench
Display compilation statistics.
@item -print-search-dirs
Print the configured installation directory and a list of library
and include directories tcc will search.
@end table
Preprocessor options:
@table @option
@item -Idir
Specify an additional include path. Include paths are searched in the
order they are specified.
System include paths are always searched after. The default system
include paths are: @file{/usr/local/include}, @file{/usr/include}
and @file{PREFIX/lib/tcc/include}. (@file{PREFIX} is usually
@file{/usr} or @file{/usr/local}).
@item -Dsym[=val]
Define preprocessor symbol @samp{sym} to
val. If val is not present, its value is @samp{1}. Function-like macros can
also be defined: @option{-DF(a)=a+1}
@item -Usym
Undefine preprocessor symbol @samp{sym}.
@end table
Compilation flags:
Note: each of the following warning options has a negative form beginning with
@option{-fno-}.
@table @option
@item -funsigned-char
( run in 0.589 second using v1.01-cache-2.11-cpan-0bd6704ced7 )