--- Makefile.orig	Fri Mar 17 16:03:03 2006
+++ Makefile	Mon Mar 27 01:01:12 2006
@@ -12,10 +12,9 @@
 
 
 # Commands to use (I recommend the GNU versions (sometimes called gsed, gcp, gtar, ...)
-CC=g++
+CC?=cc
 GREP=grep
 SED=sed
-SDLCONFIG=sdl-config
 INSTALL=install
 MAKEDEPEND=makedepend
 CP=cp
@@ -28,7 +27,7 @@
 BZIP2=bzip2
 RPMBUILD=rpmbuild
 
-PREFIX=/usr/local
+PREFIX?=/usr/local
 BINDIR=$(PREFIX)/bin
 SHAREDIR=$(PREFIX)/share/blinkensisters
 DOCDIR=$(PREFIX)/share/doc/blinkensisters
@@ -36,11 +35,8 @@
 # get the version number from globals.h
 VERSION=$(shell $(GREP) "^.define.VERSION" globals.h | $(SED) "s/^.define.VERSION.//" )
 
-CFLAGS  = -c -Wall -O3 -IBlinkenLUA/headers
-CFLAGS += $(shell $(SDLCONFIG) --cflags)
-CFLAGS += -DRESPATH="\"$(SHAREDIR)/\""
-
-LDFLAGS = $(shell $(SDLCONFIG) --libs)
+CFLAGS += -c -Wall -IBlinkenLUA/headers `${SDL_CONFIG} --cflags` -DRESPATH="\"$(SHAREDIR)/\""
+LDFLAGS = `${SDL_CONFIG} --libs`
 
 
 SOURCES = ${wildcard *.cpp BlinkenLUA/source/*.cpp}
@@ -62,7 +58,7 @@
 all: $(EXECUTABLE)
 
 $(EXECUTABLE): $(OBJECTS) Makefile
-	$(CC) $(LDFLAGS) $(OBJECTS) -o $@ -lSDL -lSDL_mixer -lSDL_image -lSDL_ttf
+	$(CC) $(LDFLAGS) $(OBJECTS) -o $@ -lSDL_mixer -lSDL_image -lSDL_ttf
 
 .cpp.o: Makefile
 	$(CC) $(CFLAGS) $< -o $@
@@ -113,8 +109,6 @@
 
 
 # rule for building dependency lists, and writing them to a file ".depend".
-.depend: $(SOURCES) $(HEADERS)
-	$(MAKEDEPEND) -f- -- $(CFLAGS) -- $(SOURCES) $(HEADERS) > .depend
 
 
 tar.gz: clean
@@ -143,4 +137,4 @@
 # include a dependency file if one exists
 ifeq (.depend,$(wildcard .depend))
 include .depend
-endif
\ No newline at end of file
+endif
