Skip to content
kyx0rPublic

About

Single header C99 compiler (TCC)

Resources

Stars

36 stars

Watchers

3 watching

Forks

Repository files navigation

TINYCC
------
Single header C99 compiler (TCC)

Entire core of TCC compiler in one file. Separate file for each target arch/platform.
Arch/Platform unrelated code stripped out.

Supported architectures:
tcc_linux_x86_64 - 35177L LOC
tcc_win64_x86_64 - 35217L LOC

RATIONALE
---------

It may be painful to deal with complex build systems and files may harm code navigation 
and/or understanding. Many people prefer single header libraries, and this is just 
that, entire compiler self contained and in one file. 

Have you ever wanted to ship a compiler inside your application? Well, now you can 
just do it.

COMPILING
---------
Linux (x86_64):

Bootstrap with GCC
gcc tcc_linux_x86_64.c -o gnu_tcc

Self re-compile
./gnu_tcc -I./include tcc_linux_x86_64.c -o tcc
./tcc -I /usr/include -I ./include tcc_linux_x86_64.c -o _tcc

Windows (x86_64, UCRT):

Setup UCRT:
pacman -S mingw-w64-ucrt-x86_64-toolchain
export PATH="/ucrt64/bin:$PATH"

Bootstrap with GCC with UCRT (mingw-w64-x86_64-gcc)
gcc tcc_win64_x86_64.c -o gnu_tcc.exe

Self re-compile
./gnu_tcc.exe -I./win32/include -I./win32/include/winapi tcc_win64_x86_64.c -o tcc.exe
./tcc.exe -I./win32/include -I./win32/include/winapi tcc_win64_x86_64.c -o _tcc.exe

UPDATING
---------
Updating amalgamation to the latest git version is automated using custom scripts.

win64_x86_64.sh
linux_x86_64.sh
amal.sh - tcc preprocessor extension for amalgamation

About

Single header C99 compiler (TCC)

Resources

Stars

36 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages