X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2FMakefile;h=c27e4c54f5fc2e7dc256b17af1a04c1d34f94566;hb=eae2f3467caaaf64a9370c1acd8cecf11fd58328;hp=a6ab699696ebb7356b22370b2e205af465a34d1a;hpb=833cc59e0cc1802432f21ddbaa763c99e541fafe;p=rocksndiamonds.git diff --git a/src/Makefile b/src/Makefile index a6ab6996..c27e4c54 100644 --- a/src/Makefile +++ b/src/Makefile @@ -11,14 +11,16 @@ CC = gcc # on Solaris and similar systems, you'll need to uncomment this -EXTRA_LIBS = -lnsl -lsocket +# EXTRA_LIBS = -lnsl -lsocket -# specify path to X11 on your system -# X11_PATH = /usr/X11 -X11_PATH = /local/X11 +# 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 @@ -29,8 +31,8 @@ GAME_DIR = . # 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, @@ -45,20 +47,46 @@ SCORE_ENTRIES = MANY_PER_NAME # 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 = -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 @@ -74,11 +102,7 @@ DEBUG = -DDEBUG -g -Wall # LIBS = -L/usr/X11R6/lib $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS) -XINC_PATH = $(X11_PATH)/include -XLIB_PATH = $(X11_PATH)/lib - -INCL = -I$(XINC_PATH) -LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS) -R$(XLIB_PATH) +# LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS) # CFLAGS = -O2 $(CONFIG) $(SYSTEM) CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL) @@ -101,7 +125,8 @@ SRCS = main.c \ pcx.c \ image.c \ network.c \ - netserv.c + netserv.c \ + msdos.c OBJS = main.o \ init.o \ @@ -121,7 +146,8 @@ OBJS = main.o \ pcx.o \ image.o \ network.o \ - netserv.o + netserv.o \ + msdos.o all: $(PROGNAME) @@ -132,7 +158,12 @@ $(PROGNAME): $(OBJS) $(CC) $(CFLAGS) -c $*.c clean: - $(RM) $(PROGNAME) $(SERVNAME) $(OBJS) + $(RM) *.o + $(RM) $(PROGNAME) + +depend: + for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend -backup: - ./make_backup.sh +ifeq (.depend,$(wildcard .depend)) +include .depend +endif