4a065da30c83d35377a455aace7d9b5ee13a0373
[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 (default)
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 = -s -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 ifdef SCORE_ENTRIES
77 CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
78 endif
79
80 CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
81
82 CONFIG = $(CONFIG_GAME_DIR) $(SOUNDS) $(JOYSTICK)       \
83          $(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
84
85 # DEBUG = -DDEBUG -g -Wall -ansi -pedantic
86 DEBUG = -DDEBUG -g -Wall
87 # DEBUG = -O3 -Wall -ansi -pedantic
88 # DEBUG = -O3 -Wall
89 # DEBUG = -O3
90
91 # SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux    # for HP-UX (obsolete)
92 # SYSTEM = -DSYSV -Ae                   # for HP-UX
93 # INCL = -I/usr/include/X11R5           # for HP-UX and others
94 # INCL = -I/usr/local/X11/include       # for SunOS and others
95 # LIBS = -L/usr/lib/X11R5 -lXpm -lX11 -lm
96 #                                       # for HP-UX and others
97 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
98 #                                       # for SunOS and others
99
100 # LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
101 # LIBS = -L/usr/X11R6/lib -lX11 -lm
102
103 # LIBS = -L/usr/X11R6/lib $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
104
105 # LIBS = -L$(XLIB_PATH) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
106
107 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
108 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
109
110 SRCS =  main.c          \
111         init.c          \
112         events.c        \
113         tools.c         \
114         screens.c       \
115         misc.c          \
116         game.c          \
117         editor.c        \
118         buttons.c       \
119         files.c         \
120         tape.c          \
121         sound.c         \
122         joystick.c      \
123         cartoons.c      \
124         random.c        \
125         pcx.c           \
126         image.c         \
127         network.c       \
128         netserv.c       \
129         msdos.c
130
131 OBJS =  main.o          \
132         init.o          \
133         events.o        \
134         tools.o         \
135         screens.o       \
136         misc.o          \
137         game.o          \
138         editor.o        \
139         buttons.o       \
140         files.o         \
141         tape.o          \
142         sound.o         \
143         joystick.o      \
144         cartoons.o      \
145         random.o        \
146         pcx.o           \
147         image.o         \
148         network.o       \
149         netserv.o       \
150         msdos.o
151
152 all:    $(PROGNAME)
153
154 $(PROGNAME):    $(OBJS)
155         $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(PROGNAME)
156
157 .c.o:
158         $(CC) $(CFLAGS) -c $*.c
159
160 clean:
161         $(RM) *.o
162         $(RM) $(PROGNAME)
163
164 depend:
165         for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
166
167 ifeq (.depend,$(wildcard .depend))
168 include .depend
169 endif