INCLUDE
This commit is contained in:
parent
d64b1f3e9b
commit
d72aa0c809
@ -2,6 +2,7 @@
|
|||||||
+ `build_profile` task was split to `profile` and `gprof`
|
+ `build_profile` task was split to `profile` and `gprof`
|
||||||
+ added task `sanitize`
|
+ added task `sanitize`
|
||||||
+ default C++ standard set to `c++11`
|
+ default C++ standard set to `c++11`
|
||||||
|
+ added `INCLUDE` to `default.config`
|
||||||
|
|
||||||
# v5
|
# v5
|
||||||
+ added task `clean`
|
+ added task `clean`
|
||||||
|
|||||||
@ -28,10 +28,13 @@ 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./"
|
||||||
|
INCLUDE=""
|
||||||
;;
|
;;
|
||||||
LINUX)
|
LINUX)
|
||||||
EXEC_FILE="$PROJECT"
|
EXEC_FILE="$PROJECT"
|
||||||
SHARED_LIB_FILE="$PROJECT.so"
|
SHARED_LIB_FILE="$PROJECT.so"
|
||||||
|
INCLUDE=""
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error "operating system $OS has no configuration variants"
|
error "operating system $OS has no configuration variants"
|
||||||
|
|||||||
10
functions.sh
10
functions.sh
@ -32,14 +32,16 @@ function compile {
|
|||||||
myprint "${BLUE}warnings: ${GRAY}$warn"
|
myprint "${BLUE}warnings: ${GRAY}$warn"
|
||||||
local args="$4"
|
local args="$4"
|
||||||
myprint "${BLUE}args: ${GRAY}$args"
|
myprint "${BLUE}args: ${GRAY}$args"
|
||||||
local sources="$5"
|
local include="$5"
|
||||||
|
myprint "${BLUE}include dirs: ${GRAY}$include"
|
||||||
|
local sources="$6"
|
||||||
myprint "${BLUE}sources: ${GRAY}$sources"
|
myprint "${BLUE}sources: ${GRAY}$sources"
|
||||||
local compilation_error=0
|
local compilation_error=0
|
||||||
|
|
||||||
for srcfile in $sources
|
for srcfile in $sources
|
||||||
do (
|
do (
|
||||||
local object="$OBJDIR/objects/$(basename $srcfile).o"
|
local object="$OBJDIR/objects/$(basename $srcfile).o"
|
||||||
if ! $($cmp -std=$std $warn $args -c -o $object $srcfile)
|
if ! $($cmp -std=$std $warn $args $include -c -o $object $srcfile)
|
||||||
then
|
then
|
||||||
error "some error happened"
|
error "some error happened"
|
||||||
#TODO parallel variable assignement doesnt work in bash
|
#TODO parallel variable assignement doesnt work in bash
|
||||||
@ -58,13 +60,13 @@ function compile {
|
|||||||
# (args, sources)
|
# (args, sources)
|
||||||
function compile_c {
|
function compile_c {
|
||||||
myprint "${CYAN}-------------[compile_c]--------------"
|
myprint "${CYAN}-------------[compile_c]--------------"
|
||||||
compile "$CMP_C" "$STD_C" "$WARN_C" "$1" "$2"
|
compile "$CMP_C" "$STD_C" "$WARN_C" "$1" "$INCLUDE" "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
# (args, sources)
|
# (args, sources)
|
||||||
function compile_cpp {
|
function compile_cpp {
|
||||||
myprint "${CYAN}------------[compile_cpp]-------------"
|
myprint "${CYAN}------------[compile_cpp]-------------"
|
||||||
compile "$CMP_CPP" "$STD_CPP" "$WARN_CPP" "$1" "$2"
|
compile "$CMP_CPP" "$STD_CPP" "$WARN_CPP" "$1" "$INCLUDE" "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
# (args, outfile)
|
# (args, outfile)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user