Compare commits
5 Commits
c30a23669b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e722cd0353 | |||
| dd8e0d0552 | |||
| b1299ebd31 | |||
| 2d98bd7719 | |||
| 04e38ddf79 |
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,4 +0,0 @@
|
||||
[submodule "cbuild"]
|
||||
path = cbuild
|
||||
url = https://github.com/Timerix22/cbuild.git
|
||||
branch = main
|
||||
85
Makefile
85
Makefile
@@ -1,85 +0,0 @@
|
||||
######################################
|
||||
###### Build tasks #######
|
||||
######################################
|
||||
|
||||
all: build_exec_dbg
|
||||
|
||||
# creates executable using profiling info generated by profile
|
||||
build_exec: profile
|
||||
@cbuild/call_task.sh build_exec 2>&1 | tee -a make_raw.log
|
||||
|
||||
# creates executable with debug info and no optimizations
|
||||
build_exec_dbg:
|
||||
@cbuild/call_task.sh build_exec_dbg 2>&1 | tee make_raw.log
|
||||
|
||||
# creates shared library
|
||||
build_shared_lib:
|
||||
@cbuild/call_task.sh build_shared_lib 2>&1 | tee make_raw.log
|
||||
|
||||
# creates shared library with debug symbols and no optimizations
|
||||
build_shared_lib_dbg:
|
||||
@cbuild/call_task.sh build_shared_lib_dbg 2>&1 | tee make_raw.log
|
||||
|
||||
# creates static library
|
||||
build_static_lib:
|
||||
@cbuild/call_task.sh build_static_lib 2>&1 | tee make_raw.log
|
||||
|
||||
# creates static library with debug symbols and no optimizations
|
||||
build_static_lib_dbg:
|
||||
@cbuild/call_task.sh build_static_lib_dbg 2>&1 | tee make_raw.log
|
||||
|
||||
######################################
|
||||
###### Launch tasks #######
|
||||
######################################
|
||||
|
||||
# executes $EXEC_FILE
|
||||
exec: build_exec
|
||||
@cbuild/call_task.sh exec 2>&1 | tee -a make_raw.log
|
||||
|
||||
# executes $EXEC_FILE
|
||||
exec_dbg: build_exec_dbg
|
||||
@cbuild/call_task.sh exec 2>&1 | tee -a make_raw.log
|
||||
|
||||
# executes $EXEC_FILE with valgrind memory checker
|
||||
valgrind: build_exec_dbg
|
||||
@cbuild/call_task.sh valgrind 2>&1 | tee -a make_raw.log
|
||||
|
||||
# generates profiling info
|
||||
profile:
|
||||
@cbuild/call_task.sh profile 2>&1 | tee make_raw.log
|
||||
|
||||
# compiles program with -pg and runs it with gprof
|
||||
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
||||
# requires graphviz (https://www.graphviz.org/download/source/)
|
||||
gprof:
|
||||
@cbuild/call_task.sh gprof 2>&1 | tee make_raw.log
|
||||
|
||||
# compiles program and runs it with callgrind (part of valgrind)
|
||||
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
||||
# requires graphviz (https://www.graphviz.org/download/source/)
|
||||
# P.S. detailed results can be viewed in KCacheGrind
|
||||
callgrind:
|
||||
@cbuild/call_task.sh callgrind 2>&1 | tee make_raw.log
|
||||
|
||||
# compiles executable with sanitizers and executes it to find errors and warnings
|
||||
sanitize:
|
||||
@cbuild/call_task.sh sanitize 2>&1 | tee make_raw.log
|
||||
|
||||
######################################
|
||||
###### Other tasks #######
|
||||
######################################
|
||||
|
||||
# deletes generated files
|
||||
clean:
|
||||
@cbuild/call_task.sh clean 2>&1 | tee make_raw.log
|
||||
|
||||
# removes all unreadable characters copied from stdio
|
||||
fix_log:
|
||||
sed 's/[^[:blank:][:print:]]//g' make_raw.log \
|
||||
| sed 's/\[0;[0-9][0-9]m//g' \
|
||||
| sed 's/\[0;[0-9]m//g' \
|
||||
| sed 's/\[[0-9][0-9]m//g' \
|
||||
| sed 's/\[[0-9]m//g' \
|
||||
| sed 's/ H //g' \
|
||||
| sed 's/\[3gH //g' \
|
||||
> make_fixed.log
|
||||
@@ -1,3 +1,3 @@
|
||||
# kerep
|
||||
|
||||
My library written in C
|
||||
My library written in C.
|
||||
Requires [cbuild](https://timerix.ddns.net:3322/Timerix/cbuild).
|
||||
|
||||
1
cbuild
1
cbuild
Submodule cbuild deleted from 574ce6eab3
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
CBUILD_VERSION=7
|
||||
CONFIG_VERSION=8
|
||||
CBUILD_VERSION=2.1.1
|
||||
CONFIG_VERSION=9
|
||||
|
||||
PROJECT="kerep"
|
||||
CMP_C="gcc"
|
||||
@@ -65,6 +65,8 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
POST_TASK_SCRIPT=
|
||||
SRC_C+=" $TESTS_C"
|
||||
SRC_CPP+=" $TESTS_CPP"
|
||||
;;
|
||||
# creates executable with debug info and no optimizations
|
||||
build_exec_dbg)
|
||||
@@ -74,6 +76,8 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
POST_TASK_SCRIPT=
|
||||
SRC_C+=" $TESTS_C"
|
||||
SRC_CPP+=" $TESTS_CPP"
|
||||
;;
|
||||
# creates shared library
|
||||
build_shared_lib)
|
||||
@@ -115,7 +119,7 @@ case "$TASK" in
|
||||
;;
|
||||
# executes $EXEC_FILE with valgrind memory checker
|
||||
valgrind)
|
||||
VALGRIND_ARGS="-s --read-var-info=yes --track-origins=yes --fullpath-after=$PROJECT/ --leak-check=full --show-leak-kinds=all"
|
||||
VALGRIND_ARGS="-s --read-var-info=yes --track-origins=yes --fullpath-after=$(pwd) --leak-check=full --show-leak-kinds=all"
|
||||
TASK_SCRIPT=cbuild/default_tasks/valgrind.sh
|
||||
;;
|
||||
# generates profiling info
|
||||
@@ -133,6 +137,8 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
TASK_SCRIPT=cbuild/default_tasks/profile.sh
|
||||
POST_TASK_SCRIPT=
|
||||
SRC_C+=" $TESTS_C"
|
||||
SRC_CPP+=" $TESTS_CPP"
|
||||
;;
|
||||
# compiles program with -pg and runs it with gprof
|
||||
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
||||
@@ -146,6 +152,8 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
TASK_SCRIPT=cbuild/default_tasks/gprof.sh
|
||||
POST_TASK_SCRIPT=
|
||||
SRC_C+=" $TESTS_C"
|
||||
SRC_CPP+=" $TESTS_CPP"
|
||||
;;
|
||||
# compiles program and runs it with callgrind (part of valgrind)
|
||||
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
||||
@@ -160,6 +168,8 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
POST_TASK_SCRIPT=cbuild/default_tasks/callgrind.sh
|
||||
SRC_C+=" $TESTS_C"
|
||||
SRC_CPP+=" $TESTS_CPP"
|
||||
;;
|
||||
# compiles executable with sanitizers and executes it to find errors and warnings
|
||||
sanitize)
|
||||
@@ -170,13 +180,15 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
TASK_SCRIPT=cbuild/default_tasks/exec.sh
|
||||
POST_TASK_SCRIPT=
|
||||
SRC_C+=" $TESTS_C"
|
||||
SRC_CPP+=" $TESTS_CPP"
|
||||
;;
|
||||
# deletes generated files
|
||||
clean)
|
||||
TASK_SCRIPT=cbuild/default_tasks/clean.sh
|
||||
;;
|
||||
# nothing to do
|
||||
no_task)
|
||||
"" | no_task)
|
||||
;;
|
||||
# unknown task
|
||||
*)
|
||||
Reference in New Issue
Block a user