X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2FMakefile;h=e42d5370f7c73fb0b4170e001fe3a45b4d48cd72;hp=bb33ce8ca879edb73d58b27d31d43afc3e01c589;hb=1be3e5c990b84f8548a80ccd6b7b209a88312141;hpb=57ef2c8d4520ca5e3d537e7b2ddccef739490cb7 diff --git a/src/Makefile b/src/Makefile index bb33ce8c..e42d5370 100644 --- a/src/Makefile +++ b/src/Makefile @@ -32,6 +32,8 @@ CONVERT_ICON_ARGS = -transparent black -background transparent PROGBASE = rocksndiamonds PROGNAME = ../$(PROGBASE) +EDITION ?= default + # ----------------------------------------------------------------------------- # configuring platform @@ -56,26 +58,19 @@ endif # configuring target # ----------------------------------------------------------------------------- -ifndef TARGET # auto-detect compiling for SDL or SDL2 +ifndef TARGET # auto-detect compiling for SDL2 SDL_VERSION := $(shell sdl2-config --version 2> /dev/null) ifdef SDL_VERSION TARGET = sdl2 else - SDL_VERSION := $(shell sdl-config --version 2> /dev/null) - ifdef SDL_VERSION - TARGET = sdl - else - $(error SDL/SDL2 library not found) - endif + $(error SDL2 library not found) endif endif # $(info Using SDL version $(SDL_VERSION) [TARGET == $(TARGET)]) ifeq ($(TARGET),sdl) # compiling for SDL target -SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags) -SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --libs) + $(error SDL library version 1.2 not supported anymore) endif ifeq ($(TARGET),sdl2) # compiling for SDL2 target @@ -97,20 +92,16 @@ ifdef RW_GAME_DIR # path to writable game data specified 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 @@ -123,7 +114,7 @@ OPTIONS = -O3 -Wall endif CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(EXTRA_CFLAGS) $(CONFIG) -LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm +LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm -lz SRCS = main.c \ @@ -200,14 +191,17 @@ 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) +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 @@ -218,7 +212,7 @@ GRAPHICS_DIR = ../graphics # 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) @@ -241,6 +235,11 @@ game_sp_dir: $(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"; \ @@ -281,6 +280,7 @@ clean-obj: $(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) @@ -319,12 +319,13 @@ valgrind: # ----------------------------------------------------------------------------- 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))