projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rocksndiamonds-2.0.1
[rocksndiamonds.git]
/
src
/
Makefile
diff --git
a/src/Makefile
b/src/Makefile
index cc8e1df0439b9abf95affa76278759f823248dc1..f4f503fc9cf2555e6242422fe1ab605f6af7a198 100644
(file)
--- a/
src/Makefile
+++ b/
src/Makefile
@@
-3,6
+3,8
@@
# (c) 1995-2000 Holger Schemel, info@artsoft.org #
#=============================================================================#
# (c) 1995-2000 Holger Schemel, info@artsoft.org #
#=============================================================================#
+.EXPORT_ALL_VARIABLES:
+
ifndef PLATFORM # platform not specified -- try auto detection
ifdef COMSPEC
PLATFORM = msdos
ifndef PLATFORM # platform not specified -- try auto detection
ifdef COMSPEC
PLATFORM = msdos
@@
-18,11
+20,18
@@
X11_INCL = -I$(XINC_PATH)
X11_LIBS = -L$(XLIB_PATH)
endif
X11_LIBS = -L$(XLIB_PATH)
endif
+AR = ar
+RANLIB = ranlib
+
+BMP2ICO = bmp2ico
+WINDRES = windres
ifeq ($(PLATFORM),msdos) # MS-DOS native compiling
RM = del
ifeq ($(PLATFORM),msdos) # MS-DOS native compiling
RM = del
-PROGNAME = ../rocks.exe
+
+PROGBASE = rocks
+PROGNAME = ../$(PROGBASE).exe
SYS_CFLAGS = -DTARGET_X11
SYS_LDFLAGS = -s -lalleg
SYS_CFLAGS = -DTARGET_X11
SYS_LDFLAGS = -s -lalleg
@@
-30,7
+39,9
@@
SYS_LDFLAGS = -s -lalleg
else # Unix or cross-compiling for MS-DOS and Win32
RM = rm -f
else # Unix or cross-compiling for MS-DOS and Win32
RM = rm -f
-PROGNAME = ../rocksndiamonds
+
+PROGBASE = rocksndiamonds
+PROGNAME = ../$(PROGBASE)
ifeq ($(PLATFORM),solaris)
EXTRA_LDFLAGS = -lnsl -lsocket -R$(XLIB_PATH)
ifeq ($(PLATFORM),solaris)
EXTRA_LDFLAGS = -lnsl -lsocket -R$(XLIB_PATH)
@@
-38,16
+49,17
@@
PLATFORM = unix
endif
ifeq ($(PLATFORM),unix)
endif
ifeq ($(PLATFORM),unix)
-PROFILING = -pg
+PROFILING
_FLAGS
= -pg
endif
ifeq ($(PLATFORM),cross-msdos)
endif
ifeq ($(PLATFORM),cross-msdos)
-PROGNAME = ../rocks.exe
+PROGBASE = rocks
+PROGNAME = ../$(PROGBASE).exe
TARGET = allegro
endif
ifeq ($(PLATFORM),cross-win32)
TARGET = allegro
endif
ifeq ($(PLATFORM),cross-win32)
-PROGNAME = ../
rocksndiamonds
.exe
+PROGNAME = ../
$(PROGBASE)
.exe
TARGET = sdl
endif
TARGET = sdl
endif
@@
-62,7
+74,7
@@
SYS_LDFLAGS = -lSDL_image -lSDL_mixer $(shell sdl-config --libs)
endif
ifeq ($(TARGET),allegro)
endif
ifeq ($(TARGET),allegro)
-SYS_CFLAGS = -DTARGET_
X11
-I$(CROSS_PATH_MSDOS)/include
+SYS_CFLAGS = -DTARGET_
ALLEGRO
-I$(CROSS_PATH_MSDOS)/include
SYS_LDFLAGS = -lalleg
endif
SYS_LDFLAGS = -lalleg
endif
@@
-86,85
+98,103
@@
CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(JOYSTICK)
DEBUG = -DDEBUG -g
CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(JOYSTICK)
DEBUG = -DDEBUG -g
+# PROFILING = $(PROFILING_FLAGS)
-
OPTIONS = $(DEBUG) -Wall
# only for debugging purposes
-
# OPTIONS = $(DEBUG) -O3 -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
# OPTIONS = -DSYSV -Ae # may be needed for HP-UX
# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes
# OPTIONS = -O3 -Wall -ansi -pedantic
# OPTIONS = -O3 -Wall
# OPTIONS = -O3
# OPTIONS = -DSYSV -Ae # may be needed for HP-UX
+ifdef BUILD_DIST # distribution build
+OPTIONS = -O3 -Wall
+endif
+
CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(CONFIG)
LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm
CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(CONFIG)
LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm
+
SRCS = main.c \
init.c \
events.c \
tools.c \
screens.c \
SRCS = main.c \
init.c \
events.c \
tools.c \
screens.c \
- misc.c \
game.c \
editor.c \
game.c \
editor.c \
- buttons.c \
files.c \
tape.c \
files.c \
tape.c \
- sound.c \
joystick.c \
cartoons.c \
joystick.c \
cartoons.c \
- random.c \
- pcx.c \
- image.c \
network.c \
network.c \
- netserv.c \
- msdos.c \
- system.c \
- x11.c \
- sdl.c
+ netserv.c
OBJS = main.o \
init.o \
events.o \
tools.o \
screens.o \
OBJS = main.o \
init.o \
events.o \
tools.o \
screens.o \
- misc.o \
game.o \
editor.o \
game.o \
editor.o \
- buttons.o \
files.o \
tape.o \
files.o \
tape.o \
- sound.o \
joystick.o \
cartoons.o \
joystick.o \
cartoons.o \
- random.o \
- pcx.o \
- image.o \
network.o \
network.o \
- netserv.o \
- msdos.o \
- system.o \
- x11.o \
- sdl.o
+ netserv.o
+
+LIBDIR = libgame
+LIBGAME = $(LIBDIR)/libgame.a
+
+ICONBASE = windows_icon
+ifeq ($(PLATFORM),cross-win32)
+ICON32X32 = ../graphics/$(ICONBASE)_32x32.bmp
+ICON = $(ICONBASE).o
+endif
+
+
+all: libgame_dir $(PROGNAME)
-all: $(PROGNAME)
+$(PROGNAME): $(LIBGAME) $(OBJS) $(ICON)
+ $(CC) $(PROFILING) $(OBJS) $(ICON) $(LIBGAME) $(LDFLAGS) -o $(PROGNAME)
-$(PROGNAME): $(OBJS)
- $(CC) $(PROFILING) $(OBJS) $(LDFLAGS) -o $(PROGNAME)
+libgame_dir:
+ @$(MAKE) -C $(LIBDIR)
+$(LIBGAME):
+ @$(MAKE) -C $(LIBDIR)
+
+$(ICON):
+ $(BMP2ICO) -transparent $(ICONBASE).ico $(ICON32X32)
+ echo "$(ICONBASE) ICON $(ICONBASE).ico" | $(WINDRES) -o $(ICON)
.c.o:
$(CC) $(PROFILING) $(CFLAGS) -c $*.c
.c.o:
$(CC) $(PROFILING) $(CFLAGS) -c $*.c
-clean:
- $(RM) *.o
- $(RM) ../*.exe
+clean-obj:
+ $(MAKE) -C $(LIBDIR) clean
+ $(RM) $(OBJS)
+ $(RM) $(LIBGAME)
+
+clean-ico:
+ $(RM) $(ICONBASE).ico
+ $(RM) $(ICONBASE).o
+
+clean-bin:
$(RM) $(PROGNAME)
$(RM) $(PROGNAME)
+ $(RM) ../*.exe
+
+clean: clean-obj clean-ico clean-bin
#-----------------------------------------------------------------------------#
# development only stuff #
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# development only stuff #
#-----------------------------------------------------------------------------#
+dist-clean: clean-obj
+
depend:
depend:
+ $(MAKE) -C $(LIBDIR) depend
for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
ifeq (.depend,$(wildcard .depend))
for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
ifeq (.depend,$(wildcard .depend))