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