OPTS="-g" # option for compiler call
objs="" # List of .o files
+libs=""
CC="gcc --ansi --pedantic -Wall -Wextra -Wformat-security -Wcast-align -Wno-uninitialized -Wno-unused-variable -Wno-unused-label -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-unused-but-set-variable" # Default compiler call
ext="_savo _sav" # Default flavor to reuse
out="a.out" # Default output binary filename
-R Force full recompilation
-O Compile with optimizations
-i Use the intel compiler instead of gcc
+-l C library to link with
-ll Use the clang compiler (llvm) instead of gcc
-I path Add a include directory
-o name Call name the executable
-R) recompile=true; shift;;
-O) OPTS="$OPTS -O2" ext="_savo"; shift;;
-i) CC="/opt/intel/cc/10.1.015/bin/icc -O2" ext="_savi"; shift;;
+ -l) libs="$libs -l$2"; shift;;
-ll) CC="clang --ansi --pedantic -O3"; ext="_savll"; shift;;
-I) OPTS="$OPTS -I $2"; shift; shift;;
-o) out="$2"; shift; shift;;
done
if [ $vverbose = true ] ; then
- echo "* $CC $OPTS -lm $objs -o $out" >&2
+ echo "* $CC $OPTS $objs -lm $libs -o $out" >&2
fi
-$CC $OPTS -lm $objs -o "$out"
+$CC $OPTS $objs -lm $libs -o "$out"
end
if tc.boost then f.write(" -O")
if not tc.cc_link then f.write(" -x \"-c\"")
- for l in tc.cc_libs do f.write(" -x \"-l {l}\"")
+ for l in tc.cc_libs do f.write(" -l {l}")
for lp in tc.cc_lib_paths do f.write(" -x \"-L {lp}\"")
for ip in tc.cc_include_paths do f.write(" -x \"-I {ip}\"")
f.write(" \"$@\" \\\n {files.join("\\\n ")}\n")