diff --git a/Quake/Makefile b/Quake/Makefile index 0e2b655c..8fd3ca2a 100644 --- a/Quake/Makefile +++ b/Quake/Makefile @@ -1,26 +1,23 @@ -### GNU Makefile for QuakeSpasm unix targets, Mar. 27, 2011 +### GNU Makefile for QuakeSpasm unix targets, Aug. 27, 2011 # # You need the SDL library fully installed. # "make DEBUG=1" to build a debug client. # "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. -# "make SDLNET=1" to use SDL_net (not recommended) -# instead of platform specific code. -# Build objects are separate from those of codeblocks +# "make SDLNET=1" to use SDL_net (NOT recommended) instead of platform +# specific code. ### Embed custom Quakespasm console background picture USE_QS_CONBACK=1 ### Enable/Disable codecs for streaming music support -# -# OGG (vorbis) playback requires libvorbis and libogg -# MP3 playback requires libmad or libmpg123 (see MP3LIB below) - USE_CODEC_WAVE=1 USE_CODEC_MP3=1 USE_CODEC_VORBIS=1 # which library to use for mp3 decoding: mad or mpg123 MP3LIB=mad +# which library to use for ogg decoding: vorbis or tremor +VORBISLIB=vorbis # ============================================================================ # Helper functions @@ -114,7 +111,7 @@ SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) SDL_LFLAGS := $(shell $(SDL_CONFIG) --libs) ifeq ($(SDLNET),1) -NET_LIBS := SDL_net +NET_LIBS :=-lSDL_net CFLAGS +=-D_USE_SDLNET else NET_LIBS := @@ -124,15 +121,31 @@ ifeq ($(USE_QS_CONBACK),1) CFLAGS+= -DUSE_QS_CONBACK endif +ifneq ($(VORBISLIB),vorbis) +ifneq ($(VORBISLIB),tremor) +$(error Invalid VORBISLIB setting) +endif +endif +ifneq ($(MP3LIB),mpg123) +ifneq ($(MP3LIB),mad) +$(error Invalid MP3LIB setting) +endif +endif ifeq ($(MP3LIB),mad) mp3_obj=snd_mp3.o -else +lib_mp3dec=-lmad +endif ifeq ($(MP3LIB),mpg123) mp3_obj=snd_mpg123.o -else -USE_CODEC_MP3=no -mp3_obj=snd_mp3.o +lib_mp3dec=-lmpg123 endif +ifeq ($(VORBISLIB),vorbis) +cpp_vorbisdec= +lib_vorbisdec=-lvorbisfile -lvorbis -logg +endif +ifeq ($(VORBISLIB),tremor) +cpp_vorbisdec=-DVORBIS_USE_TREMOR +lib_vorbisdec=-lvorbisidec -logg endif CODECLIBS := @@ -140,17 +153,17 @@ ifeq ($(USE_CODEC_WAVE),1) CFLAGS+= -DUSE_CODEC_WAVE endif ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS -CODECLIBS+= vorbisfile vorbis ogg +CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) +CODECLIBS+= $(lib_vorbisdec) endif ifeq ($(USE_CODEC_MP3),1) CFLAGS+= -DUSE_CODEC_MP3 -CODECLIBS+= $(MP3LIB) +CODECLIBS+= $(lib_mp3dec) endif -COMMON_LIBS:= m GL +COMMON_LIBS:= -lm -lGL -LIBS := $(patsubst %,-l%,$(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)) +LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS) # --------------------------- # targets diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin index b064ef71..2d475a1e 100644 --- a/Quake/Makefile.darwin +++ b/Quake/Makefile.darwin @@ -1,8 +1,14 @@ -# GNU Makefile for QuakeSpasm for Darwin only, April 22, 2011 +### GNU Makefile for QuakeSpasm for Darwin, Aug. 27, 2011 -# Usage: "make -f Makefile.darwin" +# Usage: "make -f Makefile.darwin" +# +# You need the SDL library fully installed. +# "make DEBUG=1" to build a debug client. +# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. +# "make SDLNET=1" to use SDL_net (NOT recommended) instead of platform +# specific code. -# COMPILING Quakespasm on OSX with Music enabled +# COMPILING Quakespasm on OSX with music enabled: # # Because of difficulties of compiling the CODEC libs on OSX (especially G4), # this makefile has been tweaked to link against the includes and libraries in ../MacOSX @@ -15,20 +21,18 @@ # Or copy ./MacOSX/*dylib to /usr/local/lib and use # DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib ./quakespasm -# Enable/Disable codecs for streaming music support +### Embed custom Quakespasm console background picture +USE_QS_CONBACK=1 + +### Enable/Disable codecs for streaming music support USE_CODEC_WAVE=1 USE_CODEC_MP3=1 USE_CODEC_VORBIS=1 + +# which library to use for mp3 decoding: mad or mpg123 MP3LIB=mpg123 - -# You need the SDL library fully installed. -# "make DEBUG=1" to build a debug client. -# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. -# "make SDLNET=1" to use SDL_net (not recommended) -# instead of platform specific code. - -### Embed custom Quakespasm console background picture -USE_QS_CONBACK=1 +# which library to use for ogg decoding: vorbis or tremor +VORBISLIB=vorbis # ============================================================================ # Helper functions @@ -139,15 +143,31 @@ ifeq ($(USE_QS_CONBACK),1) CFLAGS+= -DUSE_QS_CONBACK endif +ifneq ($(VORBISLIB),vorbis) +ifneq ($(VORBISLIB),tremor) +$(error Invalid VORBISLIB setting) +endif +endif +ifneq ($(MP3LIB),mpg123) +ifneq ($(MP3LIB),mad) +$(error Invalid MP3LIB setting) +endif +endif ifeq ($(MP3LIB),mad) mp3_obj=snd_mp3.o -else +lib_mp3dec=-lmad +endif ifeq ($(MP3LIB),mpg123) mp3_obj=snd_mpg123.o -else -USE_CODEC_MP3=no -mp3_obj=snd_mp3.o +lib_mp3dec=-lmpg123 endif +ifeq ($(VORBISLIB),vorbis) +cpp_vorbisdec= +lib_vorbisdec=-lvorbisfile -lvorbis -logg +endif +ifeq ($(VORBISLIB),tremor) +cpp_vorbisdec=-DVORBIS_USE_TREMOR +lib_vorbisdec=-lvorbisidec -logg endif # FIXME: The codec libs stuff are copied over from the unix makefile @@ -157,18 +177,17 @@ ifeq ($(USE_CODEC_WAVE),1) CFLAGS+= -DUSE_CODEC_WAVE endif ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS -CODECLIBS+= -lvorbisfile -lvorbis -logg +CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) +CODECLIBS+= $(lib_vorbisdec) endif ifeq ($(USE_CODEC_MP3),1) CFLAGS+= -DUSE_CODEC_MP3 -CODECLIBS+= -l$(MP3LIB) +CODECLIBS+= $(lib_mp3dec) endif -COMMON_LIBS = -Wl,-framework,OpenGL +COMMON_LIBS:= -Wl,-framework,OpenGL -#LIBS := $(patsubst %,-l%,$(COMMON_LIBS) $(NET_LIBS)) -LIBS = $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS) +LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS) # --------------------------- # targets diff --git a/Quake/Makefile.w32 b/Quake/Makefile.w32 index 63197594..8b611a59 100644 --- a/Quake/Makefile.w32 +++ b/Quake/Makefile.w32 @@ -1,9 +1,9 @@ # GNU Makefile for cross-compiling quakespasm.exe (Win32 : MinGW) -# using cross-toolchains on a linux host / Mar. 27, 2011. +# using cross-toolchains on a linux host / Aug. 27, 2011. # "make DEBUG=1" to build a debug client. # "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. # "make WINSOCK2=1" to use WinSock2 api instead of old WinSock 1.1. -# "make SDLNET=1" to use SDL_net (not recommended) instead of platform +# "make SDLNET=1" to use SDL_net (NOT recommended) instead of platform # specific code. ### Embed custom Quakespasm console background picture @@ -16,6 +16,8 @@ USE_CODEC_VORBIS=1 # which library to use for mp3 decoding: mad or mpg123 MP3LIB=mad +# which library to use for ogg decoding: vorbis or tremor +VORBISLIB=vorbis # ============================================================================ # Helper functions @@ -96,15 +98,31 @@ ifeq ($(USE_QS_CONBACK),1) CFLAGS+= -DUSE_QS_CONBACK endif +ifneq ($(VORBISLIB),vorbis) +ifneq ($(VORBISLIB),tremor) +$(error Invalid VORBISLIB setting) +endif +endif +ifneq ($(MP3LIB),mpg123) +ifneq ($(MP3LIB),mad) +$(error Invalid MP3LIB setting) +endif +endif ifeq ($(MP3LIB),mad) mp3_obj=snd_mp3.o -else +lib_mp3dec=-lmad +endif ifeq ($(MP3LIB),mpg123) mp3_obj=snd_mpg123.o -else -USE_CODEC_MP3=no -mp3_obj=snd_mp3.o +lib_mp3dec=-lmpg123 endif +ifeq ($(VORBISLIB),vorbis) +cpp_vorbisdec= +lib_vorbisdec=-lvorbisfile -lvorbis -logg +endif +ifeq ($(VORBISLIB),tremor) +cpp_vorbisdec=-DVORBIS_USE_TREMOR +lib_vorbisdec=-lvorbisidec -logg endif CODECLIBS := @@ -114,16 +132,16 @@ CODEC_INC = -I../Windows/codecs/include CODEC_LINK= -L../Windows/codecs/x86 endif ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS +CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) CODEC_INC = -I../Windows/codecs/include CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= -lvorbisfile -lvorbis -logg +CODECLIBS+= $(lib_vorbisdec) endif ifeq ($(USE_CODEC_MP3),1) CFLAGS+= -DUSE_CODEC_MP3 CODEC_INC = -I../Windows/codecs/include CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= -l$(MP3LIB) +CODECLIBS+= $(lib_mp3dec) endif CFLAGS+= $(CODEC_INC) diff --git a/Quake/Makefile.w64 b/Quake/Makefile.w64 index 7f1fdf38..78836d7f 100644 --- a/Quake/Makefile.w64 +++ b/Quake/Makefile.w64 @@ -1,9 +1,9 @@ # GNU Makefile for cross-compiling quakespasm.exe (Win64 : MinGW-w64) -# using cross-toolchains on a linux host / Mar. 27, 2011. +# using cross-toolchains on a linux host / Aug. 27, 2011. # "make DEBUG=1" to build a debug client. # "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. -# "make WINSOCK2=0" to use the old WinSock 1.1 api (not recommended). -# "make SDLNET=1" to use SDL_net (not recommended) instead of platform +# "make WINSOCK2=0" to use the old WinSock 1.1 api (NOT recommended). +# "make SDLNET=1" to use SDL_net (NOT recommended) instead of platform # specific code. ### Embed custom Quakespasm console background picture @@ -16,6 +16,8 @@ USE_CODEC_VORBIS=1 # which library to use for mp3 decoding: mad or mpg123 MP3LIB=mad +# which library to use for ogg decoding: vorbis or tremor +VORBISLIB=vorbis # ============================================================================ # Helper functions @@ -96,15 +98,31 @@ ifeq ($(USE_QS_CONBACK),1) CFLAGS+= -DUSE_QS_CONBACK endif +ifneq ($(VORBISLIB),vorbis) +ifneq ($(VORBISLIB),tremor) +$(error Invalid VORBISLIB setting) +endif +endif +ifneq ($(MP3LIB),mpg123) +ifneq ($(MP3LIB),mad) +$(error Invalid MP3LIB setting) +endif +endif ifeq ($(MP3LIB),mad) mp3_obj=snd_mp3.o -else +lib_mp3dec=-lmad +endif ifeq ($(MP3LIB),mpg123) mp3_obj=snd_mpg123.o -else -USE_CODEC_MP3=no -mp3_obj=snd_mp3.o +lib_mp3dec=-lmpg123 endif +ifeq ($(VORBISLIB),vorbis) +cpp_vorbisdec= +lib_vorbisdec=-lvorbisfile -lvorbis -logg +endif +ifeq ($(VORBISLIB),tremor) +cpp_vorbisdec=-DVORBIS_USE_TREMOR +lib_vorbisdec=-lvorbisidec -logg endif CODECLIBS := @@ -114,16 +132,16 @@ CODEC_INC = -I../Windows/codecs/include CODEC_LINK= -L../Windows/codecs/x64 endif ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS +CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) CODEC_INC = -I../Windows/codecs/include CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= -lvorbisfile -lvorbis -logg +CODECLIBS+= $(lib_vorbisdec) endif ifeq ($(USE_CODEC_MP3),1) CFLAGS+= -DUSE_CODEC_MP3 CODEC_INC = -I../Windows/codecs/include CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= -l$(MP3LIB) +CODECLIBS+= $(lib_mp3dec) endif CFLAGS+= $(CODEC_INC)