9 Commits

Author SHA1 Message Date
46029cd01f typo fixes 2025-07-18 02:21:12 +03:00
5953b84cff fixed detect_os.sh again 2025-06-20 19:29:52 +05:00
4c34c127a6 removed '\r' AGAIN 2025-06-20 19:21:34 +05:00
cae29d6395 removed \r characters from detect_os.sh 2025-06-20 19:11:08 +05:00
596c570756 v2.2.2 2025-04-26 03:58:53 +05:00
1c93d4eb73 bootstrap can show help for cbuild installations again 2025-04-26 03:57:09 +05:00
6126001e5a copy dependency's out files only if they are newer or don't exist 2025-04-26 00:23:13 +05:00
912b348f57 v2.2.1 2025-04-25 21:11:12 +05:00
d3d7867736 bootstrap v1.0.2 2025-04-25 21:09:52 +05:00
9 changed files with 37 additions and 23 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# git add --renormalize .
*.sh text eol=lf

View File

@@ -1 +1 @@
2.2.0 2.2.3

View File

@@ -1,3 +1,13 @@
## 2.2.3
+ removed `\r` characters from `detect_os.sh`
## 2.2.2
+ `bootstrap.sh` can show help for cbuild installations again
+ copy dependency out files only if they are newer or don't exist
## 2.2.1
+ updated `bootsrap.sh` to 1.0.2
## 2.2.0 ## 2.2.0
+ **config**: removed slash after `--fullpath-after` in `VALGRIND_ARGS` + **config**: removed slash after `--fullpath-after` in `VALGRIND_ARGS`
+ **config**: removed `CONFIG_VERSION` variable + **config**: removed `CONFIG_VERSION` variable

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
CBUILD_BOOTSTRAP_VERSION=1.0.1 CBUILD_BOOTSTRAP_VERSION=1.0.3
set -eo pipefail set -eo pipefail
function version_parse { function version_parse {
@@ -34,13 +34,14 @@ function print_version_list {
dir_global="/usr/local/share/cbuild" dir_global="/usr/local/share/cbuild"
files="" files=""
if [ -d "$dir_local" ]; then if [ -d "$dir_local" ]; then
files+="$(find $dir_local -name 'CBUILD_VERSION')" files+=$(find "$dir_local" -maxdepth 2 -name 'CBUILD_VERSION')
fi fi
if [ -d "$dir_global" ]; then if [ -d "$dir_global" ]; then
files+="$(find $dir_global -name 'CBUILD_VERSION')" files+=$(find "$dir_global" -maxdepth 2 -name 'CBUILD_VERSION')
fi fi
for f in $files; do for f in $files; do
cat $f | sed '$a\' cat $f
echo " at $(dirname $f)"
done | sort -V done | sort -V
} }
@@ -68,6 +69,9 @@ do
case "${args[i]}" in case "${args[i]}" in
'-v' | '--version') '-v' | '--version')
echo "cbuild-bootstrap v$CBUILD_BOOTSTRAP_VERSION" echo "cbuild-bootstrap v$CBUILD_BOOTSTRAP_VERSION"
echo "list of installed cbuild versions:"
print_version_list
exit 0
;; ;;
'-h' | '--help') '-h' | '--help')
print_help print_help
@@ -76,10 +80,6 @@ do
i=$((i+1)) i=$((i+1))
project_config_path="${args[i]}" project_config_path="${args[i]}"
;; ;;
'--list-versions')
print_version_list
exit 0
;;
*) *)
;; ;;
esac esac
@@ -93,9 +93,9 @@ if [ -z "$CBUILD_VERSION" ]; then
else else
echo "project config not found" echo "project config not found"
echo "list of installed cbuild versions:" echo "list of installed cbuild versions:"
versions=$(print_version_list) print_version_list
# cut installation directories from list
echo "$versions" versions=$(print_version_list | cut -d ' ' -f 1)
latest_version=$(echo "$versions" | tail -n 1) latest_version=$(echo "$versions" | tail -n 1)
echo "select version (default=$latest_version):" echo "select version (default=$latest_version):"
read -r CBUILD_VERSION read -r CBUILD_VERSION

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
INSTALLED_CBUILD_VERSION=2.2.0 INSTALLED_CBUILD_VERSION=2.2.3
# set \t size to 4 spaces # set \t size to 4 spaces
tabs 4 tabs 4

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
CBUILD_VERSION=2.2.0 CBUILD_VERSION=2.2.3
PROJECT="%PROJECT_NAME%" PROJECT="%PROJECT_NAME%"
CMP_C="gcc" CMP_C="gcc"
@@ -26,20 +26,22 @@ OBJDIR="obj"
OUTDIR="bin" OUTDIR="bin"
STATIC_LIB_FILE="lib$PROJECT.a" STATIC_LIB_FILE="lib$PROJECT.a"
# example: "-I./dependencies/include/SDL2"
INCLUDE=""
# OS-specific options # OS-specific options
case "$OS" in case "$OS" in
WINDOWS) WINDOWS)
EXEC_FILE="$PROJECT.exe" EXEC_FILE="$PROJECT.exe"
SHARED_LIB_FILE="$PROJECT.dll" SHARED_LIB_FILE="$PROJECT.dll"
# example: "-I./dependencies/include/SDL2" INCLUDE="$INCLUDE "
INCLUDE=""
# example: "-lSDL2 -lSDL2_image" # example: "-lSDL2 -lSDL2_image"
LINKER_LIBS="" LINKER_LIBS=""
;; ;;
LINUX) LINUX)
EXEC_FILE="$PROJECT" EXEC_FILE="$PROJECT"
SHARED_LIB_FILE="$PROJECT.so" SHARED_LIB_FILE="$PROJECT.so"
INCLUDE="" INCLUDE="$INCLUDE "
LINKER_LIBS="" LINKER_LIBS=""
;; ;;
*) *)

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
DEP_WORKING_DIR='depencencies/libexample1' DEP_WORKING_DIR='dependencies/libexample1'
DEP_PRE_BUILD_COMMAND='' DEP_PRE_BUILD_COMMAND=''
DEP_BUILD_COMMAND='make libexample1.a' DEP_BUILD_COMMAND='make libexample1.a'
DEP_POST_BUILD_COMMAND='' DEP_POST_BUILD_COMMAND=''

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
DEP_WORKING_DIR='depencencies/libexample2' DEP_WORKING_DIR='dependencies/libexample2'
DEP_PRE_BUILD_COMMAND='' DEP_PRE_BUILD_COMMAND=''
DEP_POST_BUILD_COMMAND='' DEP_POST_BUILD_COMMAND=''
DEP_CLEAN_COMMAND='make clean' DEP_CLEAN_COMMAND='make clean'

View File

@@ -90,10 +90,10 @@ function build_dependency {
if [ "$PRESERVE_OUT_DIRECTORY_STRUCTURE" = true ] && [ "$file_dir" != '.' ]; then if [ "$PRESERVE_OUT_DIRECTORY_STRUCTURE" = true ] && [ "$file_dir" != '.' ]; then
mkdir -p "$proj_root_dir/$OUTDIR/$file_dir" mkdir -p "$proj_root_dir/$OUTDIR/$file_dir"
mkdir -p "$proj_root_dir/$OBJDIR/dynamic_libs/$file_dir" mkdir -p "$proj_root_dir/$OBJDIR/dynamic_libs/$file_dir"
cp -v "$file" "$proj_root_dir/$OUTDIR/$file" cp -v -u --preserve=timestamps "$file" "$proj_root_dir/$OUTDIR/$file"
ln -sfv "$real_file" "$proj_root_dir/$OBJDIR/dynamic_libs/$file" ln -sfv "$real_file" "$proj_root_dir/$OBJDIR/dynamic_libs/$file"
else else
cp -v "$file" "$proj_root_dir/$OUTDIR/" cp -v -u --preserve=timestamps "$file" "$proj_root_dir/$OUTDIR/"
ln -sfv "$real_file" "$proj_root_dir/$OBJDIR/dynamic_libs/" ln -sfv "$real_file" "$proj_root_dir/$OBJDIR/dynamic_libs/"
fi fi
done done
@@ -104,9 +104,9 @@ function build_dependency {
if [ "$PRESERVE_OUT_DIRECTORY_STRUCTURE" = true ]; then if [ "$PRESERVE_OUT_DIRECTORY_STRUCTURE" = true ]; then
file_dir=$(dirname $file) file_dir=$(dirname $file)
mkdir -p "$proj_root_dir/$OUTDIR/$file_dir" mkdir -p "$proj_root_dir/$OUTDIR/$file_dir"
cp -v "$file" "$proj_root_dir/$OUTDIR/$file" cp -v -u --preserve=timestamps "$file" "$proj_root_dir/$OUTDIR/$file"
else else
cp -v "$file" "$proj_root_dir/$OUTDIR/" cp -v -u --preserve=timestamps "$file" "$proj_root_dir/$OUTDIR/"
fi fi
done done
fi fi