]> git.sesse.net Git - movit/commitdiff
Add sdl-config --cflags and --libs when compiling.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 21 Jan 2013 21:04:00 +0000 (22:04 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 21 Jan 2013 21:04:00 +0000 (22:04 +0100)
Makefile

index 83e6852a578d91203cc476017c700d8b83f1b92c..cea223443588a324ef701b8d601dace68250d3af 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,20 @@ ifeq ($(GLEW_LIBS),)
 $(error Empty GLEW_LIBS. You probably need to install GLEW)
 endif
 
+SDL_CXXFLAGS := $(shell sdl-config --cflags)
+ifeq ($(SDL_CXXFLAGS),)
+$(error Empty SDL_CXXFLAGS. You probably need to install SDL)
+endif
+
+SDL_LIBS := $(shell sdl-config --libs)
+ifeq ($(SDL_LIBS),)
+$(error Empty SDL_LIBS. You probably need to install SDL)
+endif
+
 CC=gcc
 CXX=g++
 CXXFLAGS=-Wall -g -I$(GTEST_DIR)/include $(EIGEN_CXXFLAGS) $(GLEW_CXXFLAGS)
-LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread -lpng $(GLEW_LIBS)
+LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread -lpng $(GLEW_LIBS) $(SDL_LIBS)
 RANLIB=ranlib
 
 ifeq ($(COVERAGE),1)