rnd-19981110-1
[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 PROGNAME = rocksndiamonds
48
49 RM = rm -f
50 CPP = $(CC) -E
51
52 CONFIG_GAME_DIR = -DGAME_DIR="\"$(GAME_DIR)\""
53 CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
54
55 CONFIG = $(CONFIG_GAME_DIR) $(SOUNDS) $(JOYSTICK)       \
56          $(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
57
58 # DEBUG = -DDEBUG -g -ansi -pedantic -Wall
59 DEBUG = -DDEBUG -g -Wall
60 # DEBUG = -O6
61
62 # SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux    # for HP-UX (obsolete)
63 # SYSTEM = -DSYSV -Ae                   # for HP-UX
64 # INCL = -I/usr/include/X11R5           # for HP-UX and others
65 # INCL = -I/usr/local/X11/include       # for SunOS and others
66 # LIBS = -L/usr/lib/X11R5 -lXpm -lX11 -lm
67 #                                       # for HP-UX and others
68 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
69 #                                       # for SunOS and others
70
71 # LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
72 # LIBS = -L/usr/X11R6/lib -lX11 -lm
73
74 # LIBS = -L/usr/X11R6/lib $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
75 LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
76
77 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
78 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
79
80 SRCS =  main.c          \
81         init.c          \
82         events.c        \
83         tools.c         \
84         screens.c       \
85         misc.c          \
86         game.c          \
87         editor.c        \
88         buttons.c       \
89         files.c         \
90         tape.c          \
91         sound.c         \
92         joystick.c      \
93         cartoons.c      \
94         random.c        \
95         gifload.c       \
96         gif.c           \
97         image.c         \
98         network.c       \
99         netserv.c
100
101 OBJS =  main.o          \
102         init.o          \
103         events.o        \
104         tools.o         \
105         screens.o       \
106         misc.o          \
107         game.o          \
108         editor.o        \
109         buttons.o       \
110         files.o         \
111         tape.o          \
112         sound.o         \
113         joystick.o      \
114         cartoons.o      \
115         random.o        \
116         gifload.o       \
117         gif.o           \
118         image.o         \
119         network.o       \
120         netserv.o
121
122 all:    $(PROGNAME)
123
124 $(PROGNAME):    $(OBJS)
125         $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(PROGNAME)
126
127 .c.o:
128         $(CC) $(CFLAGS) -c $*.c
129
130 clean:
131         $(RM) $(PROGNAME) $(SERVNAME) $(OBJS)
132
133 backup:
134         ./make_backup.sh
135
136 depend:
137         for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
138
139 ifeq (.depend,$(wildcard .depend))
140 include .depend
141 endif