copapy/tools/crosscompile.sh

55 lines
1.3 KiB
Bash
Raw Normal View History

2025-10-04 20:57:45 +00:00
#!/bin/bash
set -e
set -v
2025-10-07 21:23:14 +00:00
2025-10-08 20:59:46 +00:00
mkdir -p bin
2025-10-08 20:59:51 +00:00
SRC=bin/stencils.c
2025-10-04 20:57:45 +00:00
DEST=src/copapy/obj
2025-10-04 20:59:53 +00:00
OPT=O3
2025-10-07 21:23:14 +00:00
2025-10-04 20:57:45 +00:00
mkdir -p $DEST
2025-10-07 21:23:14 +00:00
# Windows x86_64 (ARM64)
2025-10-08 20:59:51 +00:00
python tools/generate_stencils.py --abi ms $SRC
2025-10-08 21:21:51 +00:00
gcc-13 -$OPT -c $SRC -o $DEST/stencils_AMD64_$OPT.o
# Windows x86
gcc-13 -m32 -$OPT -c $SRC -o $DEST/stencils_x86_$OPT.o
2025-10-07 21:20:51 +00:00
2025-10-04 20:57:45 +00:00
# Native x86_64
2025-10-08 20:59:51 +00:00
python tools/generate_stencils.py $SRC
2025-10-08 21:21:51 +00:00
gcc-13 -$OPT -c $SRC -o $DEST/stencils_x86_64_$OPT.o
2025-10-08 21:15:14 +00:00
# Native i686
python tools/generate_stencils.py $SRC
2025-10-08 21:21:51 +00:00
gcc-13 -m32 -$OPT -c $SRC -o $DEST/stencils_i686_$OPT.o
2025-10-08 21:15:14 +00:00
# ARM64 linux (aarch64)
2025-10-08 21:21:51 +00:00
aarch64-linux-gnu-gcc-13 -$OPT -c $SRC -o $DEST/stencils_aarch64_$OPT.o
2025-10-04 20:57:45 +00:00
# ARM64 macos (copy aarch64)
cp $DEST/stencils_aarch64_$OPT.o $DEST/stencils_arm64_$OPT.o
2025-10-04 20:57:45 +00:00
# ARMv7
2025-10-08 21:21:51 +00:00
arm-linux-gnueabihf-gcc-13 -$OPT -c $SRC -o $DEST/stencils_armv7_$OPT.o
2025-10-04 20:57:45 +00:00
# PowerPC64LE
2025-10-08 21:21:51 +00:00
# powerpc64le-linux-gnu-gcc-13 -$OPT -c $SRC -o $DEST/stencils_ppc64le_$OPT.o
2025-10-04 20:57:45 +00:00
# S390x
2025-10-08 21:21:51 +00:00
# s390x-linux-gnu-gcc-13 -$OPT -c $SRC -o $DEST/stencils_s390x_$OPT.o
# Mips (Big Endian)
mips-linux-gnu-gcc-13 -$OPT -c $SRC -o $DEST/stencils_mips_$OPT.o
2025-10-04 20:57:45 +00:00
2025-10-08 21:21:51 +00:00
# Mips (Little Endian)
mipsel-linux-gnu-gcc-13 -$OPT -c $SRC -o $DEST/stencils_mips_$OPT.o
2025-10-04 20:57:45 +00:00
# RISCV 32 Bit
2025-10-08 21:21:51 +00:00
riscv64-linux-gnu-gcc-13 -$OPT -march=rv32imac -mabi=ilp32 -c $SRC -o $DEST/stencils_riscv32_$OPT.o
2025-10-04 20:57:45 +00:00
# RISCV 64 Bit
2025-10-08 21:21:51 +00:00
riscv64-linux-gnu-gcc-13 -$OPT -c $SRC -o $DEST/stencils_riscv64_$OPT.o