CC=g++
SDLCONFIG=sdl-config
CFLAGS  = -c -Wall -O3
CFLAGS += $(shell $(SDLCONFIG) --cflags)
CFLAGS += -D__OGGPLAYER -I.. -I../BlinkenBMF -I../SDL_gfx
LIBS = -lSDL_image -lSDL_ttf -lSDL_mixer
LDFLAGS = $(shell $(SDLCONFIG) --libs) ${LIBS}

BLINKENPLAYERSOURCES = ${wildcard *.cpp}
BLINKENPLAYEROBJECTS = $(BLINKENPLAYERSOURCES:.cpp=.o)

all: ../blinkenplayer

.cpp.o: Makefile
	$(CC) $(CFLAGS) $< -o $@

BLINKENPLAYERSOURCES = ${wildcard *.cpp ../SDL_gfx/*.cpp}
BLINKENPLAYEROBJECTS = $(BLINKENPLAYERSOURCES:.cpp=.o)

../blinkenplayer: $(BLINKENPLAYEROBJECTS)
	${CC} -o $@ $(BLINKENPLAYEROBJECTS) ${LDFLAGS}

clean:
	rm -f $(BLINKENPLAYEROBJECTS)
	rm -f ../blinkenplayer
