X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2FMakefile;h=46a9ddd29df4b9bc7fbe225afb15fa1913ef2c5e;hb=a2c9a458aaa4ac568f07ecd25b19fbca3f766e6b;hp=f4f503fc9cf2555e6242422fe1ab605f6af7a198;hpb=efd0d0abb853018aa3ccc3c727b39bd7f5ba679d;p=rocksndiamonds.git diff --git a/src/Makefile b/src/Makefile index f4f503fc..46a9ddd2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,11 +1,16 @@ -#=============================================================================# -# Makefile for Rocks'n'Diamonds # -# (c) 1995-2000 Holger Schemel, info@artsoft.org # -#=============================================================================# +# ============================================================================= +# Rocks'n'Diamonds Makefile (src) +# ----------------------------------------------------------------------------- +# (c) 1995-2003 Holger Schemel +# ============================================================================= + +# ----------------------------------------------------------------------------- +# configuration +# ----------------------------------------------------------------------------- .EXPORT_ALL_VARIABLES: -ifndef PLATFORM # platform not specified -- try auto detection +ifndef PLATFORM # no platform specified -- try auto detection ifdef COMSPEC PLATFORM = msdos else @@ -48,6 +53,11 @@ EXTRA_LDFLAGS = -lnsl -lsocket -R$(XLIB_PATH) PLATFORM = unix endif +ifeq ($(PLATFORM),macosx) +PLATFORM = unix +TARGET=sdl +endif + ifeq ($(PLATFORM),unix) PROFILING_FLAGS = -pg endif @@ -59,6 +69,7 @@ TARGET = allegro endif ifeq ($(PLATFORM),cross-win32) +EXTRA_LDFLAGS = -lshfolder PROGNAME = ../$(PROGBASE).exe TARGET = sdl endif @@ -70,8 +81,12 @@ endif ifeq ($(TARGET),sdl) SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags) +ifeq ($(PLATFORM),macosx) +SYS_LDFLAGS = -lSDL_image -lSDL_mixer -lsmpeg $(shell sdl-config --libs) +else SYS_LDFLAGS = -lSDL_image -lSDL_mixer $(shell sdl-config --libs) endif +endif ifeq ($(TARGET),allegro) SYS_CFLAGS = -DTARGET_ALLEGRO -I$(CROSS_PATH_MSDOS)/include @@ -101,7 +116,8 @@ DEBUG = -DDEBUG -g # PROFILING = $(PROFILING_FLAGS) # OPTIONS = $(DEBUG) -Wall # only for debugging purposes -OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes +# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes +OPTIONS = $(DEBUG) -Wall # only for debugging purposes # OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes # OPTIONS = -O3 -Wall -ansi -pedantic # OPTIONS = -O3 -Wall @@ -117,7 +133,10 @@ LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm SRCS = main.c \ + conf_gfx.c \ + conf_snd.c \ init.c \ + config.c \ events.c \ tools.c \ screens.c \ @@ -125,13 +144,15 @@ SRCS = main.c \ editor.c \ files.c \ tape.c \ - joystick.c \ cartoons.c \ network.c \ netserv.c OBJS = main.o \ + conf_gfx.o \ + conf_snd.o \ init.o \ + config.o \ events.o \ tools.o \ screens.o \ @@ -139,11 +160,25 @@ OBJS = main.o \ editor.o \ files.o \ tape.o \ - joystick.o \ cartoons.o \ network.o \ netserv.o +CNFS = conf_gfx.h \ + conf_snd.h \ + conf_chr.c \ + conf_chr.h \ + conf_cus.c \ + conf_cus.h \ + conf_e2g.c \ + conf_esg.c \ + conf_e2s.c \ + conf_fnt.c + +CNFS_CMD = ../Scripts/create_element_defs.pl + +TIMESTAMP_FILE = conftime.h + LIBDIR = libgame LIBGAME = $(LIBDIR)/libgame.a @@ -154,9 +189,13 @@ ICON = $(ICONBASE).o endif +# ----------------------------------------------------------------------------- +# build targets +# ----------------------------------------------------------------------------- + all: libgame_dir $(PROGNAME) -$(PROGNAME): $(LIBGAME) $(OBJS) $(ICON) +$(PROGNAME): $(LIBGAME) $(TIMESTAMP_FILE) $(OBJS) $(ICON) $(CC) $(PROFILING) $(OBJS) $(ICON) $(LIBGAME) $(LDFLAGS) -o $(PROGNAME) libgame_dir: @@ -164,6 +203,23 @@ libgame_dir: $(LIBGAME): @$(MAKE) -C $(LIBDIR) +auto-conf: + @for i in $(CNFS); do \ + echo "$(CNFS_CMD) $$i > $$i"; \ + $(CNFS_CMD) $$i > $$i; \ + done + +conf_gfx.h: conf_gfx.c + @$(MAKE) auto-conf + +conf_snd.h: conf_snd.c + @$(MAKE) auto-conf + +$(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) + @date '+"[%Y-%m-%d %H:%M]"' \ + | sed -e 's/^/#define COMPILE_DATE_STRING /' \ + > $(TIMESTAMP_FILE) + $(ICON): $(BMP2ICO) -transparent $(ICONBASE).ico $(ICON32X32) echo "$(ICONBASE) ICON $(ICONBASE).ico" | $(WINDRES) -o $(ICON) @@ -187,9 +243,9 @@ clean-bin: clean: clean-obj clean-ico clean-bin -#-----------------------------------------------------------------------------# -# development only stuff # -#-----------------------------------------------------------------------------# +# ----------------------------------------------------------------------------- +# development only +# ----------------------------------------------------------------------------- dist-clean: clean-obj