replaced confusing u64 joinded colors with struct TimStyle
This commit is contained in:
@@ -38,17 +38,19 @@ STATIC_LIB_FILE="$PROJECT.a"
|
||||
# example: "-I./include -I$DEPENDENCIES_DIR/libexample"
|
||||
INCLUDE="-Iinclude -Isrc"
|
||||
|
||||
EXEC_FILE=""
|
||||
EXEC_EXT=""
|
||||
|
||||
# OS-specific options
|
||||
case "$OS" in
|
||||
WINDOWS)
|
||||
EXEC_FILE="snek.exe"
|
||||
EXEC_EXT=".exe"
|
||||
SHARED_LIB_FILE="$PROJECT.dll"
|
||||
INCLUDE="$INCLUDE "
|
||||
# example: "-lSDL2 -lSDL2_image"
|
||||
LINKER_LIBS=""
|
||||
;;
|
||||
LINUX)
|
||||
EXEC_FILE="snek"
|
||||
SHARED_LIB_FILE="$PROJECT.so"
|
||||
INCLUDE="$INCLUDE "
|
||||
LINKER_LIBS=""
|
||||
@@ -60,26 +62,72 @@ esac
|
||||
|
||||
# TASKS
|
||||
case "$TASK" in
|
||||
# creates executable using profiling info if it exists
|
||||
build_exec)
|
||||
SRC_C="$SRC_C example/snek.c"
|
||||
# -flto applies more optimizations across object files
|
||||
# -flto=auto is needed to multithreaded copilation
|
||||
# -fuse-linker-plugin is required to use static libs with lto
|
||||
# -fprofile-use enables compiler to use profiling info files to optimize executable
|
||||
# -fprofile-prefix-path sets path where profiling info about objects are be saved
|
||||
# -fdata-sections -ffunction-sections -Wl,--gc-sections removes unused code
|
||||
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects -fdata-sections -ffunction-sections -Wl,--gc-sections"
|
||||
# ./ask question?
|
||||
ask)
|
||||
EXEC_FILE="ask$EXEC_EXT"
|
||||
SRC_C="example/ask.c"
|
||||
LINKER_LIBS="bin/tim.a"
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||
PRE_TASK_SCRIPT=""
|
||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
||||
POST_TASK_SCRIPT="@cbuild/default_tasks/strip_exec.sh"
|
||||
POST_TASK_SCRIPT=""
|
||||
;;
|
||||
# creates executable with debug info and no optimizations
|
||||
build_exec_dbg)
|
||||
SRC_C="$SRC_C example/snek.c"
|
||||
C_ARGS="-O0 -g3"
|
||||
# hello world
|
||||
hello)
|
||||
EXEC_FILE="hello$EXEC_EXT"
|
||||
SRC_C="example/hello.c"
|
||||
LINKER_LIBS="bin/tim.a"
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||
PRE_TASK_SCRIPT=""
|
||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
||||
POST_TASK_SCRIPT=""
|
||||
;;
|
||||
# snake game
|
||||
snek)
|
||||
EXEC_FILE="snek$EXEC_EXT"
|
||||
SRC_C="example/snek.c"
|
||||
LINKER_LIBS="bin/tim.a"
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||
PRE_TASK_SCRIPT=""
|
||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
||||
POST_TASK_SCRIPT=""
|
||||
;;
|
||||
# test
|
||||
test)
|
||||
EXEC_FILE="test$EXEC_EXT"
|
||||
SRC_C="test/test.c"
|
||||
LINKER_LIBS="bin/tim.a"
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||
PRE_TASK_SCRIPT=""
|
||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
||||
POST_TASK_SCRIPT=""
|
||||
;;
|
||||
# color
|
||||
color)
|
||||
EXEC_FILE="color$EXEC_EXT"
|
||||
SRC_C="test/color.c"
|
||||
LINKER_LIBS="bin/tim.a"
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||
PRE_TASK_SCRIPT=""
|
||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
||||
POST_TASK_SCRIPT=""
|
||||
;;
|
||||
# string
|
||||
string)
|
||||
EXEC_FILE="string$EXEC_EXT"
|
||||
SRC_C="test/string.c"
|
||||
LINKER_LIBS="bin/tim.a"
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||
PRE_TASK_SCRIPT=""
|
||||
|
||||
Reference in New Issue
Block a user