1#!/bin/bash
2FILECHECK=$1
3CXX=$2
4PREFIX=$3
5shift 3
6SOURCE=$(echo "$@" | grep -oP '\S+\.cpp\b')
7OBJ=$(echo "$@" | grep -oP '\S+\.o\b')
8$CXX "$@" -Wno-error 2>&1 | $FILECHECK -check-prefix=$PREFIX $SOURCE
9if [ "$?" -eq 0 ]; then
10  touch $OBJ
11else
12  exit 1
13fi
14