rnd-20070926-1-src
[rocksndiamonds.git] / Makefile
1 # =============================================================================
2 # Rocks'n'Diamonds Makefile
3 # -----------------------------------------------------------------------------
4 # (c) 1995-2006 Holger Schemel <info@artsoft.org>
5 # =============================================================================
6
7 # -----------------------------------------------------------------------------
8 # configuration
9 # -----------------------------------------------------------------------------
10
11 # command name of your favorite ANSI C compiler
12 # (this must be set to "cc" for some systems)
13 CC = gcc
14
15 # command name of GNU make on your system
16 # (this must be set to "gmake" for some systems)
17 MAKE = make
18
19 # path to X11 on your system
20 X11_PATH = /usr/X11R6
21
22 # directory for read-only game data (like graphics, sounds, levels)
23 # default is '.' to be able to run program without installation
24 # RO_GAME_DIR = /usr/games
25
26 # directory for writable game data (like highscore files)
27 # default is '.' to be able to run program without installation
28 # RW_GAME_DIR = /var/games
29
30 # uncomment if system has no joystick include file
31 # JOYSTICK = -DNO_JOYSTICK
32
33 # choose if more than one global score file entry for one player is allowed
34 # (default: MANY_PER_NAME)
35 # uncomment to install game in multi-user environment
36 # SCORE_ENTRIES = ONE_PER_NAME
37 # uncomment to install game in single-user environment (default)
38 # SCORE_ENTRIES = MANY_PER_NAME
39
40 # paths for cross-compiling (only needed for non-native MS-DOS and Win32 build)
41 CROSS_PATH_MSDOS=/usr/local/cross-msdos/i386-msdosdjgpp
42 CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc
43
44 # -----------------------------------------------------------------------------
45 # there should be no need to change anything below
46 # -----------------------------------------------------------------------------
47
48 .EXPORT_ALL_VARIABLES:
49
50 SRC_DIR = src
51 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
52
53 # DEFAULT_TARGET = x11
54 DEFAULT_TARGET = sdl
55
56
57 # -----------------------------------------------------------------------------
58 # build targets
59 # -----------------------------------------------------------------------------
60
61 all:
62         @$(MAKE_CMD) TARGET=$(DEFAULT_TARGET)
63
64 x11:
65         @$(MAKE_CMD) TARGET=x11
66
67 sdl:
68         @$(MAKE_CMD) TARGET=sdl
69
70 solaris:
71         @$(MAKE_CMD) PLATFORM=solaris TARGET=x11
72
73 solaris-sdl:
74         @$(MAKE_CMD) PLATFORM=solaris TARGET=sdl
75
76 mac:
77         @$(MAKE_CMD) PLATFORM=macosx
78
79 mac-static:
80         @$(MAKE_CMD) PLATFORM=macosx TARGET=sdl-static
81
82 msdos:
83         @$(MAKE_CMD) PLATFORM=msdos
84
85 os2:
86         @$(MAKE_CMD) PLATFORM=os2
87
88 cross-msdos:
89         @PATH=$(CROSS_PATH_MSDOS)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-msdos
90
91 cross-win32:
92         @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32
93
94 cross-win32-jue:
95         @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32 \
96                                                           SPECIAL_ICON=jue
97
98 clean:
99         @$(MAKE_CMD) clean
100
101
102 # -----------------------------------------------------------------------------
103 # development only
104 # -----------------------------------------------------------------------------
105
106 auto-conf:
107         @$(MAKE_CMD) auto-conf
108
109 run: all
110         @./rocksndiamonds --verbose
111
112 gdb: all
113         @gdb -batch -x GDB_COMMANDS ./rocksndiamonds
114
115 valgrind: all
116         @valgrind -v --leak-check=yes ./rocksndiamonds 2> valgrind.out
117
118 enginetest: all
119         ./Scripts/make_enginetest.sh
120
121 enginetestcustom: all
122         ./Scripts/make_enginetest.sh custom
123
124 enginetestfast: all
125         ./Scripts/make_enginetest.sh fast
126
127 enginetestnew: all
128         ./Scripts/make_enginetest.sh new
129
130 leveltest: all
131         ./Scripts/make_enginetest.sh leveltest
132
133 backup:
134         ./Scripts/make_backup.sh src 1
135
136 backup2:
137         ./Scripts/make_backup.sh src 2
138
139 backup3:
140         ./Scripts/make_backup.sh src 3
141
142 backup_lev:
143         ./Scripts/make_backup.sh lev
144
145 backup_gfx:
146         ./Scripts/make_backup.sh gfx
147
148 # prerelease:
149 #       ./Scripts/make_prerelease.sh
150
151 dist-unix:
152         ./Scripts/make_dist.sh unix .
153
154 dist-msdos:
155         ./Scripts/make_dist.sh dos .
156
157 dist-win32:
158         ./Scripts/make_dist.sh win .
159
160 dist-macosx:
161         ./Scripts/make_dist.sh mac . $(MAKE)
162
163 upload-unix:
164         ./Scripts/make_dist.sh unix . upload
165
166 upload-msdos:
167         ./Scripts/make_dist.sh dos . upload
168
169 upload-win32:
170         ./Scripts/make_dist.sh win . upload
171
172 upload-macosx:
173         ./Scripts/make_dist.sh mac . upload
174
175 dist-clean:
176         @$(MAKE_CMD) dist-clean
177
178 dist-build-unix:
179         @BUILD_DIST=TRUE $(MAKE) x11
180
181 dist-build-win32:
182         @BUILD_DIST=TRUE $(MAKE) cross-win32
183
184 dist-build-msdos:
185         @BUILD_DIST=TRUE $(MAKE) cross-msdos
186
187 dist-build-all:
188         $(MAKE) clean
189         $(MAKE) dist-build-unix         ; $(MAKE) dist-clean
190         $(MAKE) dist-build-win32        ; $(MAKE) dist-clean
191 #       $(MAKE) dist-build-msdos        ; $(MAKE) dist-clean
192
193 # dist-all: dist-build-all dist-unix dist-msdos dist-win32 dist-macosx
194 dist-all: dist-build-all dist-unix dist-win32 dist-macosx
195
196 # upload-all: upload-unix upload-msdos upload-win32 upload-macosx
197 upload-all: upload-unix upload-win32 upload-macosx
198
199 tags:
200         $(MAKE_CMD) tags
201
202 depend dep:
203         $(MAKE_CMD) depend