aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-13 11:19:02 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-13 11:19:02 -0700
commit07ebce53997ff1f317b533ffd91e15f1b831c3e3 (patch)
tree1e7721ebb8b512fd995e19db6b5b8ef50e8bb510
parent26c1defaad14ef6c43cbed08bac46cfc32b1f4c8 (diff)
downloadgrv-07ebce53997ff1f317b533ffd91e15f1b831c3e3.tar.gz
grv-07ebce53997ff1f317b533ffd91e15f1b831c3e3.tar.xz
grv-07ebce53997ff1f317b533ffd91e15f1b831c3e3.zip
Makefile: use sdl-config
-rw-r--r--Makefile15
-rw-r--r--grv.h15
2 files changed, 17 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 2f8b6e7..9dee60d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,15 @@
CC = gcc
-CWARN = -W -Wall -Wno-pointer-sign
-REQFLAGS = -D_REENTRANT -DSDL_SUBDIR
+
+SDLFLAGS := $(shell sdl-config --cflags)
+SDLLIBS := $(shell sdl-config --libs)
+
+CWARN = -W -Wall -Wno-pointer-sign -Wno-stringop-truncation
+REQFLAGS = -D_REENTRANT
OPTFLAGS = -O2 -g
-CFLAGS = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
-LDFLAGS =
-LIBS = -lSDL -lpthread -lm
+CPPFLAGS = $(REQFLAGS) $(INCLUDE) $(SDLFLAGS)
+CFLAGS = $(CPPFLAGS) $(CWARN) $(OPTFLAGS)
+LDFLAGS = $(CFLAGS)
+LIBS = $(SDLLIBS) -lm
PERL = perl
ALL = grv grvscored
diff --git a/grv.h b/grv.h
index 9db797c..ea11e8e 100644
--- a/grv.h
+++ b/grv.h
@@ -8,14 +8,11 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+
+#include <SDL.h>
+#include <SDL_keyboard.h>
+
#include "graphics.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))
@@ -60,7 +57,9 @@ struct gameparams {
int KulSpr;
int Bon; /* Bonus available right now */
int TF; /* double? */
- int FS; /* Ghost speed (1 normal, -1 scared, 0 frozen) */
+ int FS; /* Ghost direction (1 normal, -1 scared, 0 frozen) */
+ int FSdiv; /* Ghost movement divider */
+ int FScnt; /* Divider down counter */
int x, y; /* Player coordinates */
int XWk, YWk; /* Player movement */