Mercurial > SDL_sound_CoreAudio
annotate Makefile @ 77:c714c9cd10f6
Doh...that shouldn't be there.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 25 Sep 2001 18:51:52 +0000 |
parents | c3a7d81a7b03 |
children |
rev | line source |
---|---|
4 | 1 #-----------------------------------------------------------------------------# |
2 # SDL_sound -- An abstract sound format decoding API. | |
3 # Copyright (C) 2001 Ryan C. Gordon. | |
4 # | |
5 # This library is free software; you can redistribute it and/or | |
6 # modify it under the terms of the GNU Lesser General Public | |
7 # License as published by the Free Software Foundation; either | |
8 # version 2.1 of the License, or (at your option) any later version. | |
9 # | |
10 # This library is distributed in the hope that it will be useful, | |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 # Lesser General Public License for more details. | |
14 # | |
15 # You should have received a copy of the GNU Lesser General Public | |
16 # License along with this library; if not, write to the Free Software | |
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 # | |
19 # (Please see the file LICENSE in the source's root directory.) | |
20 # | |
21 # This file written by Ryan C. Gordon. | |
22 #-----------------------------------------------------------------------------# | |
23 | |
24 | |
25 #-----------------------------------------------------------------------------# | |
26 # Makefile for building SDL_sound on Unix-like systems. Follow the | |
27 # instructions for editing this file, then run "make" on the command line. | |
28 #-----------------------------------------------------------------------------# | |
29 | |
30 | |
31 #-----------------------------------------------------------------------------# | |
32 # Set to your liking. | |
33 #-----------------------------------------------------------------------------# | |
34 CC = gcc | |
35 LINKER = gcc | |
36 | |
37 | |
38 #-----------------------------------------------------------------------------# | |
39 # If this makefile fails to detect Cygwin correctly, or you want to force | |
40 # the build process's behaviour, set it to "true" or "false" (w/o quotes). | |
41 #-----------------------------------------------------------------------------# | |
42 #cygwin := true | |
43 #cygwin := false | |
44 cygwin := autodetect | |
45 | |
46 #-----------------------------------------------------------------------------# | |
47 # You only need to set SDL_INC_DIR and SDL_LIB_DIR if you are using cygwin. | |
48 # SDL_INC_DIR is where SDL.h and associated headers can be found, and | |
49 # SDL_LIB_DIR is where SDL.lib and SDL.dll are located. These may be set as | |
50 # environment variables, if you'd prefer to not hack the Makefile. | |
51 # | |
52 # examples: | |
53 # SDL_INC_DIR := C:/2/SDL-1.1.8/include | |
54 # SDL_LIB_DIR := C:/2/SDL-1.1.8/lib | |
55 #-----------------------------------------------------------------------------# | |
56 ifeq ($(strip $(SDL_INC_DIR)),) | |
57 SDL_INC_DIR := please_set_me_cygwin_users | |
58 endif | |
59 | |
60 ifeq ($(strip $(SDL_LIB_DIR)),) | |
61 SDL_LIB_DIR := please_set_me_cygwin_users | |
62 endif | |
63 | |
64 #-----------------------------------------------------------------------------# | |
65 # Set this to true if you want to create a debug build. | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
66 # (for generating debugging symbols, disabling optimizations, etc.) |
4 | 67 #-----------------------------------------------------------------------------# |
68 #debugging := false | |
69 debugging := true | |
70 | |
71 #-----------------------------------------------------------------------------# | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
72 # Set this to true if you want debugging output. This does a LOT of |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
73 # chattering to stdout, and can be used with out without the (debugging) |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
74 # option above. You do NOT want this in a release build! |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
75 #-----------------------------------------------------------------------------# |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
76 #debugging_chatter := false |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
77 debugging_chatter := true |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
78 |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
79 #-----------------------------------------------------------------------------# |
4 | 80 # Set the decoder types you'd like to support. |
81 # Note that various decoders may need external libraries. | |
82 #-----------------------------------------------------------------------------# | |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
83 use_decoder_raw := true |
56
2d0873719c77
Enabling MP3 support by default.
Ryan C. Gordon <icculus@icculus.org>
parents:
50
diff
changeset
|
84 use_decoder_mp3 := true |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
85 use_decoder_mod := true |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
86 use_decoder_voc := true |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
87 use_decoder_wav := true |
35 | 88 use_decoder_aiff := true |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
89 use_decoder_ogg := true |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
90 |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
91 |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
92 #-----------------------------------------------------------------------------# |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
93 # If use_decoder_mod is set to true, and libmikmod is in a nonstandard place, |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
94 # note that here. It's usually safe to leave these commented if you installed |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
95 # MikMod from a package like an RPM, or from source with the defaults. |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
96 #-----------------------------------------------------------------------------# |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
97 #INCPATH_MOD := -I/usr/local/include |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
98 #LIBPATH_MOD := -L/usr/local/lib |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
99 |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
100 |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
101 #-----------------------------------------------------------------------------# |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
102 # If use_decoder_ogg is set to true, and libvorbis and libvorbisfile are |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
103 # in a nonstandard place, set them here. It's usually safe to leave these |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
104 # commented if you installed Ogg Vorbis from a package like an RPM, or from |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
105 # source with the defaults. |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
106 #-----------------------------------------------------------------------------# |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
107 #INCPATH_OGG := -I/usr/local/include |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
108 #LIBPATH_OGG := -L/usr/local/lib |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
109 |
4 | 110 |
111 #-----------------------------------------------------------------------------# | |
112 # Set to "true" if you'd like to build a DLL. Set to "false" otherwise. | |
113 #-----------------------------------------------------------------------------# | |
114 #build_dll := false | |
115 build_dll := true | |
116 | |
117 #-----------------------------------------------------------------------------# | |
118 # Set one of the below. Currently, none of these are used. | |
119 #-----------------------------------------------------------------------------# | |
120 #use_asm = -DUSE_I386_ASM | |
121 use_asm = -DUSE_PORTABLE_C | |
122 | |
123 | |
124 #-----------------------------------------------------------------------------# | |
125 # Set this to where you want SDL_sound installed. It will put the | |
126 # files in $(install_prefix)/bin, $(install_prefix)/lib, and | |
127 # $(install_prefix)/include ... | |
128 #-----------------------------------------------------------------------------# | |
129 install_prefix := /usr/local | |
130 | |
131 | |
132 #-----------------------------------------------------------------------------# | |
133 #-----------------------------------------------------------------------------# | |
134 #-----------------------------------------------------------------------------# | |
135 #-----------------------------------------------------------------------------# | |
136 # Everything below this line is probably okay. | |
137 #-----------------------------------------------------------------------------# | |
138 #-----------------------------------------------------------------------------# | |
139 #-----------------------------------------------------------------------------# | |
140 #-----------------------------------------------------------------------------# | |
141 | |
142 #-----------------------------------------------------------------------------# | |
143 # CygWin autodetect. | |
144 #-----------------------------------------------------------------------------# | |
145 | |
146 ifeq ($(strip $(cygwin)),autodetect) | |
147 ifneq ($(strip $(shell gcc -v 2>&1 |grep "cygwin")),) | |
148 cygwin := true | |
149 else | |
150 cygwin := false | |
151 endif | |
152 endif | |
153 | |
154 | |
155 #-----------------------------------------------------------------------------# | |
156 # Platform-specific binary stuff. | |
157 #-----------------------------------------------------------------------------# | |
158 | |
159 ifeq ($(strip $(cygwin)),true) | |
160 ifeq ($(strip $(SDL_INC_DIR)),please_set_me_cygwin_users) | |
161 $(error Cygwin users need to set the SDL_INC_DIR envr var.) | |
162 else | |
163 SDL_CFLAGS := -I$(SDL_INC_DIR) | |
164 endif | |
165 | |
166 ifeq ($(strip $(SDL_LIB_DIR)),please_set_me_cygwin_users) | |
167 $(error Cygwin users need to set the SDL_LIB_DIR envr var.) | |
168 else | |
169 SDL_LDFLAGS := -L$(SDL_LIB_DIR) -lSDL | |
170 endif | |
171 | |
172 # !!! FIXME | |
173 build_dll := false | |
174 # !!! FIXME | |
175 | |
176 ASM = nasmw | |
177 EXE_EXT = .exe | |
178 DLL_EXT = .dll | |
179 STATICLIB_EXT = .a | |
180 ASMOBJFMT = win32 | |
181 ASMDEFS = -dC_IDENTIFIERS_UNDERSCORED | |
182 CFLAGS += -DC_IDENTIFIERS_UNDERSCORED | |
183 else | |
184 ASM = nasm | |
185 EXE_EXT = | |
186 DLL_EXT = .so | |
187 STATICLIB_EXT = .a | |
188 ASMOBJFMT = elf | |
189 SDL_CFLAGS := $(shell sdl-config --cflags) | |
190 SDL_LDFLAGS := $(shell sdl-config --libs) | |
191 endif | |
192 | |
193 CFLAGS += $(SDL_CFLAGS) | |
194 LDFLAGS += $(SDL_LDFLAGS) | |
195 | |
196 ifeq ($(strip $(build_dll)),true) | |
197 LIB_EXT := $(DLL_EXT) | |
198 SHAREDFLAGS += -shared | |
199 else | |
200 LIB_EXT := $(STATICLIB_EXT) | |
201 endif | |
202 | |
203 #-----------------------------------------------------------------------------# | |
204 # Version crapola. | |
205 #-----------------------------------------------------------------------------# | |
206 VERMAJOR := $(shell grep "define SOUND_VER_MAJOR" SDL_sound.h | sed "s/\#define SOUND_VER_MAJOR //") | |
207 VERMINOR := $(shell grep "define SOUND_VER_MINOR" SDL_sound.h | sed "s/\#define SOUND_VER_MINOR //") | |
208 VERPATCH := $(shell grep "define SOUND_VER_PATCH" SDL_sound.h | sed "s/\#define SOUND_VER_PATCH //") | |
209 | |
210 VERMAJOR := $(strip $(VERMAJOR)) | |
211 VERMINOR := $(strip $(VERMINOR)) | |
212 VERPATCH := $(strip $(VERPATCH)) | |
213 | |
214 VERFULL := $(VERMAJOR).$(VERMINOR).$(VERPATCH) | |
215 | |
216 #-----------------------------------------------------------------------------# | |
217 # General compiler, assembler, and linker flags. | |
218 #-----------------------------------------------------------------------------# | |
219 | |
220 BINDIR := bin | |
221 SRCDIR := . | |
222 | |
18 | 223 CFLAGS := -I$(SRCDIR) $(CFLAGS) |
224 CFLAGS += $(use_asm) -D_REENTRANT -fsigned-char -DPLATFORM_UNIX | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
225 CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi |
4 | 226 |
227 LDFLAGS += -lm | |
228 | |
229 ifeq ($(strip $(debugging)),true) | |
230 CFLAGS += -DDEBUG -g -fno-omit-frame-pointer | |
231 LDFLAGS += -g -fno-omit-frame-pointer | |
232 else | |
233 CFLAGS += -DNDEBUG -O2 -fomit-frame-pointer | |
234 LDFLAGS += -O2 -fomit-frame-pointer | |
235 endif | |
236 | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
237 ifeq ($(strip $(debugging_chatter)),true) |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
238 CFLAGS += -DDEBUG_CHATTER |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
239 endif |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
240 |
4 | 241 ASMFLAGS := -f $(ASMOBJFMT) $(ASMDEFS) |
242 | |
243 #-----------------------------------------------------------------------------# | |
244 # Source and target names. | |
245 #-----------------------------------------------------------------------------# | |
246 | |
247 PUREBASELIBNAME := SDL_sound | |
248 ifeq ($(strip $(cygwin)),true) | |
249 BASELIBNAME := $(strip $(PUREBASELIBNAME)) | |
250 else | |
251 BASELIBNAME := lib$(strip $(PUREBASELIBNAME)) | |
252 endif | |
253 | |
254 MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) | |
255 | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
256 PLAYSOUNDSRCS := test/playsound.c |
4 | 257 |
258 MAINSRCS := SDL_sound.c | |
259 | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
260 need_extra_rwops := false |
4 | 261 ifeq ($(strip $(use_decoder_raw)),true) |
262 MAINSRCS += decoders/raw.c | |
263 CFLAGS += -DSOUND_SUPPORTS_RAW | |
264 endif | |
265 | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
266 ifeq ($(strip $(use_decoder_mp3)),true) |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
267 MAINSRCS += decoders/mp3.c |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
268 need_extra_rwops := true |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
269 CFLAGS += -DSOUND_SUPPORTS_MP3 $(shell smpeg-config --cflags) |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
270 LDFLAGS += $(shell smpeg-config --libs) |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
271 endif |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
272 |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
273 ifeq ($(strip $(use_decoder_mod)),true) |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
274 MAINSRCS += decoders/mod.c |
50
d7e118d8fede
Removed -DUSE_RWOPS for MOD, and readded -Werror.
Ryan C. Gordon <icculus@icculus.org>
parents:
45
diff
changeset
|
275 CFLAGS += -DSOUND_SUPPORTS_MOD |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
276 LDFLAGS += -lmikmod |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
277 endif |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
278 |
4 | 279 ifeq ($(strip $(use_decoder_voc)),true) |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
280 MAINSRCS += decoders/voc.c |
4 | 281 CFLAGS += -DSOUND_SUPPORTS_VOC |
282 endif | |
283 | |
18 | 284 ifeq ($(strip $(use_decoder_wav)),true) |
285 MAINSRCS += decoders/wav.c | |
286 CFLAGS += -DSOUND_SUPPORTS_WAV | |
287 endif | |
288 | |
35 | 289 ifeq ($(strip $(use_decoder_aiff)),true) |
290 MAINSRCS += decoders/aiff.c | |
291 CFLAGS += -DSOUND_SUPPORTS_AIFF | |
292 endif | |
293 | |
27 | 294 ifeq ($(strip $(use_decoder_ogg)),true) |
295 MAINSRCS += decoders/ogg.c | |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
296 CFLAGS += -DSOUND_SUPPORTS_OGG $(INCPATH_OGG) |
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
297 LDFLAGS += $(LIBPATH_OGG) -lvorbisfile -lvorbis |
27 | 298 endif |
299 | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
300 ifeq ($(strip $(need_extra_rwops)),true) |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
301 MAINSRCS += extra_rwops.c |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
302 endif |
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
303 |
4 | 304 #ifeq ($(strip $(cygwin)),true) |
305 # MAINSRCS += platform/win32.c | |
306 # CFLAGS += -DWIN32 | |
307 #else | |
308 # MAINSRCS += platform/unix.c | |
309 #endif | |
310 | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
311 PLAYSOUNDEXE := $(BINDIR)/playsound$(EXE_EXT) |
4 | 312 |
313 # Rule for getting list of objects from source | |
314 MAINOBJS1 := $(MAINSRCS:.c=.o) | |
315 MAINOBJS2 := $(MAINOBJS1:.cpp=.o) | |
316 MAINOBJS3 := $(MAINOBJS2:.asm=.o) | |
317 MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f)) | |
318 MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f)) | |
319 | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
320 PLAYSOUNDOBJS1 := $(PLAYSOUNDSRCS:.c=.o) |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
321 PLAYSOUNDOBJS2 := $(PLAYSOUNDOBJS1:.cpp=.o) |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
322 PLAYSOUNDOBJS3 := $(PLAYSOUNDOBJS2:.asm=.o) |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
323 PLAYSOUNDOBJS := $(foreach f,$(PLAYSOUNDOBJS3),$(BINDIR)/$(f)) |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
324 PLAYSOUNDSRCS := $(foreach f,$(PLAYSOUNDSRCS),$(SRCDIR)/$(f)) |
4 | 325 |
326 CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \ | |
327 $(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \ | |
328 $(wildcard *~) $(wildcard *.err) \ | |
329 $(wildcard .\#*) core | |
330 | |
331 | |
332 #-----------------------------------------------------------------------------# | |
333 # Rules. | |
334 #-----------------------------------------------------------------------------# | |
335 | |
336 # Rules for turning source files into .o files | |
337 $(BINDIR)/%.o: $(SRCDIR)/%.cpp | |
338 $(CC) -c -o $@ $< $(CFLAGS) | |
339 | |
340 $(BINDIR)/%.o: $(SRCDIR)/%.c | |
341 $(CC) -c -o $@ $< $(CFLAGS) | |
342 | |
343 $(BINDIR)/%.o: $(SRCDIR)/%.asm | |
344 $(ASM) $(ASMFLAGS) -o $@ $< | |
345 | |
346 .PHONY: all clean distclean listobjs install showcfg showflags | |
347 | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
348 all: $(BINDIR) $(EXTRABUILD) $(MAINLIB) $(PLAYSOUNDEXE) |
4 | 349 |
350 $(MAINLIB) : $(BINDIR) $(MAINOBJS) | |
351 $(LINKER) -o $(MAINLIB) $(SHAREDFLAGS) $(MAINOBJS) $(LDFLAGS) | |
352 | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
353 $(PLAYSOUNDEXE) : $(MAINLIB) $(PLAYSOUNDOBJS) |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
354 $(LINKER) -o $(PLAYSOUNDEXE) $(PLAYSOUNDOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME)) $(LDFLAGS) |
4 | 355 |
356 | |
357 install: all | |
358 rm -f $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)).$(strip $(VERMINOR)).* | |
359 mkdir -p $(install_prefix)/bin | |
360 mkdir -p $(install_prefix)/lib | |
361 mkdir -p $(install_prefix)/include | |
362 cp $(SRCDIR)/SDL_sound.h $(install_prefix)/include | |
60
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
363 cp $(PLAYSOUNDEXE) $(install_prefix)/bin |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
364 rm -f $(install_prefix)/bin/test_sdlsound$(strip $(EXE_EXT)) # this line can be removed later. |
c3a7d81a7b03
Changed test_sdlsound to playsound.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
365 |
4 | 366 ifeq ($(strip $(cygwin)),true) |
367 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) | |
368 else | |
369 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) | |
370 ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) | |
371 ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)) | |
372 chmod 0755 $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) | |
373 chmod 0644 $(install_prefix)/include/SDL_sound.h | |
374 endif | |
375 | |
376 $(BINDIR): | |
377 mkdir -p $(BINDIR) | |
378 mkdir -p $(BINDIR)/decoders | |
379 mkdir -p $(BINDIR)/platform | |
380 mkdir -p $(BINDIR)/test | |
381 | |
382 distclean: clean | |
383 | |
384 clean: | |
385 rm -f $(CLEANUP) | |
386 rm -rf $(BINDIR) | |
387 | |
388 listobjs: | |
389 @echo SOURCES: | |
390 @echo $(MAINSRCS) | |
391 @echo | |
392 @echo OBJECTS: | |
393 @echo $(MAINOBJS) | |
394 @echo | |
395 @echo BINARIES: | |
396 @echo $(MAINLIB) | |
397 | |
398 showcfg: | |
399 @echo "Compiler : $(CC)" | |
400 @echo "Using CygWin : $(cygwin)" | |
401 @echo "Debugging : $(debugging)" | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
402 @echo "Debugging chatter : $(debugging_chatter)" |
4 | 403 @echo "ASM flag : $(use_asm)" |
404 @echo "SDL_sound version : $(VERFULL)" | |
405 @echo "Building DLLs : $(build_dll)" | |
406 @echo "Install prefix : $(install_prefix)" | |
18 | 407 @echo "Supports .WAV : $(use_decoder_wav)" |
35 | 408 @echo "Supports .AIFF : $(use_decoder_aiff)" |
4 | 409 @echo "Supports .RAW : $(use_decoder_raw)" |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
410 @echo "Supports .MP3 : $(use_decoder_mp3)" |
45
f7a792fdf7a4
Added MOD support, and make a per include/lib paths definable.
Ryan C. Gordon <icculus@icculus.org>
parents:
35
diff
changeset
|
411 @echo "Supports .MOD : $(use_decoder_mod)" |
4 | 412 @echo "Supports .VOC : $(use_decoder_voc)" |
31
530fa59d5db9
Added Ogg Vorbis to "showcfg" target.
Ryan C. Gordon <icculus@icculus.org>
parents:
27
diff
changeset
|
413 @echo "Supports .OGG : $(use_decoder_ogg)" |
4 | 414 |
415 showflags: | |
416 @echo 'CFLAGS : $(CFLAGS)' | |
417 @echo 'LDFLAGS : $(LDFLAGS)' | |
418 | |
419 | |
420 #-----------------------------------------------------------------------------# | |
421 # This section is pretty much just for Ryan's use to make distributions. | |
422 # You Probably Should Not Touch. | |
423 #-----------------------------------------------------------------------------# | |
424 | |
425 # These are the files needed in a binary distribution, regardless of what | |
426 # platform is being used. | |
427 BINSCOMMON := LICENSE CHANGELOG SDL_sound.h | |
428 | |
429 .PHONY: package msbins win32bins nocygwin | |
430 package: clean | |
431 cd .. ; mv SDL_sound SDL_sound-$(VERFULL) ; tar -cyvvf ./SDL_sound-$(VERFULL).tar.bz2 --exclude="*CVS*" SDL_sound-$(VERFULL) ; mv SDL_sound-$(VERFULL) SDL_sound | |
432 | |
433 | |
434 ifeq ($(strip $(cygwin)),true) | |
435 msbins: win32bins | |
436 | |
437 win32bins: clean all | |
438 cp $(SDL_LIB_DIR)/SDL.dll . | |
439 echo -e "\r\n\r\n\r\nHEY YOU.\r\n\r\n\r\nTake a look at README-win32bins.txt FIRST.\r\n\r\n\r\n--ryan. (icculus@clutteredmind.org)\r\n\r\n" |zip -9rz ../SDL_sound-win32bins-$(shell date +%m%d%Y).zip $(MAINLIB) SDL.dll $(EXTRAPACKAGELIBS) README-win32bins.txt | |
440 | |
441 else | |
442 | |
443 msbins: nocygwin | |
444 win32bins: nocygwin | |
445 | |
446 nocygwin: | |
447 @echo This must be done on a Windows box in the Cygwin environment. | |
448 | |
449 endif | |
450 | |
451 #-----------------------------------------------------------------------------# | |
452 # That's all, folks. | |
453 #-----------------------------------------------------------------------------# | |
454 | |
455 # end of Makefile ... |