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