{% extends "target.default.j2" %}

{% block binaries %}
cc = ${srcroot}/sysroot/bin/clang
cxx = ${srcroot}/sysroot/bin/clang++
ld = ${srcroot}/sysroot/bin/ld.lld
ar = ${srcroot}/sysroot/bin/ar
nasm = nasm
objcopy = ${srcroot}/sysroot/bin/objcopy
{% endblock %}

{% block variables %}

ccflags = $ccflags $
    -nostdlib $
    -ffreestanding $
    -nodefaultlibs $
    -fno-builtin $
    -mno-sse $
    -fno-omit-frame-pointer $
    -mno-red-zone $
    -g $
    -mcmodel=large $
    -D__ELF__ $
    -D__JSIX__ $
    -isystem${srcroot}/sysroot/include $
    -isystem${srcroot}/src/libraries/libc/include $
    --sysroot="${srcroot}/sysroot"

cxxflags = $cxxflags $
    -fno-exceptions $
    -fno-rtti $
    -isystem${srcroot}/sysroot/include/c++/v1

ldflags = $ldflags $
    -g $
    -nostdlib $
    -Bsymbolic $
    -Bstatic

{% endblock %}

# vim: ft=ninja et ts=4 sts=4 sw=4

