X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2FMakefile;h=da479a447fabfb9b51eac29568089292ee5817eb;hb=501680c0c919ce15ff8c33f46445659d4a534c35;hp=f33c2e86e13cef0567994089ea4f3b8179034fb7;hpb=1a5c85211f0a5b74366d264260d464266afb208d;p=rocksndiamonds.git diff --git a/src/Makefile b/src/Makefile index f33c2e86..da479a44 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,6 +19,15 @@ ifndef PLATFORM # unknown platform -- default to Unix PLATFORM = unix endif +PLATFORM_BASE = $(PLATFORM) + +ifeq ($(PLATFORM),cross-win32) +PLATFORM_BASE = cross-win +endif +ifeq ($(PLATFORM),cross-win64) +PLATFORM_BASE = cross-win +endif + AR = ar RANLIB = ranlib ETAGS = etags @@ -32,21 +41,18 @@ CONVERT_ICON_ARGS = -transparent black -background transparent PROGBASE = rocksndiamonds PROGNAME = ../$(PROGBASE) +EDITION ?= default + # ----------------------------------------------------------------------------- # configuring platform # ----------------------------------------------------------------------------- -ifeq ($(PLATFORM),macosx) # compiling on Mac OS X -EXTRA_LDFLAGS = -lstdc++ -override PLATFORM = unix -endif - ifeq ($(PLATFORM),unix) # compiling on Unix/Linux (generic) PROFILING_FLAGS = -pg endif -ifeq ($(PLATFORM),cross-win32) # cross-compiling to Windows +ifeq ($(PLATFORM_BASE),cross-win) # cross-compiling to Windows PROGNAME = ../$(PROGBASE).exe EXTRA_LDFLAGS = -lshfolder -lwsock32 endif @@ -56,28 +62,17 @@ 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) -endif - ifeq ($(TARGET),sdl2) # compiling for SDL2 target SYS_CFLAGS = -DTARGET_SDL2 $(shell sdl2-config --cflags) SDL_LIBS = -lSDL2_image -lSDL2_mixer -lSDL2_net @@ -105,7 +100,8 @@ DEBUG = -DDEBUG -g # 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 @@ -118,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 \ @@ -204,8 +200,8 @@ 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 +ifeq ($(PLATFORM_BASE),cross-win) +ICON_PATH = $(ICON_BASEPATH)/$(EDITION) ICON = $(ICONBASE).o endif