+TIMESTAMP_FILE = conftime.h
+
+LIBGAME_DIR = libgame
+LIBGAME = $(LIBGAME_DIR)/libgame.a
+
+GAME_EM_DIR = game_em
+GAME_EM = $(GAME_EM_DIR)/game_em.a
+
+GAME_SP_DIR = game_sp
+GAME_SP = $(GAME_SP_DIR)/game_sp.a
+
+RNDLIBS = $(LIBGAME) $(GAME_EM) $(GAME_SP)
+AUTOCONF = conf_gfx.h conf_snd.h conf_mus.h
+
+ICONBASE = windows_icon
+ICON_BASEPATH = ../Special/Icons/windows_icons
+ifeq ($(PLATFORM),cross-win32)
+ifdef SPECIAL_EDITION
+# ICONSUFFIX = 32x32_$(SPECIAL_EDITION)
+ICON_PATH = $(ICON_BASEPATH)/$(SPECIAL_EDITION)
+else
+# ICONSUFFIX = 32x32
+ICON_PATH = $(ICON_BASEPATH)/default
+endif
+# ICON32X32 = ../graphics/$(ICONBASE)_$(ICONSUFFIX).bmp
+ICON = $(ICONBASE).o
+endif
+
+
+# -----------------------------------------------------------------------------
+# build targets
+# -----------------------------------------------------------------------------
+
+all: $(AUTOCONF) libgame_dir game_em_dir game_sp_dir $(PROGNAME)
+
+$(PROGNAME): $(RNDLIBS) $(TIMESTAMP_FILE) $(OBJS) $(ICON)
+ $(CC) $(PROFILING) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
+
+libgame_dir:
+ @$(MAKE) -C $(LIBGAME_DIR)
+$(LIBGAME):
+ @$(MAKE) -C $(LIBGAME_DIR)
+
+game_em_dir:
+ @$(MAKE) -C $(GAME_EM_DIR)
+$(GAME_EM):
+ @$(MAKE) -C $(GAME_EM_DIR)
+
+game_sp_dir:
+ @$(MAKE) -C $(GAME_SP_DIR)
+$(GAME_SP):
+ @$(MAKE) -C $(GAME_SP_DIR)
+
+auto-conf:
+ @for i in $(CNFS); do \
+ echo "$(CNFS_CMD) $$i > $$i"; \
+ $(CNFS_CMD) $$i > $$i; \
+ done
+
+conf_gfx.h: conf_gfx.c
+ @$(MAKE) auto-conf
+
+conf_snd.h: conf_snd.c
+ @$(MAKE) auto-conf
+
+conf_mus.h: conf_mus.c
+ @$(MAKE) auto-conf
+
+# $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM) $(GAME_SP)
+$(TIMESTAMP_FILE): $(SRCS) $(RNDLIBS)
+ @date '+"%Y-%m-%d %H:%M"' \
+ | sed -e 's/^/#define COMPILE_DATE_STRING /' \
+ > $(TIMESTAMP_FILE)
+
+$(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)