added build support for older versions of Mac OS X
[rocksndiamonds.git] / src / Makefile
index b3a18b5e8376783f38f370f7d6a6201ae2cdd656..70fb390f18d84e966bda5cd583fc35fdb611ec58 100644 (file)
@@ -48,11 +48,6 @@ EDITION ?= default
 # configuring platform
 # -----------------------------------------------------------------------------
 
-ifeq ($(PLATFORM),macosx)              # compiling on Mac OS X
-EXTRA_LDFLAGS = -lstdc++
-override PLATFORM = unix
-endif
-
 ifeq ($(PLATFORM),unix)                        # compiling on Unix/Linux (generic)
 PROFILING_FLAGS = -pg
 endif
@@ -62,6 +57,16 @@ PROGNAME = ../$(PROGBASE).exe
 EXTRA_LDFLAGS = -lshfolder -lwsock32
 endif
 
+ifdef BUILD_DIST                       # distribution build
+ifeq ($(shell uname -s),Darwin)                # compiling on Mac OS X
+MAC_TARGET_VERSION_MIN = 10.7
+EXTRA_FLAGS_MAC = -mmacosx-version-min=$(MAC_TARGET_VERSION_MIN)
+EXTRA_CFLAGS = $(EXTRA_FLAGS_MAC)
+EXTRA_LDFLAGS = $(EXTRA_FLAGS_MAC)
+MACOSX_DEPLOYMENT_TARGET = $MAC_TARGET_VERSION_MIN
+endif
+endif
+
 
 # -----------------------------------------------------------------------------
 # configuring target
@@ -78,10 +83,6 @@ endif
 
 # $(info Using SDL version $(SDL_VERSION) [TARGET == $(TARGET)])
 
-ifeq ($(TARGET),sdl)                   # compiling for SDL target
-  $(error SDL library version 1.2 not supported anymore)
-endif
-
 ifeq ($(TARGET),sdl2)                  # compiling for SDL2 target
 SYS_CFLAGS = -DTARGET_SDL2 $(shell sdl2-config --cflags)
 SDL_LIBS = -lSDL2_image -lSDL2_mixer -lSDL2_net