small changes

This commit is contained in:
2022-05-31 19:15:28 +03:00
parent e9b740183d
commit b48405eae2
9 changed files with 30 additions and 24 deletions

View File

@@ -6,6 +6,5 @@ print "${CYAN}=============[build_lib]==============\n"
clear_dir bin
clear_dir obj
compile_c "-O2 -fpic -shared" "$SRC_C tests/test_marshalling.c"
compile_cpp "-flto -Wl,-soname,$LIB_FILE" "$SRC_CPP"
link " " $LIB_FILE
rm -rf $OBJDIR
compile_cpp "-O2 -fpic -shared" "$SRC_CPP"
link "-shared -O2 -fpic -flto -Wl,-soname,$LIB_FILE" "$LIB_FILE"

View File

@@ -8,4 +8,3 @@ clear_dir obj
compile_c "-O0 -g" "$SRC_C $TESTS_C"
compile_cpp "-O0 -g" "$SRC_CPP $TESTS_CPP"
link " " $TEST_FILE
rm -rf $OBJDIR

View File

@@ -48,6 +48,12 @@ function link {
print "${BLUE}outfile: ${GRAY}$outfile\n"
local objects="$(find $OBJDIR -name *.o)"
print "${BLUE}objects: ${GRAY}$objects\n"
$CMP_C $args -o $outfile $(echo $objects | tr '\n' ' ')
print "${GREEN}file $CYAN$outfile ${GREEN}created\n"
if $CMP_C $args -o $outfile $(echo $objects | tr '\n' ' ')
then
print "${GREEN}file $CYAN$outfile ${GREEN}created\n"
rm -rf $OBJDIR
else
print "${RED}some error happened\n"
exit
fi
}