updated makefiles.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@483 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-08-27 07:11:36 +00:00
parent 6e1c84770d
commit f43a0622f6
4 changed files with 128 additions and 60 deletions

View File

@ -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. # You need the SDL library fully installed.
# "make DEBUG=1" to build a debug client. # "make DEBUG=1" to build a debug client.
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. # "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
# "make SDLNET=1" to use SDL_net (not recommended) # "make SDLNET=1" to use SDL_net (NOT recommended) instead of platform
# instead of platform specific code. # specific code.
# Build objects are separate from those of codeblocks
### Embed custom Quakespasm console background picture ### Embed custom Quakespasm console background picture
USE_QS_CONBACK=1 USE_QS_CONBACK=1
### Enable/Disable codecs for streaming music support ### 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_WAVE=1
USE_CODEC_MP3=1 USE_CODEC_MP3=1
USE_CODEC_VORBIS=1 USE_CODEC_VORBIS=1
# which library to use for mp3 decoding: mad or mpg123 # which library to use for mp3 decoding: mad or mpg123
MP3LIB=mad MP3LIB=mad
# which library to use for ogg decoding: vorbis or tremor
VORBISLIB=vorbis
# ============================================================================ # ============================================================================
# Helper functions # Helper functions
@ -114,7 +111,7 @@ SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
SDL_LFLAGS := $(shell $(SDL_CONFIG) --libs) SDL_LFLAGS := $(shell $(SDL_CONFIG) --libs)
ifeq ($(SDLNET),1) ifeq ($(SDLNET),1)
NET_LIBS := SDL_net NET_LIBS :=-lSDL_net
CFLAGS +=-D_USE_SDLNET CFLAGS +=-D_USE_SDLNET
else else
NET_LIBS := NET_LIBS :=
@ -124,15 +121,31 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK CFLAGS+= -DUSE_QS_CONBACK
endif 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) ifeq ($(MP3LIB),mad)
mp3_obj=snd_mp3.o mp3_obj=snd_mp3.o
else lib_mp3dec=-lmad
endif
ifeq ($(MP3LIB),mpg123) ifeq ($(MP3LIB),mpg123)
mp3_obj=snd_mpg123.o mp3_obj=snd_mpg123.o
else lib_mp3dec=-lmpg123
USE_CODEC_MP3=no
mp3_obj=snd_mp3.o
endif 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 endif
CODECLIBS := CODECLIBS :=
@ -140,17 +153,17 @@ ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE CFLAGS+= -DUSE_CODEC_WAVE
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
CODECLIBS+= vorbisfile vorbis ogg CODECLIBS+= $(lib_vorbisdec)
endif endif
ifeq ($(USE_CODEC_MP3),1) ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3 CFLAGS+= -DUSE_CODEC_MP3
CODECLIBS+= $(MP3LIB) CODECLIBS+= $(lib_mp3dec)
endif endif
COMMON_LIBS:= m GL COMMON_LIBS:= -lm -lGL
LIBS := $(patsubst %,-l%,$(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)) LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
# --------------------------- # ---------------------------
# targets # targets

View File

@ -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), # 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 # 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 # Or copy ./MacOSX/*dylib to /usr/local/lib and use
# DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib ./quakespasm # 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_WAVE=1
USE_CODEC_MP3=1 USE_CODEC_MP3=1
USE_CODEC_VORBIS=1 USE_CODEC_VORBIS=1
# which library to use for mp3 decoding: mad or mpg123
MP3LIB=mpg123 MP3LIB=mpg123
# which library to use for ogg decoding: vorbis or tremor
# You need the SDL library fully installed. VORBISLIB=vorbis
# "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
# ============================================================================ # ============================================================================
# Helper functions # Helper functions
@ -139,15 +143,31 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK CFLAGS+= -DUSE_QS_CONBACK
endif 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) ifeq ($(MP3LIB),mad)
mp3_obj=snd_mp3.o mp3_obj=snd_mp3.o
else lib_mp3dec=-lmad
endif
ifeq ($(MP3LIB),mpg123) ifeq ($(MP3LIB),mpg123)
mp3_obj=snd_mpg123.o mp3_obj=snd_mpg123.o
else lib_mp3dec=-lmpg123
USE_CODEC_MP3=no
mp3_obj=snd_mp3.o
endif 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 endif
# FIXME: The codec libs stuff are copied over from the unix makefile # 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 CFLAGS+= -DUSE_CODEC_WAVE
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
CODECLIBS+= -lvorbisfile -lvorbis -logg CODECLIBS+= $(lib_vorbisdec)
endif endif
ifeq ($(USE_CODEC_MP3),1) ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3 CFLAGS+= -DUSE_CODEC_MP3
CODECLIBS+= -l$(MP3LIB) CODECLIBS+= $(lib_mp3dec)
endif 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 # targets

View File

@ -1,9 +1,9 @@
# GNU Makefile for cross-compiling quakespasm.exe (Win32 : MinGW) # 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 DEBUG=1" to build a debug client.
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. # "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 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. # specific code.
### Embed custom Quakespasm console background picture ### Embed custom Quakespasm console background picture
@ -16,6 +16,8 @@ USE_CODEC_VORBIS=1
# which library to use for mp3 decoding: mad or mpg123 # which library to use for mp3 decoding: mad or mpg123
MP3LIB=mad MP3LIB=mad
# which library to use for ogg decoding: vorbis or tremor
VORBISLIB=vorbis
# ============================================================================ # ============================================================================
# Helper functions # Helper functions
@ -96,15 +98,31 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK CFLAGS+= -DUSE_QS_CONBACK
endif 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) ifeq ($(MP3LIB),mad)
mp3_obj=snd_mp3.o mp3_obj=snd_mp3.o
else lib_mp3dec=-lmad
endif
ifeq ($(MP3LIB),mpg123) ifeq ($(MP3LIB),mpg123)
mp3_obj=snd_mpg123.o mp3_obj=snd_mpg123.o
else lib_mp3dec=-lmpg123
USE_CODEC_MP3=no
mp3_obj=snd_mp3.o
endif 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 endif
CODECLIBS := CODECLIBS :=
@ -114,16 +132,16 @@ CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86 CODEC_LINK= -L../Windows/codecs/x86
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
CODEC_INC = -I../Windows/codecs/include CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86 CODEC_LINK= -L../Windows/codecs/x86
CODECLIBS+= -lvorbisfile -lvorbis -logg CODECLIBS+= $(lib_vorbisdec)
endif endif
ifeq ($(USE_CODEC_MP3),1) ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3 CFLAGS+= -DUSE_CODEC_MP3
CODEC_INC = -I../Windows/codecs/include CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86 CODEC_LINK= -L../Windows/codecs/x86
CODECLIBS+= -l$(MP3LIB) CODECLIBS+= $(lib_mp3dec)
endif endif
CFLAGS+= $(CODEC_INC) CFLAGS+= $(CODEC_INC)

View File

@ -1,9 +1,9 @@
# GNU Makefile for cross-compiling quakespasm.exe (Win64 : MinGW-w64) # 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 DEBUG=1" to build a debug client.
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. # "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 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 SDLNET=1" to use SDL_net (NOT recommended) instead of platform
# specific code. # specific code.
### Embed custom Quakespasm console background picture ### Embed custom Quakespasm console background picture
@ -16,6 +16,8 @@ USE_CODEC_VORBIS=1
# which library to use for mp3 decoding: mad or mpg123 # which library to use for mp3 decoding: mad or mpg123
MP3LIB=mad MP3LIB=mad
# which library to use for ogg decoding: vorbis or tremor
VORBISLIB=vorbis
# ============================================================================ # ============================================================================
# Helper functions # Helper functions
@ -96,15 +98,31 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK CFLAGS+= -DUSE_QS_CONBACK
endif 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) ifeq ($(MP3LIB),mad)
mp3_obj=snd_mp3.o mp3_obj=snd_mp3.o
else lib_mp3dec=-lmad
endif
ifeq ($(MP3LIB),mpg123) ifeq ($(MP3LIB),mpg123)
mp3_obj=snd_mpg123.o mp3_obj=snd_mpg123.o
else lib_mp3dec=-lmpg123
USE_CODEC_MP3=no
mp3_obj=snd_mp3.o
endif 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 endif
CODECLIBS := CODECLIBS :=
@ -114,16 +132,16 @@ CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64 CODEC_LINK= -L../Windows/codecs/x64
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
CODEC_INC = -I../Windows/codecs/include CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64 CODEC_LINK= -L../Windows/codecs/x64
CODECLIBS+= -lvorbisfile -lvorbis -logg CODECLIBS+= $(lib_vorbisdec)
endif endif
ifeq ($(USE_CODEC_MP3),1) ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3 CFLAGS+= -DUSE_CODEC_MP3
CODEC_INC = -I../Windows/codecs/include CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64 CODEC_LINK= -L../Windows/codecs/x64
CODECLIBS+= -l$(MP3LIB) CODECLIBS+= $(lib_mp3dec)
endif endif
CFLAGS+= $(CODEC_INC) CFLAGS+= $(CODEC_INC)