--- ./rltiles/Makefile.orig	2011-08-10 18:05:30.000000000 +0200
+++ ./rltiles/Makefile	2011-10-04 20:14:30.000000000 +0200
@@ -1,7 +1,7 @@
 uname_S := $(shell uname -s)
 
 ifneq (,$(findstring MINGW,$(uname_S)))
-LDFLAGS += -lmingw32
+L_LDFLAGS += -lmingw32
 endif
 
 # Note: since generation of tiles is done on the host, we don't care about
@@ -26,17 +26,17 @@
 PNG_LIB := ../contrib/install/$(ARCH)/lib/libpng.a ../contrib/install/$(ARCH)/lib/libz.a
 endif
 
-CFLAGS := -O2 $(SDL_CFLAGS) $(PNG_INCLUDE)
-LDFLAGS += $(SDL_LDFLAGS) $(PNG_LIB)
+L_CFLAGS := $(CFLAGS) $(SDL_CFLAGS) $(PNG_INCLUDE)
+L_LDFLAGS += $(LDFLAGS) $(SDL_LDFLAGS) $(PNG_LIB)
 
 ifneq (,$(findstring MINGW,$(uname_S)))
-LDFLAGS += -lgdi32 -lwinmm
+L_LDFLAGS += -lgdi32 -lwinmm
 endif
 ifeq ($(uname_S),Darwin)
-LDFLAGS += -framework AppKit -framework AudioUnit -framework Carbon -framework IOKit -framework OpenGL
+L_LDFLAGS += -framework AppKit -framework AudioUnit -framework Carbon -framework IOKit -framework OpenGL
 endif
 ifeq ($(uname_S),Linux)
-LDFLAGS += -ldl -lpthread
+L_LDFLAGS += -ldl -lpthread
 endif
 
 # Attempt to use a full compiler name, to make
@@ -92,9 +92,9 @@
 distclean: clean
 
 %.o: %.cc
-	$(QUIET_CXX)$(CXX) $(CFLAGS) -Wp,-MD,$*.d,-MT,$@ -c $< -o $@
+	$(QUIET_CXX)$(CXX) $(L_CFLAGS) -Wp,-MD,$*.d,-MT,$@ -c $< -o $@
 
 $(TILEGEN): $(OBJECTS)
-	$(QUIET_LINK)$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
+	$(QUIET_LINK)$(CXX) $(OBJECTS) -o $@ $(L_LDFLAGS)
 
 .PHONY: all clean distclean
