PROGBASE = rocksndiamonds
PROGNAME = ../$(PROGBASE)
+EDITION ?= default
+
# -----------------------------------------------------------------------------
# configuring platform
CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\""
endif
-ifdef SCORE_ENTRIES # number of score entries per player
-CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
-endif
-
-CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
-CONFIG_GAME = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES)
+CONFIG = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) $(JOYSTICK)
-CONFIG = $(CONFIG_GAME) $(JOYSTICK)
DEBUG = -DDEBUG -g
+
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes
-OPTIONS = $(DEBUG) -Wall # only for debugging purposes
+# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
+OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes
# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes
# OPTIONS = -O3 -Wall -ansi -pedantic
# OPTIONS = -O3 -Wall
editor.c \
files.c \
tape.c \
- cartoons.c \
+ anim.c \
network.c \
netserv.c
editor.o \
files.o \
tape.o \
- cartoons.o \
+ anim.o \
network.o \
netserv.o
CNFS_CMD = ../build-scripts/create_element_defs.pl
TIMESTAMP_FILE = conftime.h
+TIMESTAMP_FORMAT = %Y-%m-%d %H:%M
+
+# use SOURCE_DATE_EPOCH, or else last Git commit date, or else current date
+SOURCE_DATE_EPOCH ?= $(shell test -d ../.git && test `git ls-files -m | wc -l` -eq 0 && git show -s --format=%ct || date +%s)
+
+# get source date string from either GNU / Linux or BSD / Mac OS X style "date"
+SOURCE_DATE_STRING := $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(TIMESTAMP_FORMAT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(TIMESTAMP_FORMAT)" 2>/dev/null || date -u "+$(TIMESTAMP_FORMAT)")
LIBGAME_DIR = libgame
LIBGAME = $(LIBGAME_DIR)/libgame.a
GAME_SP_DIR = game_sp
GAME_SP = $(GAME_SP_DIR)/game_sp.a
-RNDLIBS = $(LIBGAME) $(GAME_EM) $(GAME_SP)
+GAME_MM_DIR = game_mm
+GAME_MM = $(GAME_MM_DIR)/game_mm.a
+
+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
ifeq ($(PLATFORM),cross-win32)
-ICON_PATH = $(ICON_BASEPATH)/default
+ICON_PATH = $(ICON_BASEPATH)/$(EDITION)
ICON = $(ICONBASE).o
endif
# build targets
# -----------------------------------------------------------------------------
-all: $(AUTOCONF) libgame_dir game_em_dir game_sp_dir $(PROGNAME) graphics_dir
+all: $(AUTOCONF) libgame_dir game_em_dir game_sp_dir game_mm_dir $(PROGNAME) graphics_dir
$(PROGNAME): $(RNDLIBS) $(TIMESTAMP_FILE) $(OBJS) $(ICON)
$(CC) $(PROFILING) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
$(GAME_SP):
@$(MAKE) -C $(GAME_SP_DIR)
+game_mm_dir:
+ @$(MAKE) -C $(GAME_MM_DIR)
+$(GAME_MM):
+ @$(MAKE) -C $(GAME_MM_DIR)
+
auto-conf:
@for i in $(CNFS); do \
echo "$(CNFS_CMD) $$i > $$i"; \
conf_mus.h: conf_mus.c $(CNFS_CMD)
@$(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 /' \
+ @echo '#define SOURCE_DATE_STRING "$(SOURCE_DATE_STRING)"' \
> $(TIMESTAMP_FILE)
$(ICON):
$(MAKE) -C $(LIBGAME_DIR) clean
$(MAKE) -C $(GAME_EM_DIR) clean
$(MAKE) -C $(GAME_SP_DIR) clean
+ $(MAKE) -C $(GAME_MM_DIR) clean
$(RM) $(OBJS)
$(RM) $(RNDLIBS)
# -----------------------------------------------------------------------------
tags:
- $(ETAGS) *.[ch] $(LIBGAME_DIR)/*.[ch] $(GAME_EM_DIR)/*.[ch] $(GAME_SP_DIR)/*.[ch]
+ $(ETAGS) *.[ch] $(LIBGAME_DIR)/*.[ch] $(GAME_EM_DIR)/*.[ch] $(GAME_SP_DIR)/*.[ch] $(GAME_MM_DIR)/*.[ch]
depend:
$(MAKE) -C $(LIBGAME_DIR) depend
$(MAKE) -C $(GAME_EM_DIR) depend
$(MAKE) -C $(GAME_SP_DIR) depend
+ $(MAKE) -C $(GAME_MM_DIR) depend
for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
ifeq (.depend,$(wildcard .depend))