1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-26 01:07:11 -07:00

check for include dirs and args and stuff

This commit is contained in:
Connor Olding 2016-10-19 04:31:33 -07:00
parent 94851854dc
commit ac9bc094b2

View File

@ -9,7 +9,14 @@ compile() {
local sepples=0
local CC=gcc
local CXX=g++
local our_flags=(-I. "-I$HOME/src/ustl")
local our_flags=(-I.)
maybe_include() {
[ -d "$1" ] && our_flags+=("-I$1")
}
maybe_include "-I$HOME/opt/local/include"
maybe_include "-I$HOME/src/ustl"
local debug_flags=(-O1 -g);
local release_flags=(-Ofast -march=native -g0 -fomit-frame-pointer -s -DNDEBUG)
local dr_flags=(-Ofast -march=native -g -fomit-frame-pointer -DNDEBUG)
@ -29,7 +36,8 @@ compile() {
{ [ $1 = debug ] && our_flags+=($debug_flags) && shift } || \
{ [ $1 = release ] && our_flags+=($release_flags) && shift } || \
{ [ $1 = derelease ] && our_flags+=($dr_flags) && shift }
{ [ $1 = derelease ] && our_flags+=($dr_flags) && shift } || \
{ echo "please specify either debug or (de)release" >&2; return 1 }
# TODO add static option