forked from Mirrors/tinycc
15 lines
538 B
Bash
15 lines
538 B
Bash
#! /usr/bin/env sh
|
|
|
|
cd "$(dirname "$0")" &&
|
|
|
|
# Compile dietlibc
|
|
gcc -r -nostdlib -o libc.a -Ilibc/include -I../include \
|
|
libc/src/cstring.c libc/src/cstdio.c libc/src/syscalls.c &&
|
|
|
|
# Build compiler
|
|
ln -fs base_config.h config.h &&
|
|
gcc -o tcc -static -nostdlib \
|
|
-DNDEBUG -DTCC_NOT_NATIVE -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -DONE_SOURCE=0 -I. -I../include -Ilibc/include \
|
|
../tcc.c ../libtcc.c ../tccpp.c ../tccgen.c ../tccelf.c ../tccasm.c ../tccrun.c ../x86_64-gen.c ../x86_64-link.c ../i386-asm.c\
|
|
./libc.a
|