]>
git.cameronkatri.com Git - cc-run.git/blob - cc-run.sh
2 compiler
=$(basename "$0" | sed 's|-run$||')
7 if ! command -v "$compiler" >/dev
/null
2>&1; then
8 echo "$(basename "$0"): error: can't find compiler: '$compiler'" >&2
13 if [ "$src" = "" -a -e "$arg" -o "$arg" = "-" ]; then
15 elif [ "$src" != "" ]; then
16 exeargs
="$exeargs $arg"
23 cc
|gcc
|gcc
-*|clang
|clang
-*|tcc
)
24 if [ "$src" = '-' ]; then
27 args
="$args $CPPFLAGS $CFLAGS $LDFLAGS";;
28 c
++|g
++|g
++-*|clang
++|clang
++-*)
29 if [ "$src" = '-' ]; then
32 args
="$args $CPPFLAGS $CXXFLAGS $LDFLAGS"
35 exe
=$(mktemp -t cc-run) || exit 1
36 if ! $compiler $args $src -o $exe; then