cbuild/default_tasks/build_exec.sh

21 lines
635 B
Bash
Executable File

#!/usr/bin/env bash
# delete old objects
clean_dir "$OBJDIR/objects"
# 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
fi
[ ! -z "$SRC_C" ] && compile_c "$CMP_C" "$STD_C" "$WARN_C" "$C_ARGS" "$INCLUDE" "$SRC_C"
[ ! -z "$SRC_CPP" ] && compile_cpp "$CMP_CPP" "$STD_CPP" "$WARN_CPP" "$CPP_ARGS" "$INCLUDE" "$SRC_CPP"
link "$LINKER_ARGS" "$EXEC_FILE"