X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2FMakefile;h=39eaad9f0e49e498455e767d993a7385f7ea6ac2;hb=959794cfda1f83edc51512211ae5a9f6b1e0b179;hp=3a9230f201910f9a330c03032b65e83ac01746f9;hpb=c91aa2b237bef6003ead8dfc98cdcab89f97c654;p=rocksndiamonds.git diff --git a/src/Makefile b/src/Makefile index 3a9230f2..39eaad9f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,13 +10,9 @@ .EXPORT_ALL_VARIABLES: -ifndef PLATFORM # unknown platform -- try auto detection -ifdef COMSPEC -PLATFORM = msdos -else +ifndef PLATFORM # unknown platform -- default to Unix PLATFORM = unix endif -endif ifdef X11_PATH # path to X11 from top level Makefile XINC_PATH = $(X11_PATH)/include @@ -75,21 +71,8 @@ endif ifeq ($(PLATFORM),cross-win32) # cross-compiling to Windows PROGNAME = ../$(PROGBASE).exe EXTRA_LDFLAGS = -lshfolder -lwsock32 -TARGET = sdl -endif - -ifeq ($(PLATFORM),cross-msdos) # cross-compiling to MS-DOS -PROGBASE = rocks -PROGNAME = ../$(PROGBASE).exe -TARGET = allegro -endif - -ifeq ($(PLATFORM),msdos) # native compiling to MS-DOS -PROGBASE = rocks -PROGNAME = ../$(PROGBASE).exe -SYS_CFLAGS = -DTARGET_X11 -SYS_LDFLAGS = -s -lalleg -RM = del +# TARGET = sdl +TARGET = sdl2 endif @@ -98,25 +81,32 @@ endif # ----------------------------------------------------------------------------- ifeq ($(TARGET),x11) # compiling for X11 target -SYS_CFLAGS = -DTARGET_X11 $(X11_INCL) +SYS_CFLAGS = -DTARGET_X11 $(X11_INCL) SYS_LDFLAGS = $(X11_LIBS) endif ifeq ($(TARGET),sdl) # compiling for SDL target -SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags) +SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags) SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg 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 -lsmpeg2 +SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl2-config --libs) +endif + ifeq ($(TARGET),sdl-static) # compiling for SDL target (static) -SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags) +SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags) SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg -lmikmod SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --static-libs) endif -ifeq ($(TARGET),allegro) # compiling for Allegro target -SYS_CFLAGS = -DTARGET_ALLEGRO -I$(CROSS_PATH_MSDOS)/include -SYS_LDFLAGS = -lalleg +ifeq ($(TARGET),sdl2-static) # compiling for SDL2 target (static) +SYS_CFLAGS = -DTARGET_SDL2 $(shell sdl2-config --cflags) +SDL_LIBS = -lSDL2_image -lSDL2_mixer -lSDL2_net -lsmpeg2 -lmikmod +SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl2-config --static-libs) endif @@ -146,7 +136,7 @@ CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) CONFIG_GAME = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(CONFIG_SPECIAL) CONFIG = $(CONFIG_GAME) $(JOYSTICK) -# DEBUG = -DDEBUG -g +DEBUG = -DDEBUG -g # PROFILING = $(PROFILING_FLAGS) # OPTIONS = $(DEBUG) -Wall # only for debugging purposes @@ -220,7 +210,7 @@ CNFS = conf_gfx.h \ conf_var.c \ conf_act.c -CNFS_CMD = ../Scripts/create_element_defs.pl +CNFS_CMD = ../build-scripts/create_element_defs.pl TIMESTAMP_FILE = conftime.h @@ -327,13 +317,13 @@ clean: clean-obj clean-ico clean-bin # run and test targets # ----------------------------------------------------------------------------- -run: all +run: cd .. && ./$(PROGBASE) --verbose -gdb: all +gdb: cd .. && gdb -batch -x GDB_COMMANDS ./$(PROGBASE) -valgrind: all +valgrind: cd .. && valgrind -v --leak-check=yes ./$(PROGBASE) 2> valgrind.out