]>
git.cameronkatri.com Git - cc-run.git/blob - cc-run.sh
2 compiler
=$(basename "$0" | sed 's|-run$||')
3 exe
=$(mktemp -t cc-run) || exit 1
8 if ! command -v "$compiler" >/dev
/null
2>&1; then
9 echo "$(basename "$0"): error: can't find compiler: '$compiler'" >&2
14 if [ -e "$arg" ] && [ "$src" = "" ]; then
16 elif [ "$src" != "" ]; then
17 exeargs
="$exeargs $arg"
24 cc
|gcc
|gcc
-*|clang
|clang
-*)
25 args
="$args $CPPFLAGS $CFLAGS $LDFLAGS";;
26 c
++|g
++|g
++-*|clang
++|clang
++-*)
27 args
="$args $CPPFLAGS $CXXFLAGS $LDFLAGS"
30 $compiler $args $src -o $exe || exit 1