cbuild v2.0
This commit is contained in:
parent
4c5e774be0
commit
f4ed73a2a4
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,6 +1,3 @@
|
||||
[submodule "kerep"]
|
||||
path = kerep
|
||||
url = https://timerix.ddns.net:3322/Timerix/kerep.git
|
||||
[submodule "cbuild"]
|
||||
path = cbuild
|
||||
url = https://timerix.ddns.net:3322/Timerix/cbuild.git
|
||||
|
||||
75
Makefile
75
Makefile
@ -1,75 +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
|
||||
|
||||
# recompile libkerep.a in the next build task
|
||||
rebuild_kerep:
|
||||
@cbuild/rebuild_dep.sh libkerep.a 2>&1 | tee make_raw.log
|
||||
|
||||
#rebuild_all: rebuild_kerep
|
||||
|
||||
######################################
|
||||
###### 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
cbuild
1
cbuild
@ -1 +0,0 @@
|
||||
Subproject commit 6d285a88d869e7710a196aaa91a162658fe0efc0
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
CBUILD_VERSION=7
|
||||
CONFIG_VERSION=1
|
||||
#!/usr/bin/env bash
|
||||
CBUILD_VERSION=2.0.2
|
||||
CONFIG_VERSION=2
|
||||
|
||||
PROJECT="port-tunnel"
|
||||
CMP_C="gcc"
|
||||
@ -14,20 +14,17 @@ SRC_CPP="$( find src -name '*.cpp')"
|
||||
#TESTS_C="$( find tests -name '*.c')"
|
||||
#TESTS_CPP="$(find tests -name '*.cpp')"
|
||||
|
||||
# dir with dependeicy dirs
|
||||
DEPS_BASEDIR="."
|
||||
# EXAMPLE: "dependency_dir='build_task out_dir lib_file'
|
||||
# other_depndency_dir=..."
|
||||
# Dependencies must be declared on separate lines
|
||||
# Values can be override by resetting one of dependencies:
|
||||
# DEPS="$DEPS
|
||||
# dependency_dir='...'"
|
||||
DEPS="kerep='build_static_lib bin libkerep.a'"
|
||||
# Directory with dependency configs.
|
||||
# See cbuild/example_dependency_configs
|
||||
DEPENDENCY_CONFIGS_DIR='.'
|
||||
# List of dependency config files in DEPENDENCY_CONFIGS_DIR separated by space.
|
||||
ENABLED_DEPENDENCIES='libkerep'
|
||||
|
||||
# OBJDIR structure:
|
||||
# ├── objects/ - dir where compiled *.o files are stored. cleans every call of build task
|
||||
# ├── profile/ - dir where gcc *.gcda profiling info files stored
|
||||
# └── libs/ - there you can put static libs and linker will find them
|
||||
# ├── objects/ - Compiled object files. Cleans on each call of build task
|
||||
# ├── static_libs/ - Symbolic links to static libraries used by linker. Cleans on each call of build task.
|
||||
# ├── static_libs/ - Symbolic links to dynamic libraries used by linker. Cleans on each call of build task.
|
||||
# └── profile/ - gcc *.gcda profiling info files
|
||||
OBJDIR="obj"
|
||||
OUTDIR="bin"
|
||||
STATIC_LIB_FILE="lib$PROJECT.a"
|
||||
@ -74,8 +71,7 @@ case "$TASK" in
|
||||
PRE_TASK_SCRIPT=
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
POST_TASK_SCRIPT=
|
||||
DEPS="$DEPS
|
||||
kerep='build_static_lib_dbg bin libkerep.a'"
|
||||
ENABLED_DEPENDENCIES="libkerep-dbg"
|
||||
;;
|
||||
# executes $EXEC_FILE
|
||||
exec)
|
||||
@ -83,7 +79,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
|
||||
@ -139,6 +135,12 @@ case "$TASK" in
|
||||
TASK_SCRIPT=cbuild/default_tasks/exec.sh
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
# rebuilds specified dependencies
|
||||
# EXAMPLE: `cbuild rebuild_dependencies=libexample1,fonts`
|
||||
# 'all' can be specified to rebuild all dependencies
|
||||
rebuild_dependencies)
|
||||
TASK_SCRIPT=cbuild/default_tasks/rebuild_dependencies.sh
|
||||
;;
|
||||
# deletes generated files
|
||||
clean)
|
||||
TASK_SCRIPT=cbuild/default_tasks/clean.sh
|
||||
|
||||
2
kerep
2
kerep
@ -1 +1 @@
|
||||
Subproject commit 2d98bd7719fd305985999722526f27feacb78ffb
|
||||
Subproject commit b1299ebd311789887031523ec4a768f9eefb4bce
|
||||
10
libkerep-dbg.config
Normal file
10
libkerep-dbg.config
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
DEP_WORKING_DIR='kerep'
|
||||
DEP_PRE_BUILD_COMMAND=''
|
||||
DEP_BUILD_COMMAND='cbuild build_static_lib'
|
||||
DEP_POST_BUILD_COMMAND=''
|
||||
DEP_CLEAN_COMMAND='cbuild clean'
|
||||
# won't be copied to project $OUTDIR
|
||||
DEP_STATIC_OUT_FILES='bin/libkerep.a'
|
||||
# will be copied tp project $OUTDIR
|
||||
DEP_DYNAMIC_OUT_FILES=''
|
||||
10
libkerep.config
Normal file
10
libkerep.config
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
DEP_WORKING_DIR='kerep'
|
||||
DEP_PRE_BUILD_COMMAND=''
|
||||
DEP_BUILD_COMMAND='cbuild build_static_lib'
|
||||
DEP_POST_BUILD_COMMAND=''
|
||||
DEP_CLEAN_COMMAND='cbuild clean'
|
||||
# won't be copied to project $OUTDIR
|
||||
DEP_STATIC_OUT_FILES='bin/libkerep.a'
|
||||
# will be copied tp project $OUTDIR
|
||||
DEP_DYNAMIC_OUT_FILES=''
|
||||
Loading…
Reference in New Issue
Block a user