fixed compiler warnings with GCC 11
[rocksndiamonds.git] / Makefile
1 # =============================================================================
2 # Rocks'n'Diamonds - McDuffin Strikes Back!
3 # -----------------------------------------------------------------------------
4 # (c) 1995-2015 by Artsoft Entertainment
5 #                  Holger Schemel
6 #                  info@artsoft.org
7 #                  https://www.artsoft.org/
8 # -----------------------------------------------------------------------------
9 # Makefile
10 # =============================================================================
11
12 # -----------------------------------------------------------------------------
13 # configuration
14 # -----------------------------------------------------------------------------
15
16 # command name of your favorite ANSI C compiler
17 # (this must be set to "cc" for some systems)
18 CC = gcc
19
20 # command name of GNU make on your system
21 # (this must be set to "gmake" for some systems)
22 MAKE = make
23
24 # directory for (read-only) game data (like graphics, sounds, levels)
25 # (this directory is usually the game's installation directory)
26 # default is '.' to be able to run program without installation
27 # BASE_PATH = .
28 # use the following setting for Debian / Ubuntu installations:
29 # BASE_PATH = /usr/share/games/rocksndiamonds
30
31 # uncomment if system has no joystick include file
32 # JOYSTICK = -DNO_JOYSTICK
33
34 # path for cross-compiling (only needed for non-native Windows build)
35 CROSS_PATH_WIN32 = /usr/local/cross-tools/i686-w64-mingw32
36 CROSS_PATH_WIN64 = /usr/local/cross-tools/x86_64-w64-mingw32
37
38
39 # -----------------------------------------------------------------------------
40 # there should be no need to change anything below
41 # -----------------------------------------------------------------------------
42
43 .EXPORT_ALL_VARIABLES:
44
45 SRC_DIR = src
46 ANDROID_DIR ?= build-projects/android
47
48 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
49 MAKE_CMD_ANDROID = $(MAKE) -C $(ANDROID_DIR)
50
51
52 # -----------------------------------------------------------------------------
53 # build targets
54 # -----------------------------------------------------------------------------
55
56 all:
57         @$(MAKE_CMD)
58
59 cross-win32:
60         @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32
61
62 cross-win64:
63         @PATH=$(CROSS_PATH_WIN64)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win64
64
65 android-prepare:
66         @$(MAKE_CMD_ANDROID) prepare
67
68 android-package:
69         @$(MAKE_CMD_ANDROID) package
70
71 android-clean:
72         @$(MAKE_CMD_ANDROID) clean
73
74 android: android-package
75
76 emscripten:
77         @emmake $(MAKE_CMD) PLATFORM=emscripten
78
79 clean:
80         @$(MAKE_CMD) clean
81
82 clean-git:
83         @$(MAKE_CMD) clean-git
84
85 clean-android: android-clean
86
87
88 # -----------------------------------------------------------------------------
89 # development targets
90 # -----------------------------------------------------------------------------
91
92 MAKE_ENGINETEST = ./tests/enginetest/enginetest.sh
93 MAKE_LEVELSKETCH = ./Scripts/make_levelsketch_images.sh
94
95 auto-conf:
96         @$(MAKE_CMD) auto-conf
97
98 conf-time:
99         @$(MAKE_CMD) conf-time
100
101 conf-hash:
102         @$(MAKE_CMD) conf-hash
103
104 run: all
105         @$(MAKE_CMD) run
106
107 gdb: all
108         @$(MAKE_CMD) gdb
109
110 valgrind: all
111         @$(MAKE_CMD) valgrind
112
113 tags:
114         $(MAKE_CMD) tags
115
116 depend dep:
117         $(MAKE_CMD) depend
118
119 enginetest: all
120         $(MAKE_ENGINETEST)
121
122 levelsketch_images: all
123         $(MAKE_LEVELSKETCH)
124
125
126 # -----------------------------------------------------------------------------
127 # distribution targets
128 # -----------------------------------------------------------------------------
129
130 MAKE_DIST = ./Scripts/make_dist.sh
131
132 dist-clean:
133         @$(MAKE_CMD) dist-clean
134
135 dist-clean-android:
136         @$(MAKE_CMD_ANDROID) dist-clean
137
138 dist-build-linux:
139         @BUILD_DIST=TRUE $(MAKE)
140
141 dist-build-win32:
142         @BUILD_DIST=TRUE $(MAKE) cross-win32
143
144 dist-build-win64:
145         @BUILD_DIST=TRUE $(MAKE) cross-win64
146
147 dist-build-mac:
148         @BUILD_DIST=TRUE $(MAKE)
149
150 dist-build-android:
151         @BUILD_DIST=TRUE $(MAKE) android
152
153 dist-build-emscripten:
154         @BUILD_DIST=TRUE $(MAKE) emscripten
155
156 dist-package-linux:
157         $(MAKE_DIST) package linux
158
159 dist-package-win32:
160         $(MAKE_DIST) package win32
161
162 dist-package-win64:
163         $(MAKE_DIST) package win64
164
165 dist-package-mac:
166         $(MAKE_DIST) package mac
167
168 dist-package-android:
169         $(MAKE_DIST) package android
170
171 dist-package-emscripten:
172         $(MAKE_DIST) package emscripten
173
174 dist-copy-package-linux:
175         $(MAKE_DIST) copy-package linux
176
177 dist-copy-package-win32:
178         $(MAKE_DIST) copy-package win32
179
180 dist-copy-package-win64:
181         $(MAKE_DIST) copy-package win64
182
183 dist-copy-package-mac:
184         $(MAKE_DIST) copy-package mac
185
186 dist-copy-package-android:
187         $(MAKE_DIST) copy-package android
188
189 dist-copy-package-emscripten:
190         $(MAKE_DIST) copy-package emscripten
191
192 dist-upload-linux:
193         $(MAKE_DIST) upload linux
194
195 dist-upload-win32:
196         $(MAKE_DIST) upload win32
197
198 dist-upload-win64:
199         $(MAKE_DIST) upload win64
200
201 dist-upload-mac:
202         $(MAKE_DIST) upload mac
203
204 dist-upload-android:
205         $(MAKE_DIST) upload android
206
207 dist-upload-emscripten:
208         $(MAKE_DIST) upload emscripten
209
210 dist-deploy-emscripten:
211         $(MAKE_DIST) deploy emscripten
212
213 dist-package-all:
214         $(MAKE) dist-package-linux
215         $(MAKE) dist-package-win32
216         $(MAKE) dist-package-win64
217         $(MAKE) dist-package-mac
218         $(MAKE) dist-package-android
219         $(MAKE) dist-package-emscripten
220
221 dist-copy-package-all:
222         $(MAKE) dist-copy-package-linux
223         $(MAKE) dist-copy-package-win32
224         $(MAKE) dist-copy-package-win64
225         $(MAKE) dist-copy-package-mac
226         $(MAKE) dist-copy-package-android
227         $(MAKE) dist-copy-package-emscripten
228
229 dist-upload-all:
230         $(MAKE) dist-upload-linux
231         $(MAKE) dist-upload-win32
232         $(MAKE) dist-upload-win64
233         $(MAKE) dist-upload-mac
234         $(MAKE) dist-upload-android
235         $(MAKE) dist-upload-emscripten
236
237 dist-deploy-all:
238         $(MAKE) dist-deploy-emscripten
239
240 dist-release-all: dist-package-all dist-copy-package-all dist-upload-all
241
242 package-all: dist-package-all
243
244 copy-package-all: dist-copy-package-all
245
246 upload-all: dist-upload-all
247
248 deploy-all: dist-deploy-all
249
250 release-all: dist-release-all