EXTRA_LIBS = -lnsl -lsocket -R$(XLIB_PATH)
endif
+ifeq ($(PLATFORM),windows)
+PROGNAME = ../rocksndiamonds.exe
+TARGET = sdl
+else
+PROFILING = -pg
+endif
+
+ifeq ($(TARGET),sdl)
USE_SDL = true
-# USE_SDL = false
-USE_SDL_OLD_LIBS = true
-# USE_SDL_OLD_LIBS = false
+else
+USE_SDL = false
+endif
ifeq ($(USE_SDL_OLD_LIBS),true)
SDL_EXTRA_LIBS = -lIMG -lmixer
SDL_CFLAGS := -DUSE_SDL_LIBRARY $(shell sdl-config --cflags)
SDL_LDFLAGS := $(SDL_EXTRA_LIBS) $(shell sdl-config --libs)
-X11_CFLAGS = $(X11_INCL)
+X11_CFLAGS = -DUSE_X11_LIBRARY $(X11_INCL)
X11_LDFLAGS = $(X11_LIBS) -lX11
ifeq ($(USE_SDL),true)
INCL = $(SYS_CFLAGS)
LIBS = $(SYS_LDFLAGS) $(EXTRA_LIBS) -lm
-endif
+endif # (PLATFORM != dos)
ifdef RO_GAME_DIR # path to read-only game data specified
CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(SOUNDS) $(JOYSTICK)
+DEBUG = -DDEBUG -g
-# OPTIONS = -DDEBUG -g -Wall -ansi -pedantic # only for debugging purposes
-OPTIONS = -DDEBUG -g -Wall # only for debugging purposes
+OPTIONS = $(DEBUG) -Wall # only for debugging purposes
+# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes
+# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes
# OPTIONS = -O3 -Wall -ansi -pedantic
# OPTIONS = -O3 -Wall
# OPTIONS = -O3
all: $(PROGNAME)
$(PROGNAME): $(OBJS)
- $(CC) $(OBJS) $(LIBS) -o $(PROGNAME)
+ $(CC) $(PROFILING) $(OBJS) $(LIBS) -o $(PROGNAME)
.c.o:
- $(CC) $(CFLAGS) -c $*.c
+ $(CC) $(PROFILING) $(CFLAGS) -c $*.c
clean:
$(RM) *.o
+ $(RM) ../*.exe
$(RM) $(PROGNAME)
+
+
+#-----------------------------------------------------------------------------#
+# development only stuff #
+#-----------------------------------------------------------------------------#
+
+depend:
+ for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
+
+ifeq (.depend,$(wildcard .depend))
+include .depend
+endif