Mercurial > SDL_sound_CoreAudio
annotate Makefile @ 56:2d0873719c77
Enabling MP3 support by default.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 24 Sep 2001 08:13:12 +0000 |
parents | d7e118d8fede |
children | c3a7d81a7b03 |
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 | |
50
d7e118d8fede
Removed -DUSE_RWOPS for MOD, and readded -Werror.
Ryan C. Gordon <icculus@icculus.org>
parents:
45
diff
changeset
|
225 CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi -pedantic |
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 | |
256 TESTSRCS := test/test_sdlsound.c | |
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 | |
311 TESTEXE := $(BINDIR)/test_sdlsound$(EXE_EXT) | |
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 | |
320 TESTOBJS1 := $(TESTSRCS:.c=.o) | |
321 TESTOBJS2 := $(TESTOBJS1:.cpp=.o) | |
322 TESTOBJS3 := $(TESTOBJS2:.asm=.o) | |
323 TESTOBJS := $(foreach f,$(TESTOBJS3),$(BINDIR)/$(f)) | |
324 TESTSRCS := $(foreach f,$(TESTSRCS),$(SRCDIR)/$(f)) | |
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 | |
348 all: $(BINDIR) $(EXTRABUILD) $(MAINLIB) $(TESTEXE) | |
349 | |
350 $(MAINLIB) : $(BINDIR) $(MAINOBJS) | |
351 $(LINKER) -o $(MAINLIB) $(SHAREDFLAGS) $(MAINOBJS) $(LDFLAGS) | |
352 | |
353 $(TESTEXE) : $(MAINLIB) $(TESTOBJS) | |
354 $(LINKER) -o $(TESTEXE) $(TESTLDFLAGS) $(TESTOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME)) $(LDFLAGS) | |
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 | |
363 cp $(TESTEXE) $(install_prefix)/bin | |
364 ifeq ($(strip $(cygwin)),true) | |
365 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) | |
366 else | |
367 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) | |
368 ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) | |
369 ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)) | |
370 chmod 0755 $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) | |
371 chmod 0644 $(install_prefix)/include/SDL_sound.h | |
372 endif | |
373 | |
374 $(BINDIR): | |
375 mkdir -p $(BINDIR) | |
376 mkdir -p $(BINDIR)/decoders | |
377 mkdir -p $(BINDIR)/platform | |
378 mkdir -p $(BINDIR)/test | |
379 | |
380 distclean: clean | |
381 | |
382 clean: | |
383 rm -f $(CLEANUP) | |
384 rm -rf $(BINDIR) | |
385 | |
386 listobjs: | |
387 @echo SOURCES: | |
388 @echo $(MAINSRCS) | |
389 @echo | |
390 @echo OBJECTS: | |
391 @echo $(MAINOBJS) | |
392 @echo | |
393 @echo BINARIES: | |
394 @echo $(MAINLIB) | |
395 | |
396 showcfg: | |
397 @echo "Compiler : $(CC)" | |
398 @echo "Using CygWin : $(cygwin)" | |
399 @echo "Debugging : $(debugging)" | |
6
3f214fe4a82f
Added debugging_chatter flag, and VOC and MP3 decoders.
Ryan C. Gordon <icculus@icculus.org>
parents:
4
diff
changeset
|
400 @echo "Debugging chatter : $(debugging_chatter)" |
4 | 401 @echo "ASM flag : $(use_asm)" |
402 @echo "SDL_sound version : $(VERFULL)" | |
403 @echo "Building DLLs : $(build_dll)" | |
404 @echo "Install prefix : $(install_prefix)" | |
18 | 405 @echo "Supports .WAV : $(use_decoder_wav)" |
35 | 406 @echo "Supports .AIFF : $(use_decoder_aiff)" |
4 | 407 @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
|
408 @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
|
409 @echo "Supports .MOD : $(use_decoder_mod)" |
4 | 410 @echo "Supports .VOC : $(use_decoder_voc)" |
31
530fa59d5db9
Added Ogg Vorbis to "showcfg" target.
Ryan C. Gordon <icculus@icculus.org>
parents:
27
diff
changeset
|
411 @echo "Supports .OGG : $(use_decoder_ogg)" |
4 | 412 |
413 showflags: | |
414 @echo 'CFLAGS : $(CFLAGS)' | |
415 @echo 'LDFLAGS : $(LDFLAGS)' | |
416 | |
417 | |
418 #-----------------------------------------------------------------------------# | |
419 # This section is pretty much just for Ryan's use to make distributions. | |
420 # You Probably Should Not Touch. | |
421 #-----------------------------------------------------------------------------# | |
422 | |
423 # These are the files needed in a binary distribution, regardless of what | |
424 # platform is being used. | |
425 BINSCOMMON := LICENSE CHANGELOG SDL_sound.h | |
426 | |
427 .PHONY: package msbins win32bins nocygwin | |
428 package: clean | |
429 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 | |
430 | |
431 | |
432 ifeq ($(strip $(cygwin)),true) | |
433 msbins: win32bins | |
434 | |
435 win32bins: clean all | |
436 cp $(SDL_LIB_DIR)/SDL.dll . | |
437 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 | |
438 | |
439 else | |
440 | |
441 msbins: nocygwin | |
442 win32bins: nocygwin | |
443 | |
444 nocygwin: | |
445 @echo This must be done on a Windows box in the Cygwin environment. | |
446 | |
447 endif | |
448 | |
449 #-----------------------------------------------------------------------------# | |
450 # That's all, folks. | |
451 #-----------------------------------------------------------------------------# | |
452 | |
453 # end of Makefile ... |