summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-02-05 05:26:13 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-02-05 05:26:13 (GMT)
commit0b9a2ebecd9c3a2d7fcb3c70e6dda17854dd2b3c (patch)
treebeded7dbeea1544403667e9b68e5e780c0222a51
parent571c9eed1aea48784b17cbbf109927d803851929 (diff)
downloadgrv-0b9a2ebecd9c3a2d7fcb3c70e6dda17854dd2b3c.zip
grv-0b9a2ebecd9c3a2d7fcb3c70e6dda17854dd2b3c.tar.gz
grv-0b9a2ebecd9c3a2d7fcb3c70e6dda17854dd2b3c.tar.bz2
grv-0b9a2ebecd9c3a2d7fcb3c70e6dda17854dd2b3c.tar.xz
Make the handling of the SDL headers a little saner
A saner way to deal with the SDL header both in and out of a subdirectory.
-rw-r--r--Makefile3
-rw-r--r--Makefile.w327
-rw-r--r--graphics.c1
-rw-r--r--grv.h9
4 files changed, 9 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index dfed040..cdb5c38 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,7 @@
CC = gcc
CWARN = -W -Wall
-REQFLAGS = -D_REENTRANT
+REQFLAGS = -D_REENTRANT -DSDL_SUBDIR
OPTFLAGS = -O2 -g
-INCLUDE = -I/usr/include/SDL
CFLAGS = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
LDFLAGS =
LIBS = -lSDL -lpthread -lm
diff --git a/Makefile.w32 b/Makefile.w32
index 68421d6..33fd412 100644
--- a/Makefile.w32
+++ b/Makefile.w32
@@ -8,15 +8,10 @@
# The SDL 1.2 development libraries for MinGW32 from http://www.libsdl.org/
#
-# Set this to whereever your SDL library is installed, from the mingw/MSYS
-# perspective seen
-SDL = /mingw/SDL-1.2.5/i386-mingw32msvc
-
CC = gcc
CWARN = -W -Wall
-REQFLAGS = -D_REENTRANT
+REQFLAGS = -D_REENTRANT -DSDL_SUBDIR
OPTFLAGS = -O2 -g
-INCLUDE = -I$(SDL)/include/SDL
CFLAGS = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
# -mwindows makes this a GUI application; -mconsole would make it a
# console application. Both are also possible, useful to get a console
diff --git a/graphics.c b/graphics.c
index b42632a..123effb 100644
--- a/graphics.c
+++ b/graphics.c
@@ -10,7 +10,6 @@
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
-#include "SDL.h"
#include "grv.h"
#include "graphics.h"
diff --git a/grv.h b/grv.h
index 5c81879..e8391f0 100644
--- a/grv.h
+++ b/grv.h
@@ -8,8 +8,13 @@
#include <string.h>
#include <errno.h>
#include "graphics.h"
-#include "SDL.h"
-#include "SDL_keyboard.h"
+#ifdef SDL_SUBDIR
+# include "SDL/SDL.h"
+# include "SDL/SDL_keyboard.h"
+#else
+# include "SDL.h"
+# include "SDL_keyboard.h"
+#endif
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))