2012-10-25 11:15:15 +00:00
|
|
|
# GNU Makefile for QuakeSpasm unix targets, Oct. 25, 2012
|
2010-09-01 06:10:21 +00:00
|
|
|
# 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.
|
2011-08-27 07:11:36 +00:00
|
|
|
# "make SDLNET=1" to use SDL_net (NOT recommended) instead of platform
|
|
|
|
# specific code.
|
2011-01-10 03:09:09 +00:00
|
|
|
|
2011-01-12 09:32:22 +00:00
|
|
|
### Embed custom Quakespasm console background picture
|
|
|
|
USE_QS_CONBACK=1
|
|
|
|
|
2011-01-10 03:09:09 +00:00
|
|
|
### Enable/Disable codecs for streaming music support
|
2011-01-12 09:32:22 +00:00
|
|
|
USE_CODEC_WAVE=1
|
|
|
|
USE_CODEC_MP3=1
|
|
|
|
USE_CODEC_VORBIS=1
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2011-02-14 20:02:52 +00:00
|
|
|
# which library to use for mp3 decoding: mad or mpg123
|
|
|
|
MP3LIB=mad
|
2011-08-27 07:11:36 +00:00
|
|
|
# which library to use for ogg decoding: vorbis or tremor
|
|
|
|
VORBISLIB=vorbis
|
2011-02-14 20:02:52 +00:00
|
|
|
|
2012-10-25 11:15:15 +00:00
|
|
|
# ---------------------------
|
2010-02-16 08:16:43 +00:00
|
|
|
# Helper functions
|
2012-10-25 11:15:15 +00:00
|
|
|
# ---------------------------
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2012-10-25 11:15:15 +00:00
|
|
|
check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2012-10-25 11:15:15 +00:00
|
|
|
# ---------------------------
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
|
2012-05-30 09:28:34 +00:00
|
|
|
HOST_OS := $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]')
|
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
|
|
|
|
2012-05-30 09:28:34 +00:00
|
|
|
DEBUG ?= 0
|
|
|
|
SDLNET ?= 0
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2012-10-25 11:15:15 +00:00
|
|
|
# ---------------------------
|
2012-03-09 10:11:09 +00:00
|
|
|
# build variables
|
2012-10-25 11:15:15 +00:00
|
|
|
# ---------------------------
|
2010-02-16 08:16:43 +00:00
|
|
|
|
|
|
|
CC ?= gcc
|
2012-05-30 09:47:45 +00:00
|
|
|
LINKER = $(CC)
|
|
|
|
|
2012-09-02 14:00:34 +00:00
|
|
|
STRIP ?= strip
|
|
|
|
|
2010-02-17 15:25:25 +00:00
|
|
|
#CPUFLAGS= -mtune=i686
|
|
|
|
#CPUFLAGS= -march=pentium4
|
|
|
|
#CPUFLAGS= -mtune=k8
|
|
|
|
#CPUFLAGS= -march=atom
|
2012-09-05 09:03:41 +00:00
|
|
|
CPUFLAGS=
|
|
|
|
LDFLAGS =
|
2010-02-16 08:16:43 +00:00
|
|
|
DFLAGS ?=
|
|
|
|
CFLAGS ?= -Wall -Wno-trigraphs
|
2010-02-17 15:25:25 +00:00
|
|
|
CFLAGS += $(CPUFLAGS)
|
2010-02-16 08:16:43 +00:00
|
|
|
|
|
|
|
ifneq ($(DEBUG),0)
|
|
|
|
DFLAGS += -DDEBUG
|
|
|
|
CFLAGS += -g
|
2010-04-24 14:50:18 +00:00
|
|
|
do_strip=
|
2010-02-16 08:16:43 +00:00
|
|
|
else
|
|
|
|
DFLAGS += -DNDEBUG
|
|
|
|
CFLAGS += -O2
|
|
|
|
CFLAGS += $(call check_gcc,-fweb,)
|
|
|
|
CFLAGS += $(call check_gcc,-frename-registers,)
|
2010-04-24 14:50:18 +00:00
|
|
|
cmd_strip=$(STRIP) $(1)
|
|
|
|
define do_strip
|
|
|
|
$(call cmd_strip,$(1));
|
|
|
|
endef
|
2010-02-16 08:16:43 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
### X11BASE only gets used if its in an unusual place
|
|
|
|
|
|
|
|
X11DIRS := /usr/X11R7 /usr/local/X11R7 /usr/X11R6 /usr/local/X11R6
|
|
|
|
X11BASE_GUESS := $(shell \
|
|
|
|
if [ -e /usr/include/X11/Xlib.h ] && \
|
|
|
|
[ -e /usr/lib/libX11.a ]; then exit 0; fi; \
|
|
|
|
if [ -e /usr/local/include/X11/Xlib.h ] && \
|
|
|
|
[ -e /usr/local/lib/libX11.a ]; then exit 0; fi; \
|
|
|
|
for DIR in $(X11DIRS); do \
|
|
|
|
if [ -e $$DIR/include/X11/Xlib.h ] && \
|
|
|
|
[ -e $$DIR/lib/libX11.a ]; then echo $$DIR; break; fi; \
|
|
|
|
done )
|
|
|
|
|
|
|
|
X11BASE ?= $(X11BASE_GUESS)
|
|
|
|
|
|
|
|
ifneq ($(X11BASE),)
|
2012-09-05 16:24:57 +00:00
|
|
|
LDFLAGS+= -L$(X11BASE)/lib
|
|
|
|
CFLAGS += -I$(X11BASE)/include
|
2010-02-16 08:16:43 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
SDL_CONFIG ?= sdl-config
|
|
|
|
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
2011-12-27 10:10:51 +00:00
|
|
|
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
2010-02-16 08:16:43 +00:00
|
|
|
|
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
|
|
|
ifeq ($(SDLNET),1)
|
2011-08-27 07:11:36 +00:00
|
|
|
NET_LIBS :=-lSDL_net
|
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
|
|
|
CFLAGS +=-D_USE_SDLNET
|
|
|
|
else
|
2012-05-30 09:28:34 +00:00
|
|
|
ifeq ($(HOST_OS),sunos)
|
|
|
|
NET_LIBS :=-lsocket -lnsl -lresolv
|
|
|
|
else
|
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
|
|
|
NET_LIBS :=
|
|
|
|
endif
|
2012-05-30 09:28:34 +00:00
|
|
|
endif
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2011-01-12 09:32:22 +00:00
|
|
|
ifeq ($(USE_QS_CONBACK),1)
|
|
|
|
CFLAGS+= -DUSE_QS_CONBACK
|
|
|
|
endif
|
|
|
|
|
2011-08-27 07:11:36 +00:00
|
|
|
ifneq ($(VORBISLIB),vorbis)
|
|
|
|
ifneq ($(VORBISLIB),tremor)
|
|
|
|
$(error Invalid VORBISLIB setting)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifneq ($(MP3LIB),mpg123)
|
|
|
|
ifneq ($(MP3LIB),mad)
|
|
|
|
$(error Invalid MP3LIB setting)
|
|
|
|
endif
|
|
|
|
endif
|
2011-02-14 20:02:52 +00:00
|
|
|
ifeq ($(MP3LIB),mad)
|
|
|
|
mp3_obj=snd_mp3.o
|
2011-08-27 07:11:36 +00:00
|
|
|
lib_mp3dec=-lmad
|
|
|
|
endif
|
2011-02-14 20:02:52 +00:00
|
|
|
ifeq ($(MP3LIB),mpg123)
|
|
|
|
mp3_obj=snd_mpg123.o
|
2011-08-27 07:11:36 +00:00
|
|
|
lib_mp3dec=-lmpg123
|
|
|
|
endif
|
|
|
|
ifeq ($(VORBISLIB),vorbis)
|
|
|
|
cpp_vorbisdec=
|
|
|
|
lib_vorbisdec=-lvorbisfile -lvorbis -logg
|
2011-02-14 20:02:52 +00:00
|
|
|
endif
|
2011-08-27 07:11:36 +00:00
|
|
|
ifeq ($(VORBISLIB),tremor)
|
|
|
|
cpp_vorbisdec=-DVORBIS_USE_TREMOR
|
|
|
|
lib_vorbisdec=-lvorbisidec -logg
|
2011-02-14 20:02:52 +00:00
|
|
|
endif
|
|
|
|
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
CODECLIBS :=
|
2011-01-12 09:32:22 +00:00
|
|
|
ifeq ($(USE_CODEC_WAVE),1)
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
CFLAGS+= -DUSE_CODEC_WAVE
|
|
|
|
endif
|
2011-01-12 09:32:22 +00:00
|
|
|
ifeq ($(USE_CODEC_VORBIS),1)
|
2011-08-27 07:11:36 +00:00
|
|
|
CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
|
|
|
|
CODECLIBS+= $(lib_vorbisdec)
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
endif
|
2011-01-12 09:32:22 +00:00
|
|
|
ifeq ($(USE_CODEC_MP3),1)
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
CFLAGS+= -DUSE_CODEC_MP3
|
2011-08-27 07:11:36 +00:00
|
|
|
CODECLIBS+= $(lib_mp3dec)
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
endif
|
|
|
|
|
2011-08-27 07:11:36 +00:00
|
|
|
COMMON_LIBS:= -lm -lGL
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2011-08-27 07:11:36 +00:00
|
|
|
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
|
2010-02-16 08:16:43 +00:00
|
|
|
|
|
|
|
# ---------------------------
|
|
|
|
# targets
|
|
|
|
# ---------------------------
|
|
|
|
|
|
|
|
.PHONY: clean debug release
|
|
|
|
|
2010-02-18 12:14:51 +00:00
|
|
|
DEFAULT_TARGET := quakespasm
|
2010-02-16 08:16:43 +00:00
|
|
|
|
|
|
|
# ---------------------------
|
|
|
|
# rules
|
|
|
|
# ---------------------------
|
|
|
|
|
|
|
|
%.o: %.c
|
2012-09-05 16:24:57 +00:00
|
|
|
$(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $^
|
2010-02-16 08:16:43 +00:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
2010-02-18 12:14:51 +00:00
|
|
|
# objects
|
2010-02-16 08:16:43 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
MUSIC_OBJS:= bgmusic.o \
|
|
|
|
snd_codec.o \
|
|
|
|
snd_wave.o \
|
|
|
|
snd_vorbis.o \
|
2011-02-14 20:02:52 +00:00
|
|
|
$(mp3_obj)
|
Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
music as raw samples. Adapted from quake2 and ioquake3 with changes.
Individual codecs are responsible for handling any necessary byte swap
operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
codecs.
- Windows makefiles and project files as well as other CodeBlocks project
files will be updated shortly.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
|
|
|
COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS)
|
2010-04-24 15:55:02 +00:00
|
|
|
SYSOBJ_SND := snd_sdl.o
|
|
|
|
SYSOBJ_CDA := cd_sdl.o
|
|
|
|
SYSOBJ_INPUT := in_sdl.o
|
|
|
|
SYSOBJ_GL_VID:= gl_vidsdl.o
|
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
|
|
|
ifeq ($(SDLNET),1)
|
2010-04-24 15:55:02 +00:00
|
|
|
SYSOBJ_NET := net_sdl.o net_sdlnet.o
|
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
|
|
|
else
|
|
|
|
SYSOBJ_NET := net_bsd.o net_udp.o
|
|
|
|
endif
|
2010-06-22 11:01:24 +00:00
|
|
|
SYSOBJ_SYS := pl_linux.o sys_sdl_unix.o
|
2010-04-24 15:55:02 +00:00
|
|
|
SYSOBJ_MAIN:= main_sdl.o
|
|
|
|
SYSOBJ_RES :=
|
|
|
|
|
|
|
|
GLOBJS = \
|
|
|
|
gl_refrag.o \
|
|
|
|
gl_rlight.o \
|
|
|
|
gl_rmain.o \
|
|
|
|
gl_fog.o \
|
|
|
|
gl_rmisc.o \
|
|
|
|
r_part.o \
|
|
|
|
r_world.o \
|
|
|
|
gl_screen.o \
|
|
|
|
gl_sky.o \
|
|
|
|
gl_warp.o \
|
|
|
|
$(SYSOBJ_GL_VID) \
|
|
|
|
gl_draw.o \
|
|
|
|
image.o \
|
|
|
|
gl_texmgr.o \
|
|
|
|
gl_mesh.o \
|
|
|
|
r_sprite.o \
|
|
|
|
r_alias.o \
|
|
|
|
r_brush.o \
|
|
|
|
gl_model.o
|
|
|
|
|
2011-12-27 11:11:24 +00:00
|
|
|
OBJS := strlcat.o \
|
|
|
|
strlcpy.o \
|
2010-04-24 15:55:02 +00:00
|
|
|
$(GLOBJS) \
|
|
|
|
$(SYSOBJ_INPUT) \
|
|
|
|
$(COMOBJ_SND) \
|
|
|
|
$(SYSOBJ_SND) \
|
|
|
|
$(SYSOBJ_CDA) \
|
|
|
|
$(SYSOBJ_NET) \
|
|
|
|
net_dgrm.o \
|
|
|
|
net_loop.o \
|
|
|
|
net_main.o \
|
|
|
|
chase.o \
|
|
|
|
cl_demo.o \
|
|
|
|
cl_input.o \
|
|
|
|
cl_main.o \
|
|
|
|
cl_parse.o \
|
|
|
|
cl_tent.o \
|
|
|
|
console.o \
|
|
|
|
keys.o \
|
|
|
|
menu.o \
|
|
|
|
sbar.o \
|
|
|
|
view.o \
|
|
|
|
wad.o \
|
|
|
|
cmd.o \
|
|
|
|
common.o \
|
|
|
|
crc.o \
|
|
|
|
cvar.o \
|
2011-12-20 09:22:19 +00:00
|
|
|
cfgfile.o \
|
2010-04-24 15:55:02 +00:00
|
|
|
host.o \
|
|
|
|
host_cmd.o \
|
|
|
|
mathlib.o \
|
|
|
|
pr_cmds.o \
|
|
|
|
pr_edict.o \
|
|
|
|
pr_exec.o \
|
|
|
|
sv_main.o \
|
|
|
|
sv_move.o \
|
|
|
|
sv_phys.o \
|
|
|
|
sv_user.o \
|
|
|
|
world.o \
|
|
|
|
conback.o \
|
|
|
|
zone.o \
|
|
|
|
$(SYSOBJ_SYS) $(SYSOBJ_MAIN) $(SYSOBJ_RES)
|
2010-02-16 08:16:43 +00:00
|
|
|
|
|
|
|
# ------------------------
|
2012-03-09 10:11:09 +00:00
|
|
|
# Linux build rules
|
2010-02-16 08:16:43 +00:00
|
|
|
# ------------------------
|
|
|
|
|
2010-02-18 12:14:51 +00:00
|
|
|
quakespasm: $(OBJS)
|
2012-09-05 16:24:57 +00:00
|
|
|
$(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
|
2010-04-24 14:50:18 +00:00
|
|
|
$(call do_strip,$@)
|
2010-02-16 08:16:43 +00:00
|
|
|
|
2010-02-18 12:14:51 +00:00
|
|
|
release: quakespasm
|
2010-02-16 08:16:43 +00:00
|
|
|
debug:
|
|
|
|
$(error Use "make DEBUG=1")
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print)
|
|
|
|
|