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