rnd-19990822-1-src
[rocksndiamonds.git] / src / Makefile
1 #=============================================================================#
2 # Makefile for Rocks'n'Diamonds 1.2                                           #
3 # (c) 1995-98 Holger Schemel, aeglos@valinor.owl.de                           #
4 #=============================================================================#
5
6 #-----------------------------------------------------------------------------#
7 # configuration section                                                       #
8 #-----------------------------------------------------------------------------#
9
10 # change this to your favorite ANSI C compiler
11 CC = gcc
12
13 # on Solaris and similar systems, you'll need to uncomment this
14 # EXTRA_LIBS = -lnsl -lsocket 
15
16 # specify X11 library path on your system
17 XLIB_PATH = /usr/X11/lib
18
19 # choose directory for read-only game data (like graphics, sounds, levels)
20 # RO_GAME_DIR = /usr/games
21
22 # choose directory for writable game data (like highscore files)
23 # RW_GAME_DIR = /var/games
24
25 # uncomment this if your system has no joystick include file
26 # JOYSTICK = -DNO_JOYSTICK
27
28 # uncomment this if your system has no sound
29 # SOUNDS = -DNO_SOUNDS
30
31 # choose if you want to allow many global score file entries for one player
32 # when installing the game in a multi user environment, choose this
33 # SCORE_ENTRIES = ONE_PER_NAME
34 # when installing the game in a single user environment, choose this
35 SCORE_ENTRIES = MANY_PER_NAME
36
37 # The XPM-Library is no longer needed to build this program,
38 # but is used to load graphics if XPM_INCLUDE_FILE is defined,
39 # because the GIF loading routines are still a bit beta.
40 # If you want to use the Xpm library, convert the GIF files to Xpm
41 # files (and you need corresponding mask files in xbm format).
42
43 # XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
44 # EXTRA_X11_LIBS = -lXpm
45
46 #-----------------------------------------------------------------------------#
47 # you shouldn't need to change anything below                                 #
48 #-----------------------------------------------------------------------------#
49
50 ifdef COMSPEC
51 PLATFORM = dos
52 else
53 PLATFORM = unix
54 endif
55
56 ifeq ($(PLATFORM),unix)
57 RM = rm -f
58 PROGNAME = ../rocksndiamonds
59 LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
60 else
61 RM = del
62 PROGNAME = ../rocks.exe
63 LIBS = -lm -lalleg
64 endif
65
66 CPP = $(CC) -E
67
68 ifdef RO_GAME_DIR
69 CONFIG_RO_GAME_DIR = -DRO_GAME_DIR="\"$(RO_GAME_DIR)\""
70 endif
71
72 ifdef RW_GAME_DIR
73 CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\""
74 endif
75
76 CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
77
78 CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
79
80 CONFIG = $(CONFIG_GAME_DIR) $(SOUNDS) $(JOYSTICK)       \
81          $(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
82
83 # DEBUG = -DDEBUG -g -Wall -ansi -pedantic
84 DEBUG = -DDEBUG -g -Wall
85 # DEBUG = -O3 -Wall -ansi -pedantic
86 # DEBUG = -O3 -Wall
87 # DEBUG = -O3
88
89 # SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux    # for HP-UX (obsolete)
90 # SYSTEM = -DSYSV -Ae                   # for HP-UX
91 # INCL = -I/usr/include/X11R5           # for HP-UX and others
92 # INCL = -I/usr/local/X11/include       # for SunOS and others
93 # LIBS = -L/usr/lib/X11R5 -lXpm -lX11 -lm
94 #                                       # for HP-UX and others
95 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
96 #                                       # for SunOS and others
97
98 # LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
99 # LIBS = -L/usr/X11R6/lib -lX11 -lm
100
101 # LIBS = -L/usr/X11R6/lib $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
102
103 # LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
104
105 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
106 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
107
108 SRCS =  main.c          \
109         init.c          \
110         events.c        \
111         tools.c         \
112         screens.c       \
113         misc.c          \
114         game.c          \
115         editor.c        \
116         buttons.c       \
117         files.c         \
118         tape.c          \
119         sound.c         \
120         joystick.c      \
121         cartoons.c      \
122         random.c        \
123         pcx.c           \
124         image.c         \
125         network.c       \
126         netserv.c       \
127         msdos.c
128
129 OBJS =  main.o          \
130         init.o          \
131         events.o        \
132         tools.o         \
133         screens.o       \
134         misc.o          \
135         game.o          \
136         editor.o        \
137         buttons.o       \
138         files.o         \
139         tape.o          \
140         sound.o         \
141         joystick.o      \
142         cartoons.o      \
143         random.o        \
144         pcx.o           \
145         image.o         \
146         network.o       \
147         netserv.o       \
148         msdos.o
149
150 all:    $(PROGNAME)
151
152 $(PROGNAME):    $(OBJS)
153         $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(PROGNAME)
154
155 .c.o:
156         $(CC) $(CFLAGS) -c $*.c
157
158 clean:
159         $(RM) *.o
160         $(RM) $(PROGNAME)
161
162 depend:
163         for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
164
165 ifeq (.depend,$(wildcard .depend))
166 include .depend
167 endif