From 886be342aff9fa38d3c0aa9bc7ee1209811060b9 Mon Sep 17 00:00:00 2001 From: Timerix Date: Tue, 9 Jun 2026 23:15:27 +0500 Subject: [PATCH] removed .gcda profiling info from objects list --- default_tasks/build_exec.sh | 16 ++++++---------- include/functions.sh | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/default_tasks/build_exec.sh b/default_tasks/build_exec.sh index 6033322..eaa4975 100755 --- a/default_tasks/build_exec.sh +++ b/default_tasks/build_exec.sh @@ -4,16 +4,12 @@ clean_dir "$OBJDIR/objects" rm -f "$EXEC_FILE" -# copy profiling info -prof_files=$(find "$OBJDIR/profile/" -name '*.gcda') -if [ -z "$prof_files" ]; then - myprint "${YELLOW}no profiling info found" -else - myprint "${GREEN}profiling info found" - for prof_file in $prof_files; do - myprint "${GRAY}$(basename $prof_file)" - cp $prof_file "$OBJDIR/objects/" - done +# copy profiling info to $OBJDIR/objects/ +prof_files=$(find "$OBJDIR/profile/" -type f,l | tr '\n' ' ') +if [ ! -z "$prof_files" ]; then + myprint "${GREEN}profiling info found, copying to $OBJDIR/objects/" + myprint "${GRAY}$prof_files" + cp $prof_files "$OBJDIR/objects/" fi [ ! -z "$SRC_C" ] && compile_c "$CMP_C" "$STD_C" "$WARN_C" "$C_ARGS" "$INCLUDE" "$SRC_C" diff --git a/include/functions.sh b/include/functions.sh index 3630555..9bddc1d 100755 --- a/include/functions.sh +++ b/include/functions.sh @@ -226,7 +226,7 @@ function pack_static_lib { local outfile="$1" myprint "${BLUE}outfile: ${GRAY}$outfile" - local objects=$(find $OBJDIR/objects -type f,l | tr '\n' ' ') + local objects=$(find $OBJDIR/objects \( -name "*.o" -o -name "*.a" \) -type f,l | tr '\n' ' ') myprint "${BLUE}objects: ${GRAY}$objects" if [ -z "$objects" ]; then error "no compiled objects found" @@ -252,7 +252,7 @@ function link { myprint "${BLUE}args: ${GRAY}$args" myprint "${BLUE}outfile: ${GRAY}$outfile" - local objects=$(find $OBJDIR/objects -type f,l | tr '\n' ' ') + local objects=$(find $OBJDIR/objects \( -name "*.o" -o -name "*.a" \) -type f,l | tr '\n' ' ') myprint "${BLUE}objects: ${GRAY}$objects" if [ -z "$objects" ]; then error "no compiled objects found"