rnd-20131209-1-src
[rocksndiamonds.git] / Makefile
1 # =============================================================================
2 # Rocks'n'Diamonds Makefile
3 # -----------------------------------------------------------------------------
4 # (c) 1995-2013 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 # use the following setting for Debian / Ubuntu installations:
26 # RO_GAME_DIR = /usr/share/games/rocksndiamonds
27
28 # directory for writable game data (like highscore files)
29 # default is '.' to be able to run program without installation
30 # RW_GAME_DIR = /var/games
31 # use the following setting for Debian / Ubuntu installations:
32 # RW_GAME_DIR = /var/games/rocksndiamonds
33
34 # uncomment if system has no joystick include file
35 # JOYSTICK = -DNO_JOYSTICK
36
37 # choose if more than one global score file entry for one player is allowed
38 # (default: MANY_PER_NAME)
39 # uncomment to install game in multi-user environment
40 # SCORE_ENTRIES = ONE_PER_NAME
41 # uncomment to install game in single-user environment (default)
42 # SCORE_ENTRIES = MANY_PER_NAME
43
44 # paths for cross-compiling (only needed for non-native MS-DOS and Win32 build)
45 CROSS_PATH_MSDOS = /usr/local/cross-msdos/i386-msdosdjgpp
46 CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc
47
48 # compile special edition of R'n'D instead of the normal (classic) version
49 # SPECIAL_EDITION = rnd_jue
50
51
52 # -----------------------------------------------------------------------------
53 # there should be no need to change anything below
54 # -----------------------------------------------------------------------------
55
56 .EXPORT_ALL_VARIABLES:
57
58 SRC_DIR = src
59 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
60
61 # DEFAULT_TARGET = x11
62 DEFAULT_TARGET = sdl2
63
64
65 # -----------------------------------------------------------------------------
66 # build targets
67 # -----------------------------------------------------------------------------
68
69 all:
70         @$(MAKE_CMD) TARGET=$(DEFAULT_TARGET)
71
72 x11:
73         @$(MAKE_CMD) TARGET=x11
74
75 sdl:
76         @$(MAKE_CMD) TARGET=sdl
77
78 sdl2:
79         @$(MAKE_CMD) TARGET=sdl2
80
81 solaris:
82         @$(MAKE_CMD) PLATFORM=solaris TARGET=x11
83
84 solaris-sdl:
85         @$(MAKE_CMD) PLATFORM=solaris TARGET=sdl
86
87 mac:
88         @$(MAKE_CMD) PLATFORM=macosx
89
90 mac-static:
91         @$(MAKE_CMD) PLATFORM=macosx TARGET=sdl-static
92
93 msdos:
94         @$(MAKE_CMD) PLATFORM=msdos
95
96 os2:
97         @$(MAKE_CMD) PLATFORM=os2
98
99 cross-msdos:
100         @PATH=$(CROSS_PATH_MSDOS)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-msdos
101
102 cross-win32:
103         @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32
104
105 clean:
106         @$(MAKE_CMD) clean
107
108
109 # -----------------------------------------------------------------------------
110 # development, test, distribution build and packaging targets
111 # -----------------------------------------------------------------------------
112
113 auto-conf:
114         @$(MAKE_CMD) auto-conf
115
116 run: all
117         @$(MAKE_CMD) run
118
119 gdb: all
120         @$(MAKE_CMD) gdb
121
122 valgrind: all
123         @$(MAKE_CMD) valgrind
124
125 enginetest: all
126         ./Scripts/make_enginetest.sh
127
128 enginetestcustom: all
129         ./Scripts/make_enginetest.sh custom
130
131 enginetestfast: all
132         ./Scripts/make_enginetest.sh fast
133
134 enginetestnew: all
135         ./Scripts/make_enginetest.sh new
136
137 leveltest: all
138         ./Scripts/make_enginetest.sh leveltest
139
140 levelsketch_images: all
141         ./Scripts/make_levelsketch_images.sh
142
143 backup:
144         ./Scripts/make_backup.sh src tar
145
146 backup-net-copy:
147         ./Scripts/make_backup.sh src scp
148
149 backup-all: backup backup-net-copy
150
151 backup_lev:
152         ./Scripts/make_backup.sh lev
153
154 backup_gfx:
155         ./Scripts/make_backup.sh gfx
156
157 # prerelease:
158 #       ./Scripts/make_prerelease.sh
159
160 jue:
161         @$(MAKE) SPECIAL_EDITION=rnd_jue all
162
163 jue-win:
164         @$(MAKE) SPECIAL_EDITION=rnd_jue cross-win32
165
166 dist-clean:
167         @$(MAKE_CMD) dist-clean
168
169 dist-build-unix:
170         @BUILD_DIST=TRUE $(MAKE) x11
171
172 dist-build-msdos:
173         @BUILD_DIST=TRUE $(MAKE) cross-msdos
174
175 dist-build-win32:
176         @BUILD_DIST=TRUE $(MAKE) cross-win32
177
178 dist-build-macosx:
179 #       (this is done by "dist-package-macosx" target)
180
181 dist-build-macosx-ppc:
182 #       (this is done by "dist-package-macosx-ppc" target)
183
184 dist-package-unix:
185         ./Scripts/make_dist.sh unix .
186
187 dist-package-msdos:
188         ./Scripts/make_dist.sh dos .
189
190 dist-package-win32:
191         ./Scripts/make_dist.sh win .
192
193 dist-package-macosx:
194         ./Scripts/make_dist.sh mac . $(MAKE)
195
196 dist-package-macosx-ppc:
197         ./Scripts/make_dist.sh mac-ppc . $(MAKE)
198
199 dist-upload-unix:
200         ./Scripts/make_dist.sh unix . upload
201
202 dist-upload-msdos:
203         ./Scripts/make_dist.sh dos . upload
204
205 dist-upload-win32:
206         ./Scripts/make_dist.sh win . upload
207
208 dist-upload-macosx:
209         ./Scripts/make_dist.sh mac . upload
210
211 dist-upload-macosx-ppc:
212         ./Scripts/make_dist.sh mac-ppc . upload
213
214 dist-build-all:
215         $(MAKE) clean
216         $(MAKE) dist-build-unix         ; $(MAKE) dist-clean
217         $(MAKE) dist-build-win32        ; $(MAKE) dist-clean
218 #       $(MAKE) dist-build-msdos        ; $(MAKE) dist-clean
219
220 dist-package-all:
221         $(MAKE) dist-package-unix
222         $(MAKE) dist-package-win32
223         $(MAKE) dist-package-macosx
224         $(MAKE) dist-package-macosx-ppc
225 #       $(MAKE) dist-package-msdos
226
227 dist-upload-all:
228         $(MAKE) dist-upload-unix
229         $(MAKE) dist-upload-win32
230         $(MAKE) dist-upload-macosx
231         $(MAKE) dist-upload-macosx-ppc
232 #       $(MAKE) dist-upload-msdos
233
234 dist-all: dist-build-all dist-package-all
235
236 upload-all: dist-upload-all
237
238 tags:
239         $(MAKE_CMD) tags
240
241 depend dep:
242         $(MAKE_CMD) TARGET=$(DEFAULT_TARGET) depend