added optional button to restart game (door, panel and touch variants)
[rocksndiamonds.git] / src / Makefile
index b9a75a6bb4289a691393fc810c41ff534e8943b4..b7289d01ddc7a8492dd83ef6729d2956120c35df 100644 (file)
@@ -44,8 +44,6 @@ DEBUGGER = gdb -batch -ex "run" -ex "bt"
 PROGBASE = rocksndiamonds
 PROGNAME = ../$(PROGBASE)
 
-EDITION ?= default
-
 
 # -----------------------------------------------------------------------------
 # configuring platform
@@ -72,6 +70,7 @@ endif
 
 ifeq ($(shell uname -s),Darwin)                # compiling on Mac OS X
 DEBUGGER = lldb --batch -o "run" -k "bt" -k "quit"
+SANITIZING_FLAGS = -fsanitize=undefined
 ifdef BUILD_DIST                       # distribution build
 MAC_TARGET_VERSION_MIN = 10.7
 EXTRA_FLAGS_MAC = -mmacosx-version-min=$(MAC_TARGET_VERSION_MIN)
@@ -81,6 +80,11 @@ MACOSX_DEPLOYMENT_TARGET = $MAC_TARGET_VERSION_MIN
 endif
 endif
 
+ifeq ($(shell uname -s),OS/2)          # compiling on OS/2
+PROGNAME = ../$(PROGBASE).exe
+EXTRA_LDFLAGS = -Zomf -Zbin-files -Zmap -lcx -Zhigh-mem
+endif
+
 
 # -----------------------------------------------------------------------------
 # configuring target
@@ -126,12 +130,14 @@ CONFIG = $(CONFIG_BASE_PATH) $(JOYSTICK)
 
 DEBUG = -DDEBUG -g
 
-# PROFILING = $(PROFILING_FLAGS)
+# ANALYZE = $(PROFILING_FLAGS)
+# ANALYZE = $(SANITIZING_FLAGS)
 
 # OPTIONS = $(DEBUG) -Wall                     # only for debugging purposes
 # OPTIONS = $(DEBUG) -O2 -Wall                 # only for debugging purposes
 # OPTIONS = $(DEBUG) -Wall                     # only for debugging purposes
 OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes
+# OPTIONS = $(DEBUG) -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes
 # OPTIONS = $(DEBUG) -Wall -ansi -pedantic     # only for debugging purposes
 # OPTIONS = -O2 -Wall -ansi -pedantic
 # OPTIONS = -O2 -Wall
@@ -147,8 +153,8 @@ SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) |        \
 OPTIONS = -O2 -Wall
 endif
 
-CFLAGS = $(OPTIONS) $(SYS_CFLAGS)  $(EXTRA_CFLAGS) $(CONFIG)
-LDFLAGS =           $(SYS_LDFLAGS) $(EXTRA_LDFLAGS)
+CFLAGS = $(OPTIONS) $(ANALYZE) $(SYS_CFLAGS)  $(EXTRA_CFLAGS) $(CONFIG)
+LDFLAGS =           $(ANALYZE) $(SYS_LDFLAGS) $(EXTRA_LDFLAGS)
 
 
 SRCS = main.c          \
@@ -242,10 +248,10 @@ RNDLIBS = $(LIBGAME) $(GAME_EM) $(GAME_SP) $(GAME_MM)
 AUTOCONF = conf_gfx.h conf_snd.h conf_mus.h
 
 ICONBASE = windows_icon
-ICON_BASEPATH = ../Special/Icons/windows_icons
+ICON_BASEPATH = ../build-projects/windows/icons
 
 ifeq ($(PLATFORM_BASE),cross-win)
-ICON_PATH = $(ICON_BASEPATH)/$(EDITION)
+ICON_PATH = $(ICON_BASEPATH)
 ICON = $(ICONBASE).o
 endif
 
@@ -259,7 +265,7 @@ GRAPHICS_DIR = ../graphics
 all: $(AUTOCONF) libgame_dir game_em_dir game_sp_dir game_mm_dir $(PROGNAME) graphics_dir
 
 $(PROGNAME): $(RNDLIBS) $(TIMESTAMP_FILE) $(COMMIT_HASH_FILE) $(OBJS) $(ICON)
-       $(CC) $(PROFILING) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
+       $(CC) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
 ifdef BUILD_DIST
        $(STRIP) $(PROGNAME)
 endif
@@ -316,6 +322,8 @@ conf-hash:
        @echo '#define SOURCE_HASH_STRING "$(SOURCE_HASH_STRING)"' \
        > $(COMMIT_HASH_FILE)
 
+config.o: config.c $(TIMESTAMP_FILE)
+
 $(TIMESTAMP_FILE): $(SRCS) $(RNDLIBS)
        @$(MAKE) conf-time
 
@@ -323,12 +331,11 @@ $(COMMIT_HASH_FILE): $(SRCS) $(RNDLIBS)
        @$(MAKE) conf-hash
 
 $(ICON):
-#      $(CONVERT) $(ICON32X32) $(CONVERT_ICON_ARGS) $(ICONBASE).ico
        $(CONVERT) $(ICON_PATH)/*.png $(CONVERT_ICON_ARGS) $(ICONBASE).ico
        echo "$(ICONBASE) ICON $(ICONBASE).ico" | $(WINDRES) -o $(ICON)
 
 .c.o:
-       $(CC) $(PROFILING) $(CFLAGS) -c $*.c
+       $(CC) $(CFLAGS) -c $*.c
 
 graphics_dir:
        @test -f $(GRAPHICS_DIR)/Makefile && $(MAKE) -C $(GRAPHICS_DIR) || true