Compare commits

..

2 Commits

Author SHA1 Message Date
574ce6eab3 fixes to dependency resolution 2024-02-22 00:59:54 +06:00
c20e1e8f1c fixed typos 2024-01-02 12:28:04 +06:00
6 changed files with 108 additions and 101 deletions

View File

@ -28,9 +28,13 @@ build_static_lib:
build_static_lib_dbg: build_static_lib_dbg:
@cbuild/call_task.sh build_static_lib_dbg 2>&1 | tee make_raw.log @cbuild/call_task.sh build_static_lib_dbg 2>&1 | tee make_raw.log
# recompile libsome_dep.a in the next build task ######################################
###### Rebuild dependencies #######
######################################
# recompile libsome.a in the next build task
#rebuild_some_dep: #rebuild_some_dep:
# @cbuild/rebuild_dep.sh libsome_dep.a 2>&1 | tee make_raw.log # @cbuild/rebuild_dep.sh libsome.a 2>&1 | tee make_raw.log
#rebuild_all: rebuild_some_dep #rebuild_all: rebuild_some_dep
@ -63,7 +67,7 @@ gprof:
# compiles program and runs it with callgrind (part of valgrind) # compiles program and runs it with callgrind (part of valgrind)
# uses gprof2dot python script to generate function call tree (pip install gprof2dot) # uses gprof2dot python script to generate function call tree (pip install gprof2dot)
# requires graphviz (https://www.graphviz.org/download/source/) # requires graphviz (https://www.graphviz.org/download/source/)
# P.S. detailed rezults can be viewed in KCacheGrind # P.S. detailed results can be viewed in KCacheGrind
callgrind: callgrind:
@cbuild/call_task.sh callgrind 2>&1 | tee make_raw.log @cbuild/call_task.sh callgrind 2>&1 | tee make_raw.log

View File

@ -151,7 +151,7 @@ case "$TASK" in
# compiles program and runs it with callgrind (part of valgrind) # compiles program and runs it with callgrind (part of valgrind)
# uses gprof2dot python script to generate function call tree (pip install gprof2dot) # uses gprof2dot python script to generate function call tree (pip install gprof2dot)
# requires graphviz (https://www.graphviz.org/download/source/) # requires graphviz (https://www.graphviz.org/download/source/)
# P.S. detailed rezults can be viewed in KCacheGrind # P.S. detailed results can be viewed in KCacheGrind
callgrind) callgrind)
OUTDIR="$OUTDIR/callgrind" OUTDIR="$OUTDIR/callgrind"
# -pg adds code to executable, that generates file containing function call info (gmon.out) # -pg adds code to executable, that generates file containing function call info (gmon.out)

View File

@ -12,12 +12,14 @@ done
set +e set +e
OLDIFS="$IFS" OLDIFS="$IFS"
IFS=$'\n' IFS=$'\n'
cd "$DEPS_BASEDIR"
for dep in $DEPS; do for dep in $DEPS; do
dep_dir=$(echo ${dep/=*/} | tr -d '[:blank:]') dep_dir=$(echo ${dep/=*/} | tr -d '[:blank:]')
myprint "${CYAN}--------------[$dep_dir]--------------" myprint "${CYAN}--------------[$dep_dir]--------------"
cd "$DEPS_BASEDIR/$dep_dir" cd "$dep_dir"
make clean make clean
cd .. cd ..
done done
IFS="$OLDIFS" IFS="$OLDIFS"
cd ..
set -e set -e

View File

@ -2,10 +2,10 @@
source cbuild/colors.sh source cbuild/colors.sh
uname_rezult="$(uname -o)" uname_result="$(uname -o)"
myprint "${GRAY}uname rezult: '$uname_rezult'" myprint "${GRAY}uname result: '$uname_result'"
case "$uname_rezult" in case "$uname_result" in
Msys | Cygwin | "MS/Windows") Msys | Cygwin | "MS/Windows")
OS=WINDOWS OS=WINDOWS
;; ;;
@ -19,7 +19,7 @@ case "$uname_rezult" in
OS=MACOS OS=MACOS
;; ;;
*) *)
error "unknown operating system: $uname_rezult" error "unknown operating system: $uname_result"
;; ;;
esac esac

View File

@ -97,11 +97,12 @@ function handle_static_dependency {
[[ -z "$lib_build_task" ]] && error "lib_build_task is empty" [[ -z "$lib_build_task" ]] && error "lib_build_task is empty"
myprint "${BLUE}making $lib_file by task $lib_build_task" myprint "${BLUE}making $lib_file by task $lib_build_task"
local proj_root_dir="$(pwd)"
cd "$deps_basedir/$lib_project_dir" cd "$deps_basedir/$lib_project_dir"
if ! make "$lib_build_task"; then if ! make "$lib_build_task"; then
exit 1 exit 1
fi fi
cd .. cd "$proj_root_dir"
cp "$deps_basedir/$lib_project_dir/$lib_build_dir/$lib_file" "$OBJDIR/libs/" cp "$deps_basedir/$lib_project_dir/$lib_build_dir/$lib_file" "$OBJDIR/libs/"
myprint "${GREEN}copied ${CYAN}$lib_file to $OBJDIR/libs/" myprint "${GREEN}copied ${CYAN}$lib_file to $OBJDIR/libs/"
@ -112,7 +113,7 @@ function handle_static_dependency {
function resolve_dependencies { function resolve_dependencies {
deps_basedir=$1 deps_basedir=$1
deps=$2 deps=$2
[[ -z "$deps_basedir" ]] && deps_basedir=. [[ -z "$deps_basedir" ]] && deps_basedir="."
OLDIFS="$IFS" OLDIFS="$IFS"
IFS=$'\n' IFS=$'\n'
# Evalueting dependency expressions. # Evalueting dependency expressions.

View File

@ -3,5 +3,5 @@ source "cbuild/init.sh"
target_file="$1" target_file="$1"
touch ".rebuild_$target_file.tmp" touch ".rebuild_$target_file.tmp"
rm -fv "$OBJDIR/libs/$target_file.a" rm -fv "$OBJDIR/libs/$target_file"
myprint "${YELLOW}dependency ${WHITE}$target_file ${YELLOW}will be rebuilt with the next build task" myprint "${YELLOW}dependency ${WHITE}$target_file ${YELLOW}will be rebuilt with the next build task"