comparison Makefile @ 60:c3a7d81a7b03

Changed test_sdlsound to playsound.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 24 Sep 2001 15:29:58 +0000
parents 2d0873719c77
children
comparison
equal deleted inserted replaced
59:cd91e1857b42 60:c3a7d81a7b03
220 BINDIR := bin 220 BINDIR := bin
221 SRCDIR := . 221 SRCDIR := .
222 222
223 CFLAGS := -I$(SRCDIR) $(CFLAGS) 223 CFLAGS := -I$(SRCDIR) $(CFLAGS)
224 CFLAGS += $(use_asm) -D_REENTRANT -fsigned-char -DPLATFORM_UNIX 224 CFLAGS += $(use_asm) -D_REENTRANT -fsigned-char -DPLATFORM_UNIX
225 CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi -pedantic 225 CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi
226 226
227 LDFLAGS += -lm 227 LDFLAGS += -lm
228 228
229 ifeq ($(strip $(debugging)),true) 229 ifeq ($(strip $(debugging)),true)
230 CFLAGS += -DDEBUG -g -fno-omit-frame-pointer 230 CFLAGS += -DDEBUG -g -fno-omit-frame-pointer
251 BASELIBNAME := lib$(strip $(PUREBASELIBNAME)) 251 BASELIBNAME := lib$(strip $(PUREBASELIBNAME))
252 endif 252 endif
253 253
254 MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) 254 MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT))
255 255
256 TESTSRCS := test/test_sdlsound.c 256 PLAYSOUNDSRCS := test/playsound.c
257 257
258 MAINSRCS := SDL_sound.c 258 MAINSRCS := SDL_sound.c
259 259
260 need_extra_rwops := false 260 need_extra_rwops := false
261 ifeq ($(strip $(use_decoder_raw)),true) 261 ifeq ($(strip $(use_decoder_raw)),true)
306 # CFLAGS += -DWIN32 306 # CFLAGS += -DWIN32
307 #else 307 #else
308 # MAINSRCS += platform/unix.c 308 # MAINSRCS += platform/unix.c
309 #endif 309 #endif
310 310
311 TESTEXE := $(BINDIR)/test_sdlsound$(EXE_EXT) 311 PLAYSOUNDEXE := $(BINDIR)/playsound$(EXE_EXT)
312 312
313 # Rule for getting list of objects from source 313 # Rule for getting list of objects from source
314 MAINOBJS1 := $(MAINSRCS:.c=.o) 314 MAINOBJS1 := $(MAINSRCS:.c=.o)
315 MAINOBJS2 := $(MAINOBJS1:.cpp=.o) 315 MAINOBJS2 := $(MAINOBJS1:.cpp=.o)
316 MAINOBJS3 := $(MAINOBJS2:.asm=.o) 316 MAINOBJS3 := $(MAINOBJS2:.asm=.o)
317 MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f)) 317 MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f))
318 MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f)) 318 MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f))
319 319
320 TESTOBJS1 := $(TESTSRCS:.c=.o) 320 PLAYSOUNDOBJS1 := $(PLAYSOUNDSRCS:.c=.o)
321 TESTOBJS2 := $(TESTOBJS1:.cpp=.o) 321 PLAYSOUNDOBJS2 := $(PLAYSOUNDOBJS1:.cpp=.o)
322 TESTOBJS3 := $(TESTOBJS2:.asm=.o) 322 PLAYSOUNDOBJS3 := $(PLAYSOUNDOBJS2:.asm=.o)
323 TESTOBJS := $(foreach f,$(TESTOBJS3),$(BINDIR)/$(f)) 323 PLAYSOUNDOBJS := $(foreach f,$(PLAYSOUNDOBJS3),$(BINDIR)/$(f))
324 TESTSRCS := $(foreach f,$(TESTSRCS),$(SRCDIR)/$(f)) 324 PLAYSOUNDSRCS := $(foreach f,$(PLAYSOUNDSRCS),$(SRCDIR)/$(f))
325 325
326 CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \ 326 CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \
327 $(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \ 327 $(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \
328 $(wildcard *~) $(wildcard *.err) \ 328 $(wildcard *~) $(wildcard *.err) \
329 $(wildcard .\#*) core 329 $(wildcard .\#*) core
343 $(BINDIR)/%.o: $(SRCDIR)/%.asm 343 $(BINDIR)/%.o: $(SRCDIR)/%.asm
344 $(ASM) $(ASMFLAGS) -o $@ $< 344 $(ASM) $(ASMFLAGS) -o $@ $<
345 345
346 .PHONY: all clean distclean listobjs install showcfg showflags 346 .PHONY: all clean distclean listobjs install showcfg showflags
347 347
348 all: $(BINDIR) $(EXTRABUILD) $(MAINLIB) $(TESTEXE) 348 all: $(BINDIR) $(EXTRABUILD) $(MAINLIB) $(PLAYSOUNDEXE)
349 349
350 $(MAINLIB) : $(BINDIR) $(MAINOBJS) 350 $(MAINLIB) : $(BINDIR) $(MAINOBJS)
351 $(LINKER) -o $(MAINLIB) $(SHAREDFLAGS) $(MAINOBJS) $(LDFLAGS) 351 $(LINKER) -o $(MAINLIB) $(SHAREDFLAGS) $(MAINOBJS) $(LDFLAGS)
352 352
353 $(TESTEXE) : $(MAINLIB) $(TESTOBJS) 353 $(PLAYSOUNDEXE) : $(MAINLIB) $(PLAYSOUNDOBJS)
354 $(LINKER) -o $(TESTEXE) $(TESTLDFLAGS) $(TESTOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME)) $(LDFLAGS) 354 $(LINKER) -o $(PLAYSOUNDEXE) $(PLAYSOUNDOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME)) $(LDFLAGS)
355 355
356 356
357 install: all 357 install: all
358 rm -f $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)).$(strip $(VERMINOR)).* 358 rm -f $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)).$(strip $(VERMINOR)).*
359 mkdir -p $(install_prefix)/bin 359 mkdir -p $(install_prefix)/bin
360 mkdir -p $(install_prefix)/lib 360 mkdir -p $(install_prefix)/lib
361 mkdir -p $(install_prefix)/include 361 mkdir -p $(install_prefix)/include
362 cp $(SRCDIR)/SDL_sound.h $(install_prefix)/include 362 cp $(SRCDIR)/SDL_sound.h $(install_prefix)/include
363 cp $(TESTEXE) $(install_prefix)/bin 363 cp $(PLAYSOUNDEXE) $(install_prefix)/bin
364 rm -f $(install_prefix)/bin/test_sdlsound$(strip $(EXE_EXT)) # this line can be removed later.
365
364 ifeq ($(strip $(cygwin)),true) 366 ifeq ($(strip $(cygwin)),true)
365 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) 367 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT))
366 else 368 else
367 cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) 369 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)) 370 ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT))