default.config
This commit is contained in:
parent
b7f3dc26f9
commit
fb88ef9de3
47
default.config
Normal file
47
default.config
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CONFIG_VER=2
|
||||||
|
|
||||||
|
PROJECT=cobek
|
||||||
|
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')"
|
||||||
|
|
||||||
|
OUTDIR=bin
|
||||||
|
OBJDIR=obj
|
||||||
|
EXEC_FILE=cb2c.com
|
||||||
|
|
||||||
|
|
||||||
|
case $TASK in
|
||||||
|
build_exec)
|
||||||
|
C_ARGS="-O2"
|
||||||
|
CPP_ARGS="$C_ARGS"
|
||||||
|
LINKER_ARGS=""
|
||||||
|
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
|
PRE_BUILD_SCRIPT=tasks/pre_build.sh
|
||||||
|
KEREP_BUILD_TASK=build_static_lib
|
||||||
|
;;
|
||||||
|
build_exec_dbg)
|
||||||
|
C_ARGS="-O0 -g"
|
||||||
|
CPP_ARGS="$C_ARGS"
|
||||||
|
LINKER_ARGS=""
|
||||||
|
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
|
PRE_BUILD_SCRIPT=tasks/pre_build.sh
|
||||||
|
KEREP_BUILD_TASK=build_static_lib_dbg
|
||||||
|
;;
|
||||||
|
exec)
|
||||||
|
TASK_SCRIPT=cbuild/default_tasks/exec.sh
|
||||||
|
PRE_BUILD_SCRIPT=""
|
||||||
|
;;
|
||||||
|
valgrind)
|
||||||
|
VALGRIND_ARGS="-s --log-file=valgrind.log --read-var-info=yes --track-origins=yes --fullpath-after=$PROJECT/ --leak-check=full --show-leak-kinds=all"
|
||||||
|
TASK_SCRIPT=cbuild/default_tasks/valgrind.sh
|
||||||
|
PRE_BUILD_SCRIPT=""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source build_scripts/init.sh
|
|
||||||
|
|
||||||
print "${CYAN}===============[build]================\n"
|
|
||||||
clear_dir "$OUTDIR"
|
|
||||||
clear_dir "$OBJDIR"
|
|
||||||
|
|
||||||
cd kerep
|
|
||||||
make build_static_lib
|
|
||||||
cp bin/kerep.a ../obj/
|
|
||||||
printf "${GREEN}copied ${CYAN}kerep.a\n"
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
compile_c "$BUILD_C_ARGS" "$SRC_C"
|
|
||||||
compile_cpp "$BUILD_CPP_ARGS" "$SRC_CPP"
|
|
||||||
link "$BUILD_CPP_ARGS $BUILD_LINKER_ARGS" "$BUILD_FILE"
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source build_scripts/init.sh
|
|
||||||
|
|
||||||
print "${CYAN}=============[build_dbg]==============\n"
|
|
||||||
clear_dir "$OUTDIR"
|
|
||||||
clear_dir "$OBJDIR"
|
|
||||||
|
|
||||||
cd kerep
|
|
||||||
make build_static_lib_dbg
|
|
||||||
cp bin/kerep.a ../obj/
|
|
||||||
printf "${GREEN}copied ${CYAN}kerep.a\n"
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
compile_c "$BUILD_DBG_C_ARGS" "$SRC_C"
|
|
||||||
compile_cpp "$BUILD_DBG_CPP_ARGS" "$SRC_CPP"
|
|
||||||
link "$BUILD_DBG_CPP_ARGS $BUILD_DBG_LINKER_ARGS" "$BUILD_DBG_FILE"
|
|
||||||
Loading…
Reference in New Issue
Block a user