# specify X11 library path on your system
XLIB_PATH = /usr/X11/lib
-# change this to the directory where you want to install game data like levels
-GAME_DIR = .
+# choose directory for read-only game data (like graphics, sounds, levels)
+# RO_GAME_DIR = /usr/games
+
+# choose directory for writable game data (like highscore files)
+# RW_GAME_DIR = /var/games
# uncomment this if your system has no joystick include file
# JOYSTICK = -DNO_JOYSTICK
# choose if you want to allow many global score file entries for one player
# when installing the game in a multi user environment, choose this
# SCORE_ENTRIES = ONE_PER_NAME
-# when installing the game in a single user environment, choose this
-SCORE_ENTRIES = MANY_PER_NAME
+# when installing the game in a single user environment, choose this (default)
+# SCORE_ENTRIES = MANY_PER_NAME
# The XPM-Library is no longer needed to build this program,
# but is used to load graphics if XPM_INCLUDE_FILE is defined,
# you shouldn't need to change anything below #
#-----------------------------------------------------------------------------#
-PROGNAME = ../rocksndiamonds
+ifdef COMSPEC
+PLATFORM = dos
+else
+PLATFORM = unix
+endif
+ifeq ($(PLATFORM),unix)
RM = rm -f
+PROGNAME = ../rocksndiamonds
+LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
+else
+RM = del
+PROGNAME = ../rocks.exe
+LIBS = -s -lm -lalleg
+endif
+
CPP = $(CC) -E
-CONFIG_GAME_DIR = -DGAME_DIR="\"$(GAME_DIR)\""
+ifdef RO_GAME_DIR
+CONFIG_RO_GAME_DIR = -DRO_GAME_DIR="\"$(RO_GAME_DIR)\""
+endif
+
+ifdef RW_GAME_DIR
+CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\""
+endif
+
+ifdef SCORE_ENTRIES
CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
+endif
+
+CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
CONFIG = $(CONFIG_GAME_DIR) $(SOUNDS) $(JOYSTICK) \
$(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
-# DEBUG = -DDEBUG -g -ansi -pedantic -Wall
+# DEBUG = -DDEBUG -g -Wall -ansi -pedantic
DEBUG = -DDEBUG -g -Wall
-# DEBUG = -O6
+# DEBUG = -O3 -Wall -ansi -pedantic
+# DEBUG = -O3 -Wall
+# DEBUG = -O3
# SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux # for HP-UX (obsolete)
# SYSTEM = -DSYSV -Ae # for HP-UX
# LIBS = -L/usr/X11R6/lib -lX11 -lm
# LIBS = -L/usr/X11R6/lib $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
-LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
+
+# LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
# CFLAGS = -O2 $(CONFIG) $(SYSTEM)
CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
pcx.c \
image.c \
network.c \
- netserv.c
+ netserv.c \
+ msdos.c
OBJS = main.o \
init.o \
pcx.o \
image.o \
network.o \
- netserv.o
+ netserv.o \
+ msdos.o
all: $(PROGNAME)
$(CC) $(CFLAGS) -c $*.c
clean:
- $(RM) $(OBJS)
+ $(RM) *.o
$(RM) $(PROGNAME)
depend: