#!/bin/bash
set -e
if [ -z "$CPP" ]; then
CPP=c++
fi
if [ -z "$TARGET" ]; then
TARGET="asteroid"
LIBS="sdl2"
FLAGS="-Wall -DGL_GLEXT_PROTOTYPES -lm -lGL"
FLAGS="`pkg-config --cflags --libs $LIBS` $FLAGS "
if [ "$1" == "debug" ]; then
FLAGS="$FLAGS -O0 -g"
echo $CPP $FLAGS *.cpp -o "$TARGET"
$CPP $FLAGS *.cpp -o "$TARGET"