diff --git a/build_scripts/build_configurations/build_shared_lib.sh b/build_scripts/build_configurations/build_shared_lib.sh deleted file mode 100644 index dbe33c9..0000000 --- a/build_scripts/build_configurations/build_shared_lib.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}==========[build_shared_lib]==========\n" -clear_dir "$OUTDIR" -clear_dir "$OBJDIR" -compile_c "$BUILD_SHARED_LIB_C_ARGS" "$SRC_C tests/test_marshalling.c" -compile_cpp "$BUILD_SHARED_LIB_CPP_ARGS" "$SRC_CPP" -link "$BUILD_SHARED_LIB_CPP_ARGS $BUILD_SHARED_LIB_LINKER_ARGS" "$SHARED_LIB_FILE" diff --git a/build_scripts/build_configurations/build_static_lib.sh b/build_scripts/build_configurations/build_static_lib.sh deleted file mode 100644 index 692155e..0000000 --- a/build_scripts/build_configurations/build_static_lib.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}==========[build_static_lib]==========\n" -clear_dir "$OUTDIR" -clear_dir "$OBJDIR" -compile_c "$BUILD_STATIC_LIB_C_ARGS" "$SRC_C tests/test_marshalling.c" -compile_cpp "$BUILD_STATIC_LIB_CPP_ARGS" "$SRC_CPP" -pack_static_lib "$STATIC_LIB_FILE" diff --git a/build_scripts/build_configurations/build_static_lib_dbg.sh b/build_scripts/build_configurations/build_static_lib_dbg.sh deleted file mode 100644 index ef8aa3d..0000000 --- a/build_scripts/build_configurations/build_static_lib_dbg.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}==========[build_static_lib_dbg]==========\n" -clear_dir "$OUTDIR" -clear_dir "$OBJDIR" -compile_c "$BUILD_STATIC_LIB_DBG_C_ARGS" "$SRC_C tests/test_marshalling.c" -compile_cpp "$BUILD_STATIC_LIB_DBG_CPP_ARGS" "$SRC_CPP" -pack_static_lib "$STATIC_LIB_DBG_FILE" diff --git a/build_scripts/build_configurations/build_test.sh b/build_scripts/build_configurations/build_test.sh deleted file mode 100644 index 570de5a..0000000 --- a/build_scripts/build_configurations/build_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}=============[build_test]=============\n" -clear_dir "$OUTDIR" -clear_dir "$OBJDIR" -compile_c "$BUILD_TEST_C_ARGS" "$SRC_C $TESTS_C" -compile_cpp "$BUILD_TEST_CPP_ARGS" "$SRC_CPP $TESTS_CPP" -link "$BUILD_TEST_CPP_ARGS $BUILD_TEST_LINKER_ARGS" $TEST_FILE diff --git a/build_scripts/build_configurations/build_test_dbg.sh b/build_scripts/build_configurations/build_test_dbg.sh deleted file mode 100644 index ff56aa0..0000000 --- a/build_scripts/build_configurations/build_test_dbg.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}===========[build_test_dbg]===========\n" -clear_dir "$OUTDIR" -clear_dir "$OBJDIR" -compile_c "$BUILD_TEST_DBG_C_ARGS" "$SRC_C $TESTS_C" -compile_cpp "$BUILD_TEST_DBG_CPP_ARGS" "$SRC_CPP $TESTS_CPP" -link "$BUILD_TEST_DBG_CPP_ARGS $BUILD_TEST_DBG_LINKER_ARGS" $TEST_DBG_FILE diff --git a/build_scripts/build_configurations/test.sh b/build_scripts/build_configurations/test.sh deleted file mode 100644 index 45ac85c..0000000 --- a/build_scripts/build_configurations/test.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}================[test]================\n" -cd $OUTDIR -./$TEST_FILE -cd .. diff --git a/build_scripts/build_configurations/test_valgrind.sh b/build_scripts/build_configurations/test_valgrind.sh deleted file mode 100644 index a92df20..0000000 --- a/build_scripts/build_configurations/test_valgrind.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -source build_scripts/init.sh - -print "${CYAN}===========[test_valgrind]============\n" -cd $OUTDIR -valgrind $VALGRIND_ARGS ./$TEST_DBG_FILE -cat "valgrind.log" -cd .. diff --git a/build_scripts/colors.sh b/build_scripts/colors.sh deleted file mode 100644 index e3e8363..0000000 --- a/build_scripts/colors.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -BLACK='\033[0;30m' -GRAY='\033[0;37m' -WHITE='\033[0;97m' -RED='\033[0;91m' -GREEN='\033[0;92m' -YELLOW='\033[0;93m' -BLUE='\033[0;94m' -PURPLE='\033[0;95m' -CYAN='\033[0;96m' diff --git a/build_scripts/default.config.sh b/build_scripts/default.config.sh deleted file mode 100644 index 7c2c541..0000000 --- a/build_scripts/default.config.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -OUTDIR=bin -OBJDIR=obj -CMP_C=gcc -CMP_CPP=g++ -STD_C=c11 -STD_CPP=c++17 -WARN_C="-Wall -Wno-discarded-qualifiers" -WARN_CPP="-Wall" -SRC_C="$( find src -name '*.c')" -SRC_CPP="$( find src -name '*.cpp')" -TESTS_C="$( find tests -name '*.c')" -TESTS_CPP="$(find tests -name '*.cpp')" -VALGRIND_ARGS="-s --log-file=valgrind.log --read-var-info=yes --track-origins=yes --fullpath-after=kerep/ --leak-check=full --show-leak-kinds=all" - -# build_test -TEST_FILE=kerep.com -BUILD_TEST_C_ARGS="-O2" -BUILD_TEST_CPP_ARGS="$BUILD_TEST_C_ARGS" -BUILD_TEST_LINKER_ARGS="" - -# build_test_dbg -TEST_DBG_FILE=$TEST_FILE.dbg -BUILD_TEST_DBG_C_ARGS="-O0 -g" -BUILD_TEST_DBG_CPP_ARGS="$BUILD_TEST_DBG_C_ARGS" -BUILD_TEST_DBG_LINKER_ARGS="" - -# build_shared_lib -SHARED_LIB_FILE=kerep.so -BUILD_SHARED_LIB_C_ARGS="-O2 -fpic -flto -shared" -BUILD_SHARED_LIB_CPP_ARGS="$BUILD_SHARED_LIB_C_ARGS" -BUILD_SHARED_LIB_LINKER_ARGS="-Wl,-soname,$SHARED_LIB_FILE" - -# build_static_lib -STATIC_LIB_FILE=kerep.a -BUILD_STATIC_LIB_C_ARGS="-O2 -fpic" -BUILD_STATIC_LIB_CPP_ARGS="$BUILD_STATIC_LIB_C_ARGS" - -# build_static_lib_dbg -STATIC_LIB_DBG_FILE="$STATIC_LIB_FILE" -BUILD_STATIC_LIB_DBG_C_ARGS="-O0 -g" -BUILD_STATIC_LIB_DBG_CPP_ARGS="$BUILD_STATIC_LIB_DBG_C_ARGS" diff --git a/build_scripts/functions.sh b/build_scripts/functions.sh deleted file mode 100644 index a2486e0..0000000 --- a/build_scripts/functions.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -function print { - printf "$1$GRAY" -} - -function clear_dir { - print "${BLUE}clearing $1\n" - rm -rf $1 - mkdir $1 -} - -function compile { - local cmp=$1 - print "${BLUE}compiler: ${GRAY}$cmp\n" - local std=$2 - print "${BLUE}standard: ${GRAY}$std\n" - local warn=$3 - print "${BLUE}warnings: ${GRAY}$warn\n" - local args=$4 - print "${BLUE}args: ${GRAY}$args\n" - local sources=$5 - print "${BLUE}sources: ${GRAY}$sources\n" - local compilation_error=0 - - for srcfile in $sources - do ( - local object="$OBJDIR/$(basename $srcfile).o" - if ! $($cmp -std=$std $warn $args -c -o $object $srcfile) - then - print "${RED}some error happened\n" - compilation_error=1 - fi - ) & done - wait - - if [ $compilation_error != 0 ] - then - exit 1 - fi -} - -# (args, sources) -function compile_c { - print "${CYAN}-------------[compile_c]--------------\n" - compile $CMP_C $STD_C "$WARN_C" "$1" "$2" -} - -# (args, sources) -function compile_cpp { - print "${CYAN}------------[compile_cpp]-------------\n" - compile $CMP_CPP $STD_CPP "$WARN_CPP" "$1" "$2" -} - -# (args, outfile) -function link { - print "${CYAN}----------------[link]----------------\n" - local args=$1 - print "${BLUE}args: ${GRAY}$args\n" - local outfile=$OUTDIR/$2 - print "${BLUE}outfile: ${GRAY}$outfile\n" - local objects="$(find $OBJDIR -name *.o)" - print "${BLUE}objects: ${GRAY}$objects\n" - if $CMP_CPP $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 1 - fi -} - -# (outfile) -function pack_static_lib { - print "${CYAN}----------------[link]----------------\n" - local outfile=$OUTDIR/$1 - print "${BLUE}outfile: ${GRAY}$outfile\n" - local objects="$(find $OBJDIR -name *.o)" - print "${BLUE}objects: ${GRAY}$objects\n" - if ar rcs $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 1 - fi -} \ No newline at end of file diff --git a/build_scripts/init.sh b/build_scripts/init.sh deleted file mode 100644 index 868baf5..0000000 --- a/build_scripts/init.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -tabs 4 - -source build_scripts/colors.sh -source build_scripts/functions.sh - -if [ ! -f ".config" ]; then - print "${YELLOW}./.config doesn't exists\n" - cp build_scripts/default.config.sh .config - print "${YELLOW}default config created\n" - while true; do - print "${WHITE}continue? (y/n) " - read answ - case $answ in - [Yy] ) break;; - [Nn] ) exit;; - * ) print "${RED}incorrect answer\n";; - esac - done -fi -source .config