| @@ -0,0 +1,125 @@ |
| | 1 | **TinyCC** (or tcc) is short for Tiny C Compiler. |
| | 2 | |
| | 3 | This a clone of the mob development repo at http://repo.or.cz/tinycc.git |
| | 4 | |
| | 5 | |Branch |Status | |
| | 6 | |------------|---------| |
| | 7 | |mob | [](https://travis-ci.org/wqweto/tinycc) | |
| | 8 | |dev | [](https://travis-ci.org/wqweto/tinycc) | |
| | 9 | |
| | 10 | ### License |
| | 11 | |
| | 12 | Tiny C Compiler project is licensed under [LGPL](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License) but currently there is an effort to relicense the project under [MIT License](https://en.wikipedia.org/wiki/MIT_License). See RELICENSING file in root for current status. |
| | 13 | |
| | 14 | ### Branch Policy |
| | 15 | |
| | 16 | The "dev" branch is the one where all contributions will be merged before reaching "mob". If you plan to propose a patch, please commit into the "dev" branch or its own feature branch. Direct commit to "mob" are not permitted. |
| | 17 | |
| | 18 | ### Original Fabrice Bellard readme |
| | 19 | |
| | 20 | ``` |
| | 21 | Tiny C Compiler - C Scripting Everywhere - The Smallest ANSI C compiler |
| | 22 | ----------------------------------------------------------------------- |
| | 23 | |
| | 24 | Features: |
| | 25 | -------- |
| | 26 | |
| | 27 | - SMALL! You can compile and execute C code everywhere, for example on |
| | 28 | rescue disks. |
| | 29 | |
| | 30 | - FAST! tcc generates optimized x86 code. No byte code |
| | 31 | overhead. Compile, assemble and link about 7 times faster than 'gcc |
| | 32 | -O0'. |
| | 33 | |
| | 34 | - UNLIMITED! Any C dynamic library can be used directly. TCC is |
| | 35 | heading torward full ISOC99 compliance. TCC can of course compile |
| | 36 | itself. |
| | 37 | |
| | 38 | - SAFE! tcc includes an optional memory and bound checker. Bound |
| | 39 | checked code can be mixed freely with standard code. |
| | 40 | |
| | 41 | - Compile and execute C source directly. No linking or assembly |
| | 42 | necessary. Full C preprocessor included. |
| | 43 | |
| | 44 | - C script supported : just add '#!/usr/local/bin/tcc -run' at the first |
| | 45 | line of your C source, and execute it directly from the command |
| | 46 | line. |
| | 47 | |
| | 48 | Documentation: |
| | 49 | ------------- |
| | 50 | |
| | 51 | 1) Installation on a i386/x86_64/arm Linux/OSX/FreeBSD host (for Windows read tcc-win32.txt) |
| | 52 | |
| | 53 | Note: For OSX and FreeBSD, gmake should be used instead of make. |
| | 54 | |
| | 55 | ./configure |
| | 56 | make |
| | 57 | make test |
| | 58 | make install |
| | 59 | |
| | 60 | Alternatively, out-of-tree builds are supported: you may use different |
| | 61 | directories to hold build objects, kept separate from your source tree: |
| | 62 | |
| | 63 | mkdir _build |
| | 64 | cd _build |
| | 65 | ../configure |
| | 66 | make |
| | 67 | make test |
| | 68 | make install |
| | 69 | |
| | 70 | Texi2html must be installed to compile the doc. |
| | 71 | By default, tcc is installed in /usr/local/bin. |
| | 72 | ./configure --help shows configuration options. |
| | 73 | |
| | 74 | |
| | 75 | 2) Introduction |
| | 76 | |
| | 77 | We assume here that you know ANSI C. Look at the example ex1.c to know |
| | 78 | what the programs look like. |
| | 79 | |
| | 80 | The include file <tcclib.h> can be used if you want a small basic libc |
| | 81 | include support (especially useful for floppy disks). Of course, you |
| | 82 | can also use standard headers, although they are slower to compile. |
| | 83 | |
| | 84 | You can begin your C script with '#!/usr/local/bin/tcc -run' on the first |
| | 85 | line and set its execute bits (chmod a+x your_script). Then, you can |
| | 86 | launch the C code as a shell or perl script :-) The command line |
| | 87 | arguments are put in 'argc' and 'argv' of the main functions, as in |
| | 88 | ANSI C. |
| | 89 | |
| | 90 | 3) Examples |
| | 91 | |
| | 92 | ex1.c: simplest example (hello world). Can also be launched directly |
| | 93 | as a script: './ex1.c'. |
| | 94 | |
| | 95 | ex2.c: more complicated example: find a number with the four |
| | 96 | operations given a list of numbers (benchmark). |
| | 97 | |
| | 98 | ex3.c: compute fibonacci numbers (benchmark). |
| | 99 | |
| | 100 | ex4.c: more complicated: X11 program. Very complicated test in fact |
| | 101 | because standard headers are being used ! As for ex1.c, can also be launched |
| | 102 | directly as a script: './ex4.c'. |
| | 103 | |
| | 104 | ex5.c: 'hello world' with standard glibc headers. |
| | 105 | |
| | 106 | tcc.c: TCC can of course compile itself. Used to check the code |
| | 107 | generator. |
| | 108 | |
| | 109 | tcctest.c: auto test for TCC which tests many subtle possible bugs. Used |
| | 110 | when doing 'make test'. |
| | 111 | |
| | 112 | 4) Full Documentation |
| | 113 | |
| | 114 | Please read tcc-doc.html to have all the features of TCC. |
| | 115 | |
| | 116 | Additional information is available for the Windows port in tcc-win32.txt. |
| | 117 | |
| | 118 | License: |
| | 119 | ------- |
| | 120 | |
| | 121 | TCC is distributed under the GNU Lesser General Public License (see |
| | 122 | COPYING file). |
| | 123 | |
| | 124 | Fabrice Bellard. |
| | 125 | ``` |