# Workaround for FreeBSD crazyness
SDLCONFIG = `which sdl-config 2> /dev/null || which sdl11-config`

# Avoid running sdl-config in backticks for every invocation of gcc
SDLCFLAGS = $(shell $(SDLCONFIG) --cflags)
SDLLIBS = $(shell $(SDLCONFIG) --libs) -lSDL_mixer

DEBUG_FLAGS = -g
#DEBUG_FLAGS = -g -DDEBUG
OPT_FLAGS   = # -Os
BASE_CFLAGS = -Wall -Werror $(DEBUG_FLAGS) $(OPT_FLAGS) $(SDLCFLAGS)
CFLAGS      = $(BASE_CFLAGS) $(CSTRICTNESS)
CXXFLAGS    = $(BASE_CFLAGS) $(CXXSTRICTNESS)
LIBS        = $(SDLLIBS) # -s -Wl,O1
