+ifeq ($(PLATFORM),solaris) # native compiling to Solaris
+EXTRA_LDFLAGS = -lnsl -lsocket -R$(XLIB_PATH)
+PLATFORM = unix
+endif
+
+ifeq ($(PLATFORM),macosx) # native compiling to Mac OS X
+EXTRA_LDFLAGS = -lstdc++
+PLATFORM = unix
+TARGET = sdl
+endif
+
+ifeq ($(PLATFORM),os2) # native compiling to OS/2
+RANLIB = echo
+PROGNAME = ../$(PROGBASE).exe
+EXTRA_CFLAGS = -Zbin-files -D__ST_MT_ERRNO__ -Zmtd -fomit-frame-pointer
+EXTRA_LDFLAGS = -lsocket
+PLATFORM = unix
+TARGET = x11
+endif
+
+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
+endif
+
+ifeq ($(PLATFORM),cross-msdos) # cross-compiling to MS-DOS
+PROGBASE = rocks
+PROGNAME = ../$(PROGBASE).exe
+TARGET = allegro
+endif
+
+ifeq ($(PLATFORM),msdos) # native compiling to MS-DOS
+PROGBASE = rocks
+PROGNAME = ../$(PROGBASE).exe
+SYS_CFLAGS = -DTARGET_X11
+SYS_LDFLAGS = -s -lalleg
+RM = del
+endif
+
+
+# -----------------------------------------------------------------------------
+# configuring target
+# -----------------------------------------------------------------------------
+
+ifeq ($(TARGET),x11) # compiling for X11 target
+SYS_CFLAGS = -DTARGET_X11 $(X11_INCL)
+SYS_LDFLAGS = $(X11_LIBS)
+endif
+
+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),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