diff --git a/Makefile b/Makefile index c61ed41..313e58a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ ###### Build cbuild/default_tasks ####### + +all: build_exec + +rebuild_kerep: + @cbuild/call_task.sh rebuild_kerep + build_exec: @cbuild/call_task.sh build_exec build_exec_dbg: @@ -19,6 +25,4 @@ exec: build_exec @cbuild/call_task.sh exec valgrind: build_exec_dbg - @cbuild/call_task.sh valgrind - -all: build_exec + @cbuild/call_task.sh diff --git a/cbuild b/cbuild index af91a89..cd6b3df 160000 --- a/cbuild +++ b/cbuild @@ -1 +1 @@ -Subproject commit af91a8927b5c33350af093d324c2106c9a193a1d +Subproject commit cd6b3dfa1e2f6fc78257f55f611c13272f09686e diff --git a/default.config b/default.config index 52235aa..37c4ea7 100644 --- a/default.config +++ b/default.config @@ -1,6 +1,6 @@ #!/bin/bash CBUILD_VERSION=3 -CONFIG_VERSION=4 +CONFIG_VERSION=5 PROJECT=cobek echo "reading $PROJECT default config..." @@ -20,6 +20,9 @@ OBJDIR=obj EXEC_FILE=cb2c.com case $TASK in + rebuild_kerep) + TASK_SCRIPT=tasks/rebuild_kerep.sh + ;; build_exec) C_ARGS="-O2" CPP_ARGS="$C_ARGS" diff --git a/kerep b/kerep index f09aa09..fed82e5 160000 --- a/kerep +++ b/kerep @@ -1 +1 @@ -Subproject commit f09aa092c1eb4769ca83dfac2976dc3da21f9a5f +Subproject commit fed82e58d30615379e811aa9068c9002c0576179 diff --git a/tasks/pre_build.sh b/tasks/pre_build.sh index 9dcc12e..4f3a298 100755 --- a/tasks/pre_build.sh +++ b/tasks/pre_build.sh @@ -1,9 +1,13 @@ #!/bin/bash -cd kerep -if [ ! -f "bin/kerep.a" ]; then - exec make "$KEREP_BUILD_TASK" +if [ ! -f "kerep/bin/kerep.a" ] || [ -f .rebuild_kerep ] +then + cd kerep + if ! make "$KEREP_BUILD_TASK"; then + exit 1 + fi + cd .. + rm -rf .rebuild_kerep fi -cp bin/kerep.a ../obj/ +cp kerep/bin/kerep.a obj/ printf "${GREEN}copied ${CYAN}kerep.a\n" -cd .. diff --git a/tasks/rebuild_kerep.sh b/tasks/rebuild_kerep.sh new file mode 100644 index 0000000..ea7e93b --- /dev/null +++ b/tasks/rebuild_kerep.sh @@ -0,0 +1,3 @@ +#!/bin/bash +touch .rebuild_kerep +printf "kerep.a will be rebuilt in the next build task"