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