Added archive creation to build.bash and added VS Code folder to .gitignore

This commit is contained in:
Eric-Paul Ickhorn 2023-12-02 14:44:26 +01:00
parent 1f8ff01c81
commit 98a33df03c
Signed by: epickh
GPG Key ID: F5EBBE013924D95F
2 changed files with 8 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
.vscode/
.build/ .build/
.local/ .local/

7
build.bash Normal file → Executable file
View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
PROJECT_NAME="librr"
PROJECT_ROOT=`pwd` PROJECT_ROOT=`pwd`
GCC_ARGUMENTS="-std=c11 -Wall" GCC_ARGUMENTS="-std=c11 -Wall"
@ -37,13 +38,17 @@ function compile_folder() {
echo "==== Building '$SOURCE_FILE' ====" echo "==== Building '$SOURCE_FILE' ===="
gcc -c $GCC_ARGUMENTS -o $OBJECTS_FOLDER/$SOURCE_FILE.o $SOURCE_FILE $2 gcc -c $GCC_ARGUMENTS -o $OBJECTS_FOLDER/$SOURCE_FILE.o $SOURCE_FILE $2
done done
ar -rvs $PROJECT_ROOT/.build/$PROJECT_NAME-$1.a $OBJECTS_FOLDER/*.o
} }
function compile_all_modules() { function compile_all_modules() {
for MODULE in $MODULES for MODULE in $MODULES
do do
echo "============ CURRENT MODULE: $MODULE ============" echo "============ CURRENT MODULE: $MODULE ============"
compile_folder "$MODULE" "-I $PROJECT_ROOT/$MODULE/exports/" compile_folder \
"$MODULE" \
"-I $PROJECT_ROOT/$MODULE/exports/"
done done
} }