106 lines
3.8 KiB
Plaintext
106 lines
3.8 KiB
Plaintext
import("//toolchains/COMPILERS.gni")
|
|
|
|
toolchain("gnu-cross-compiler") {
|
|
tool("cc") {
|
|
depfile = "{{output}}.d"
|
|
command = "$gnu_cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
|
depsformat = "gcc"
|
|
description = "CC {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("cxx") {
|
|
depfile = "{{output}}.d"
|
|
command = "$gnu_cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
|
|
depsformat = "gcc"
|
|
description = "CXX {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("asm") {
|
|
depfile = "{{output}}.d"
|
|
command = "$gnu_asm {{source}} -o {{output}} {{asmflags}}"
|
|
depsformat = "gcc"
|
|
description = "ASM {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("alink") {
|
|
command = "rm -f {{output}} && $gnu_ar rcs {{output}} {{inputs}}"
|
|
description = "AR {{output}}"
|
|
outputs = [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" ]
|
|
default_output_extension = ".a"
|
|
output_prefix = ""
|
|
}
|
|
tool("link") {
|
|
outputs = [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" ]
|
|
command = "$gnu_ld -o {{output}} {{inputs}} {{ldflags}} {{solibs}} {{libs}}"
|
|
description = "LINK {{output}}"
|
|
}
|
|
tool("stamp") {
|
|
command = "touch {{output}}"
|
|
description = "STAMP {{output}}"
|
|
}
|
|
tool("copy") {
|
|
command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
|
|
description = "COPY {{source}} {{output}}"
|
|
}
|
|
}
|
|
|
|
toolchain("llvm-cross-compiler") {
|
|
tool("cc") {
|
|
depfile = "{{output}}.d"
|
|
command = "$llvm_cc -MMD -MF $depfile $llvm_ccpp_target_flag {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
|
depsformat = "gcc"
|
|
description = "CC {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("cxx") {
|
|
depfile = "{{output}}.d"
|
|
command = "$llvm_cxx -MMD -MF $depfile $llvm_ccpp_target_flag {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
|
|
depsformat = "gcc"
|
|
description = "CXX {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("objcxx") {
|
|
depfile = "{{output}}.d"
|
|
command = "$llvm_cxx -MMD -MF $depfile $llvm_ccpp_target_flag {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} {{cflags_objcc}} -c {{source}} -o {{output}}"
|
|
depsformat = "gcc"
|
|
description = "OBJCXX {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("asm") {
|
|
depfile = "{{output}}.d"
|
|
command =
|
|
"$llvm_asm $llvm_asm_target_flag {{source}} -o {{output}} {{asmflags}}"
|
|
depsformat = "gcc"
|
|
description = "ASM {{output}}"
|
|
outputs =
|
|
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
|
|
}
|
|
tool("alink") {
|
|
command = "rm -f {{output}} && $llvm_ar rcs {{output}} {{inputs}}"
|
|
description = "AR {{output}}"
|
|
outputs = [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" ]
|
|
default_output_extension = ".a"
|
|
output_prefix = ""
|
|
}
|
|
tool("link") {
|
|
outputs = [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" ]
|
|
command =
|
|
"$llvm_ld -o {{output}} {{inputs}} {{ldflags}} {{solibs}} {{libs}}"
|
|
description = "LINK {{output}}"
|
|
}
|
|
tool("stamp") {
|
|
command = "touch {{output}}"
|
|
description = "STAMP {{output}}"
|
|
}
|
|
tool("copy") {
|
|
command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
|
|
description = "COPY {{source}} {{output}}"
|
|
}
|
|
}
|