+ifeq ($(PLATFORM),unix) # native compiling to Unix (generic)
+PROFILING_FLAGS = -pg
+endif
+
+ifeq ($(PLATFORM),cross-win32) # cross-compiling to Windows
+PROGNAME = ../$(PROGBASE).exe
+EXTRA_LDFLAGS = -lshfolder -lwsock32
+# TARGET = sdl
+TARGET = sdl2
+endif
+
+
+# -----------------------------------------------------------------------------
+# configuring target
+# -----------------------------------------------------------------------------
+
+ifeq ($(TARGET),sdl) # compiling for SDL target
+SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags)
+SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg
+SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --libs)
+endif
+
+ifeq ($(TARGET),sdl2) # compiling for SDL2 target
+SYS_CFLAGS = -DTARGET_SDL2 $(shell sdl2-config --cflags)
+SDL_LIBS = -lSDL2_image -lSDL2_mixer -lSDL2_net -lsmpeg2
+SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl2-config --libs)
+endif
+
+ifeq ($(TARGET),sdl-static) # compiling for SDL target (static)
+SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags)
+SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg -lmikmod
+SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --static-libs)
+endif
+
+ifeq ($(TARGET),sdl2-static) # compiling for SDL2 target (static)
+SYS_CFLAGS = -DTARGET_SDL2 $(shell sdl2-config --cflags)
+SDL_LIBS = -lSDL2_image -lSDL2_mixer -lSDL2_net -lsmpeg2 -lmikmod
+SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl2-config --static-libs)
+endif
+
+
+# -----------------------------------------------------------------------------
+# configuring compile-time definitions
+# -----------------------------------------------------------------------------