rnd-20140515-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 # path for cross-compiling (only needed for non-native Windows build)
45 CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc
46
47 # compile special edition of R'n'D instead of the normal (classic) version
48 # SPECIAL_EDITION = rnd_jue
49
50
51 # -----------------------------------------------------------------------------
52 # there should be no need to change anything below
53 # -----------------------------------------------------------------------------
54
55 .EXPORT_ALL_VARIABLES:
56
57 SRC_DIR = src
58 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
59
60 # DEFAULT_TARGET = x11
61 DEFAULT_TARGET = sdl2
62
63
64 # -----------------------------------------------------------------------------
65 # build targets
66 # -----------------------------------------------------------------------------
67
68 all:
69         @$(MAKE_CMD) TARGET=$(DEFAULT_TARGET)
70
71 x11:
72         @$(MAKE_CMD) TARGET=x11
73
74 sdl:
75         @$(MAKE_CMD) TARGET=sdl
76
77 sdl2:
78         @$(MAKE_CMD) TARGET=sdl2
79
80 solaris:
81         @$(MAKE_CMD) PLATFORM=solaris TARGET=x11
82
83 solaris-sdl:
84         @$(MAKE_CMD) PLATFORM=solaris TARGET=sdl
85
86 mac:
87         @$(MAKE_CMD) PLATFORM=macosx
88
89 mac-static:
90         @$(MAKE_CMD) PLATFORM=macosx TARGET=sdl-static
91
92 mac2-static:
93         @$(MAKE_CMD) PLATFORM=macosx TARGET=sdl2-static
94
95 os2:
96         @$(MAKE_CMD) PLATFORM=os2
97
98 cross-win32:
99         @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32
100
101 clean:
102         @$(MAKE_CMD) clean
103
104
105 # -----------------------------------------------------------------------------
106 # development, test, distribution build and packaging targets
107 # -----------------------------------------------------------------------------
108
109 auto-conf:
110         @$(MAKE_CMD) auto-conf
111
112 run: all
113         @$(MAKE_CMD) run
114
115 gdb: all
116         @$(MAKE_CMD) gdb
117
118 valgrind: all
119         @$(MAKE_CMD) valgrind
120
121 enginetest: all
122         ./Scripts/make_enginetest.sh
123
124 enginetestcustom: all
125         ./Scripts/make_enginetest.sh custom
126
127 enginetestfast: all
128         ./Scripts/make_enginetest.sh fast
129
130 enginetestnew: all
131         ./Scripts/make_enginetest.sh new
132
133 leveltest: all
134         ./Scripts/make_enginetest.sh leveltest
135
136 levelsketch_images: all
137         ./Scripts/make_levelsketch_images.sh
138
139 backup:
140         ./Scripts/make_backup.sh src tar
141
142 backup-net-copy:
143         ./Scripts/make_backup.sh src scp
144
145 backup-all: backup backup-net-copy
146
147 backup_lev:
148         ./Scripts/make_backup.sh lev
149
150 backup_gfx:
151         ./Scripts/make_backup.sh gfx
152
153 # prerelease:
154 #       ./Scripts/make_prerelease.sh
155
156 jue:
157         @$(MAKE) SPECIAL_EDITION=rnd_jue all
158
159 jue-win:
160         @$(MAKE) SPECIAL_EDITION=rnd_jue cross-win32
161
162 dist-clean:
163         @$(MAKE_CMD) dist-clean
164
165 dist-build-unix:
166         @BUILD_DIST=TRUE $(MAKE)
167
168 dist-build-win32:
169         @BUILD_DIST=TRUE $(MAKE) cross-win32
170
171 dist-build-macosx:
172 #       (this is done by "dist-package-macosx" target)
173
174 dist-build-macosx-ppc:
175 #       (this is done by "dist-package-macosx-ppc" target)
176
177 dist-package-unix:
178         ./Scripts/make_dist.sh unix .
179
180 dist-package-win32:
181         ./Scripts/make_dist.sh win .
182
183 dist-package-macosx:
184         ./Scripts/make_dist.sh mac . $(MAKE)
185
186 dist-package-macosx-ppc:
187         ./Scripts/make_dist.sh mac-ppc . $(MAKE)
188
189 dist-upload-unix:
190         ./Scripts/make_dist.sh unix . upload
191
192 dist-upload-win32:
193         ./Scripts/make_dist.sh win . upload
194
195 dist-upload-macosx:
196         ./Scripts/make_dist.sh mac . upload
197
198 dist-upload-macosx-ppc:
199         ./Scripts/make_dist.sh mac-ppc . upload
200
201 dist-build-all:
202         $(MAKE) clean
203         $(MAKE) dist-build-unix         ; $(MAKE) dist-clean
204         $(MAKE) dist-build-win32        ; $(MAKE) dist-clean
205
206 dist-package-all:
207         $(MAKE) dist-package-unix
208         $(MAKE) dist-package-win32
209         $(MAKE) dist-package-macosx
210         $(MAKE) dist-package-macosx-ppc
211
212 dist-upload-all:
213         $(MAKE) dist-upload-unix
214         $(MAKE) dist-upload-win32
215         $(MAKE) dist-upload-macosx
216         $(MAKE) dist-upload-macosx-ppc
217
218 dist-all: dist-build-all dist-package-all
219
220 upload-all: dist-upload-all
221
222 tags:
223         $(MAKE_CMD) tags
224
225 depend dep:
226         $(MAKE_CMD) TARGET=$(DEFAULT_TARGET) depend