This commit is contained in:
wangfiox 2024-05-19 12:20:56 +08:00
parent 5b097e7feb
commit 875693f977
4 changed files with 7 additions and 6 deletions

BIN
lib/libsysy.so Executable file

Binary file not shown.

BIN
lib/sylib.o Normal file

Binary file not shown.

View File

@ -5,17 +5,18 @@ input_dir="sy"
output_dir="build" output_dir="build"
lib_dir="lib" lib_dir="lib"
CC=riscv64-suse-linux-gcc
rm -rf build rm -rf build
# 确保输出目录存在 # 确保输出目录存在
mkdir -p "$output_dir" mkdir -p "$output_dir"
rm ./lib/sylib.o rm -f ./lib/sylib.o
clang -fPIC -c ./lib/sylib.c -o ./lib/sylib.o rm -f ./lib/libsysy.so
# gcc -c ./lib/sylib.c -o ./lib/sylib.o
rm ./lib/libsylib.so ${CC} -fPIC -c ./lib/sylib.c -o ./lib/sylib.o
clang -shared ./lib/sylib.o -o ./lib/libsylib.so ${CC} -shared ./lib/sylib.o -o ./lib/libsysy.so
# ar rcs ./lib/libsy.a ./lib/sylib.o
# 遍历sy目录下的所有文件 # 遍历sy目录下的所有文件
for file in "$input_dir"/*.c; do for file in "$input_dir"/*.c; do