X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2FMakefile;h=d034771b175b750a31b4dacd6144d3bbaf49e531;hb=8be31c2781126204470171aff7af45713ec42e9e;hp=17615f9017d8ba7bc57e3dd235d7b6fc74b647e1;hpb=0e5a0f487acaed09a34c655b83ea637c83f4a0f0;p=rocksndiamonds.git diff --git a/src/Makefile b/src/Makefile index 17615f90..d034771b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,13 +34,23 @@ ifeq ($(PLATFORM),solaris) EXTRA_LIBS = -lnsl -lsocket -R$(XLIB_PATH) endif +ifeq ($(PLATFORM),windows) +PROGNAME = ../rocksndiamonds.exe +TARGET = sdl +else +PROFILING = -pg +endif + +ifeq ($(TARGET),sdl) USE_SDL = true -USE_SDL_OLD_LIBS = true +else +USE_SDL = false +endif ifeq ($(USE_SDL_OLD_LIBS),true) -SDL_EXTRA_LIBS = -lIMG +SDL_EXTRA_LIBS = -lIMG -lmixer else -SDL_EXTRA_LIBS = -lSDL_image +SDL_EXTRA_LIBS = -lSDL_image -lSDL_mixer endif SDL_CFLAGS := -DUSE_SDL_LIBRARY $(shell sdl-config --cflags) @@ -60,7 +70,7 @@ endif INCL = $(SYS_CFLAGS) LIBS = $(SYS_LDFLAGS) $(EXTRA_LIBS) -lm -endif +endif # (PLATFORM != dos) ifdef RO_GAME_DIR # path to read-only game data specified @@ -79,9 +89,11 @@ CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(SOUNDS) $(JOYSTICK) +DEBUG = -DDEBUG -g -# OPTIONS = -DDEBUG -g -Wall -ansi -pedantic # only for debugging purposes -OPTIONS = -DDEBUG -g -Wall # only for debugging purposes +OPTIONS = $(DEBUG) -Wall # only for debugging purposes +# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes +# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes # OPTIONS = -O3 -Wall -ansi -pedantic # OPTIONS = -O3 -Wall # OPTIONS = -O3 @@ -141,11 +153,24 @@ OBJS = main.o \ all: $(PROGNAME) $(PROGNAME): $(OBJS) - $(CC) $(OBJS) $(LIBS) -o $(PROGNAME) + $(CC) $(PROFILING) $(OBJS) $(LIBS) -o $(PROGNAME) .c.o: - $(CC) $(CFLAGS) -c $*.c + $(CC) $(PROFILING) $(CFLAGS) -c $*.c clean: $(RM) *.o + $(RM) ../*.exe $(RM) $(PROGNAME) + + +#-----------------------------------------------------------------------------# +# development only stuff # +#-----------------------------------------------------------------------------# + +depend: + for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend + +ifeq (.depend,$(wildcard .depend)) +include .depend +endif