X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2FMakefile;h=a0d7cfa2cce5c5e06e0866b334cd3f523bd38773;hb=df11f4a529251a285f3a33946da81623044fef3f;hp=f0d9c3ed8fda5e024402ae2e46fe02b9423d9e23;hpb=91d08fad2fcec7e2b5931b4f336a89d14af313dd;p=rocksndiamonds.git diff --git a/src/Makefile b/src/Makefile index f0d9c3ed..a0d7cfa2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,11 +1,16 @@ -#=============================================================================# -# Makefile for Rocks'n'Diamonds # -# (c) 1995-2002 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 @@ -64,19 +69,25 @@ TARGET = allegro endif ifeq ($(PLATFORM),cross-win32) +EXTRA_LDFLAGS = -lshfolder PROGNAME = ../$(PROGBASE).exe TARGET = sdl endif ifeq ($(TARGET),x11) SYS_CFLAGS = -DTARGET_X11 $(X11_INCL) -SYS_LDFLAGS = $(X11_LIBS) -lX11 +# SYS_LDFLAGS = $(X11_LIBS) -lX11 +SYS_LDFLAGS = $(XLIB_PATH)/libX11.a 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 @@ -106,7 +117,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 @@ -124,6 +136,8 @@ LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm SRCS = main.c \ conf_gfx.c \ conf_snd.c \ + conf_mus.c \ + conf_hlp.c \ init.c \ config.c \ events.c \ @@ -140,6 +154,8 @@ SRCS = main.c \ OBJS = main.o \ conf_gfx.o \ conf_snd.o \ + conf_mus.o \ + conf_hlp.o \ init.o \ config.o \ events.o \ @@ -153,6 +169,24 @@ OBJS = main.o \ network.o \ netserv.o +CNFS = conf_gfx.h \ + conf_snd.h \ + conf_mus.h \ + conf_chr.c \ + conf_chr.h \ + conf_cus.c \ + conf_cus.h \ + conf_grp.c \ + conf_grp.h \ + conf_e2g.c \ + conf_esg.c \ + conf_e2s.c \ + conf_fnt.c \ + conf_g2s.c \ + conf_g2m.c + +CNFS_CMD = ../Scripts/create_element_defs.pl + TIMESTAMP_FILE = conftime.h LIBDIR = libgame @@ -165,6 +199,10 @@ ICON = $(ICONBASE).o endif +# ----------------------------------------------------------------------------- +# build targets +# ----------------------------------------------------------------------------- + all: libgame_dir $(PROGNAME) $(PROGNAME): $(LIBGAME) $(TIMESTAMP_FILE) $(OBJS) $(ICON) @@ -175,15 +213,20 @@ 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 - ../Scripts/create_element_defs.pl --gfx > conf_gfx.h - ../Scripts/create_element_defs.pl --chr > conf_chr.c - ../Scripts/create_element_defs.pl --cus > conf_cus.c - ../Scripts/create_element_defs.pl --e2g > conf_e2g.c - ../Scripts/create_element_defs.pl --esg > conf_esg.c + @$(MAKE) auto-conf conf_snd.h: conf_snd.c - ../Scripts/create_element_defs.pl --snd > conf_snd.h + @$(MAKE) auto-conf + +conf_mus.h: conf_mus.c + @$(MAKE) auto-conf $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) @date '+"[%Y-%m-%d %H:%M]"' \ @@ -213,9 +256,9 @@ clean-bin: clean: clean-obj clean-ico clean-bin -#-----------------------------------------------------------------------------# -# development only stuff # -#-----------------------------------------------------------------------------# +# ----------------------------------------------------------------------------- +# development only +# ----------------------------------------------------------------------------- dist-clean: clean-obj