mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-23 20:32:43 +00:00
e8e7ca2dc2
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@636 fc73d0e0-1445-4013-8a0c-d673dee63da5
414 lines
8.9 KiB
Text
414 lines
8.9 KiB
Text
CC=gcc
|
|
|
|
CPUOPTIMIZATIONS=
|
|
|
|
BASE_DIR=.
|
|
|
|
ifeq ($(FTE_TARGET),)
|
|
ifdef windir
|
|
FTE_TARGET=win32
|
|
endif
|
|
|
|
FTE_TARGET ?= sdl
|
|
endif
|
|
|
|
|
|
CLIENT_DIR=$(BASE_DIR)/client
|
|
GL_DIR=$(BASE_DIR)/gl
|
|
SW_DIR=$(BASE_DIR)/sw
|
|
SERVER_DIR=$(BASE_DIR)/server
|
|
COMMON_DIR=$(BASE_DIR)/common
|
|
NQPROT_DIR=$(BASE_DIR)/nqnet
|
|
HTTP_DIR=$(BASE_DIR)/http
|
|
LIBS_DIR=$(BASE_DIR)/libs
|
|
PROGS_DIR=$(BASE_DIR)/qclib
|
|
SNDCODEC_DIR=$(BASE_DIR)/sndcodec
|
|
MP3_DIR=$(BASE_DIR)/../mp3/libmad
|
|
QUX_DIR=$(BASE_DIR)/qux
|
|
|
|
RELEASE_DIR=$(BASE_DIR)/release
|
|
DEBUG_DIR=$(BASE_DIR)/debug
|
|
|
|
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
|
|
ifeq ($(USEASM),true)
|
|
ifdef windir
|
|
DO_AS=$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
|
|
else
|
|
DO_AS=$(CC) $(CFLAGS) -x assembler-with-cpp -DELF -o $@ -c $<
|
|
endif
|
|
endif
|
|
BASELDFLAGS=-lm -lz
|
|
GLXLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lpng -ljpeg -lXxf86vm
|
|
GLSLDFLAGS=-L/usr/X11R6/lib -lMesaGL -lglide -lvga
|
|
XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lpng -ljpeg
|
|
SLDFLAGS=-lvga
|
|
|
|
ifeq ($(USEASM),true)
|
|
COMMON_ASM_OBJS = \
|
|
worlda.o \
|
|
math.o
|
|
|
|
CLIENT_ASM_OBJS = \
|
|
snd_mixa.o
|
|
else
|
|
BASE_ASM_CFLAGS = -DNOASM
|
|
endif
|
|
|
|
BASE_CFLAGS=$(BASE_ASM_CFLAGS) -DQ3SHADERS -Wall -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp -I$(CLIENT_DIR) -I$(SERVER_DIR) -I$(COMMON_DIR) -I$(SW_DIR) -I$(GL_DIR) -I$(PROGS_DIR) -I$(LIBS_DIR) -I$(QUX_DIR) -I$(LIBS_DIR)/dxsdk7/include -I/usr/X11R6/include -I$(LIBS_DIR)/sdl/include -I$(LIBS_DIR)/sdl/include/SDL -D_vsnprintf=vsnprintf -D_snprintf=snprintf
|
|
CLIENT_ONLY_CFLAGS=$(BASE_CFLAGS) -DCLIENTONLY
|
|
SERVER_ONLY_CFLAGS=$(BASE_CFLAGS) -DSERVERONLY
|
|
JOINT_CFLAGS=$(BASE_CFLAGS)
|
|
DEBUG_CFLAGS=-ggdb -g
|
|
RELEASE_CFLAGS=-O6 -s -fno-strict-aliasing -ffast-math -funroll-loops -fexpensive-optimizations $(CPUOPTIMIZATIONS)
|
|
GLCFLAGS=-DGLQUAKE
|
|
SWCFLAGS=-DSWQUAKE
|
|
|
|
NQPROT_OBJS = \
|
|
net_main.o \
|
|
net_loop.o \
|
|
net_dgrm.o \
|
|
net_udp.o \
|
|
net_wipx.o \
|
|
net_vcr.o
|
|
|
|
CLIENT_OBJS = $(CLIENT_ASM_OBJS) \
|
|
textedit.o \
|
|
fragstats.o \
|
|
teamplay.o \
|
|
zqtp.o \
|
|
cl_demo.o \
|
|
cl_ents.o \
|
|
clq2_ents.o \
|
|
cl_input.o \
|
|
cl_main.o \
|
|
cl_parse.o \
|
|
cl_pred.o \
|
|
cl_tent.o \
|
|
cl_cam.o \
|
|
cl_screen.o \
|
|
cl_ui.o \
|
|
qvm.o \
|
|
ircclient.o \
|
|
console.o \
|
|
image.o \
|
|
keys.o \
|
|
menu.o \
|
|
m_master.o \
|
|
m_multi.o \
|
|
m_items.o \
|
|
m_options.o \
|
|
m_single.o \
|
|
m_script.o \
|
|
m_mp3.o \
|
|
roq_read.o \
|
|
clq2_cin.o \
|
|
net_master.o \
|
|
r_bulleten.o \
|
|
r_part.o \
|
|
r_partset.o \
|
|
r_efrag.o \
|
|
renderer.o \
|
|
renderque.o \
|
|
sbar.o \
|
|
skin.o \
|
|
snd_dma.o \
|
|
snd_mem.o \
|
|
snd_mix.o \
|
|
snd_mp3.o \
|
|
snd_ov.o \
|
|
valid.o \
|
|
view.o \
|
|
wad.o \
|
|
\
|
|
pop3noti.o \
|
|
imapnoti.o \
|
|
\
|
|
ftpclient.o \
|
|
httpclient.o \
|
|
\
|
|
\
|
|
m_x.o \
|
|
x_reqs.o \
|
|
x_res.o \
|
|
pr_menu.o \
|
|
|
|
|
|
SOFTWARE_OBJS = \
|
|
sw_screen.o \
|
|
sw_draw.o \
|
|
sw_model.o \
|
|
r_aclip.o \
|
|
r_aclipa.o \
|
|
r_alias.o \
|
|
r_aliasa.o \
|
|
r_bsp.o \
|
|
r_draw.o \
|
|
r_drawa.o \
|
|
r_edge.o \
|
|
r_edgea.o \
|
|
r_light.o \
|
|
r_main.o \
|
|
r_misc.o \
|
|
r_sky.o \
|
|
r_sprite.o \
|
|
r_surf.o \
|
|
r_vars.o \
|
|
r_varsa.o \
|
|
\
|
|
d_draw.o \
|
|
d_draw16.o \
|
|
d_edge.o \
|
|
d_fill.o \
|
|
d_init.o \
|
|
d_modech.o \
|
|
d_part.o \
|
|
d_parta.o \
|
|
d_polyse.o \
|
|
d_polysa.o \
|
|
d_scan.o \
|
|
d_scana.o \
|
|
d_sky.o \
|
|
d_spr8.o \
|
|
d_sprite.o \
|
|
d_surf.o \
|
|
d_trans.o \
|
|
d_vars.o \
|
|
d_varsa.o \
|
|
d_zpoint.o \
|
|
\
|
|
nonintel.o \
|
|
surf16.o \
|
|
surf8.o
|
|
|
|
GLQUAKE_OBJS = \
|
|
gl_alias.o \
|
|
gl_draw.o \
|
|
gl_model.o \
|
|
gl_ngraph.o \
|
|
gl_rlight.o \
|
|
gl_rmain.o \
|
|
gl_rmisc.o \
|
|
gl_rsurf.o \
|
|
ltface.o \
|
|
gl_screen.o \
|
|
gl_backend.o \
|
|
gl_shader.o \
|
|
gl_warp.o \
|
|
gl_ppl.o \
|
|
gl_vidcommon.o \
|
|
gl_hlmdl.o
|
|
|
|
MP3_OBJS = \
|
|
fixed.o \
|
|
bit.o \
|
|
timer.o \
|
|
stream.o \
|
|
frame.o \
|
|
synth.o \
|
|
decoder.o \
|
|
layer12.o \
|
|
layer3.o \
|
|
huffman.o \
|
|
mymad.o
|
|
|
|
PROGS_OBJS = \
|
|
comprout.o \
|
|
hash.o \
|
|
initlib.o \
|
|
pr_edict.o \
|
|
pr_exec.o \
|
|
pr_multi.o \
|
|
qcc_cmdlib.o \
|
|
qccmain.o \
|
|
qcc_pr_comp.o \
|
|
qcc_pr_lex.o \
|
|
qcdecomp.o \
|
|
qcd_main.o
|
|
|
|
SERVER_OBJS = \
|
|
pr_cmds.o \
|
|
sv_master.o \
|
|
sv_init.o \
|
|
sv_main.o \
|
|
sv_nchan.o \
|
|
sv_ents.o \
|
|
sv_send.o \
|
|
sv_move.o \
|
|
sv_phys.o \
|
|
sv_user.o \
|
|
sv_mvd.o \
|
|
sv_ccmds.o \
|
|
sv_rankin.o \
|
|
sv_chat.o \
|
|
sv_demo.o \
|
|
world.o \
|
|
net_preparse.o \
|
|
savegame.o \
|
|
svq2_ents.o \
|
|
svq2_game.o \
|
|
snd_vc.o \
|
|
snd_voicecodecs.o \
|
|
g711.o \
|
|
g721.o \
|
|
g723_24.o \
|
|
g723_40.o \
|
|
g72x.o \
|
|
webgen.o \
|
|
ftpserver.o \
|
|
httpserver.o \
|
|
sv_pop3.o \
|
|
sv_smtp.o
|
|
|
|
SERVERONLY_OBJS = \
|
|
svmodel.o \
|
|
sv_sys_unix.o
|
|
|
|
COMMON_OBJS = $(COMMON_ASM_OBJS) \
|
|
common.o \
|
|
cvar.o \
|
|
cmd.o \
|
|
crc.o \
|
|
mathlib.o \
|
|
huff.o \
|
|
md4.o \
|
|
md5.o \
|
|
net_chan.o \
|
|
net_wins.o \
|
|
zone.o \
|
|
gl_q2bsp.o \
|
|
glmod_doom.o \
|
|
pmove.o \
|
|
pmovetst.o \
|
|
iwebiface.o \
|
|
translate.o \
|
|
plugin.o \
|
|
q1bsp.o \
|
|
q2pmove.o
|
|
|
|
ifeq ($(FTE_TARGET), win32)
|
|
GLCL_OBJS=$(GL_OBJS) $(GLQUAKE_OBJS) gl_vidnt.o snd_win.o cd_win.o in_win.o sys_win.o sys_dosa.o
|
|
GL_EXE_NAME=../fteglqw.exe
|
|
GLCL_EXE_NAME=../fteglqwcl.exe
|
|
GL_LDFLAGS=$(GLLDFLAGS) -ldxguid -lwsock32 -lwinmm -lgdi32 -lole32
|
|
GL_CFLAGS=$(GLCFLAGS)
|
|
GLB_DIR=gl_mgw
|
|
GLCL_DIR=glcl_mgw
|
|
else
|
|
GLCL_OBJS=$(GL_OBJS) $(GLQUAKE_OBJS) gl_vidsdl.o snd_sdl.o cd_sdl.o sys_sdl.o
|
|
GL_EXE_NAME=../fteqw_sdl.gl
|
|
GLCL_EXE_NAME=../fteqwcl_sdl.gl
|
|
ifdef windir
|
|
GL_LDFLAGS=$(GLLDFLAGS) -lmingw32 -lwsock32 -lSDLmain -lSDL
|
|
else
|
|
#pthread is needed because of SDL.
|
|
GL_LDFLAGS=$(GLLDFLAGS) -lSDLmain -lSDL -lpng -ljpeg -lpthread
|
|
endif
|
|
GL_CFLAGS=$(GLCFLAGS)
|
|
GLB_DIR=gl_sdl
|
|
GLCL_DIR=glcl_sdl
|
|
endif
|
|
|
|
all: help
|
|
|
|
VPATH = $(BASE_DIR) : $(CLIENT_DIR) : $(GL_DIR) : $(COMMON_DIR) : ($SW_DIR) : $(SERVER_DIR) : $(NQPROT_DIR) : $(HTTP_DIR) : $(BASE_DIR)/irc : $(BASE_DIR)/email : $(QUX_DIR) : $(PROGS_DIR) : $(SNDCODEC_DIR)
|
|
|
|
#NQPROT_DIR=$(BASE_DIR)/nqnet
|
|
#HTTP_DIR=$(BASE_DIR)/http
|
|
#LIBS_DIR=$(BASE_DIR)/libs
|
|
#PROGS_DIR=$(BASE_DIR)/qclib
|
|
#SNDCODEC_DIR=$(BASE_DIR)/sndcodec
|
|
#DEBUG_DIR=$(BASE_DIR)/debug
|
|
#MP3_DIR=$(BASE_DIR)/../mp3/libmad
|
|
#RELEASE_DIR=$(BASE_DIR)/release
|
|
#QUX_DIR=$(BASE_DIR)/qux
|
|
|
|
$(OUT_DIR)/%.o : %.c
|
|
$(DO_CC)
|
|
|
|
ifeq ($(USEASM),true)
|
|
$(OUT_DIR)/%.o : %.s
|
|
$(DO_AS)
|
|
endif
|
|
|
|
|
|
$(OUT_DIR)/$(EXE_NAME): $(addprefix $(OUT_DIR)/, $(OBJS))
|
|
$(CC) $(CFLAGS) -o $@ $(addprefix $(OUT_DIR)/, $(OBJS)) $(LDFLAGS)
|
|
|
|
_out-rel:
|
|
$(MAKE) -f Makefile.SDL $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS)" OBJS="$(OBJS)"
|
|
strip --strip-all $(OUT_DIR)/$(EXE_NAME)
|
|
|
|
_out-dbg:
|
|
$(MAKE) -f Makefile.SDL $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS)" OBJS="$(OBJS)"
|
|
|
|
_cl-rel:
|
|
$(MAKE) -f Makefile.SDL _out-rel EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" CFLAGS="$(CLIENT_ONLY_CFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" OBJS="$(OBJS) $(COMMON_OBJS) $(NQPROT_OBJS) $(CLIENT_OBJS) $(PROGS_OBJS)"
|
|
|
|
_cl-dbg:
|
|
$(MAKE) -f Makefile.SDL _out-dbg EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" CFLAGS="$(CLIENT_ONLY_CFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" OBJS="$(OBJS) $(COMMON_OBJS) $(NQPROT_OBJS) $(CLIENT_OBJS) $(PROGS_OBJS)"
|
|
|
|
_clsv-rel: reldir
|
|
$(MAKE) -f Makefile.SDL _out-rel EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" CFLAGS="$(JOINT_CFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" OBJS="$(OBJS) $(COMMON_OBJS) $(NQPROT_OBJS) $(CLIENT_OBJS) $(PROGS_OBJS) $(SERVER_OBJS)"
|
|
|
|
_clsv-dbg: debugdir
|
|
$(MAKE) -f Makefile.SDL _out-dbg EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" CFLAGS="$(JOINT_CFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" OBJS="$(OBJS) $(COMMON_OBJS) $(NQPROT_OBJS) $(CLIENT_OBJS) $(PROGS_OBJS) $(SERVER_OBJS)"
|
|
|
|
|
|
SV_OBJS=$(COMMON_OBJS) $(NQPROT_OBJS) $(SERVER_OBJS) $(PROGS_OBJS) $(SERVERONLY_OBJS)
|
|
SV_EXE_NAME=fteqwsv
|
|
SV_LDFLAGS=
|
|
SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
|
|
SV_DIR=server
|
|
sv-tmp:
|
|
$(MAKE) -f Makefile.SDL $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(SV_EXE_NAME)" CFLAGS="$(SV_CFLAGS)" LDFLAGS="$(SV_LDFLAGS)" OBJS="$(SV_OBJS)"
|
|
sv-rel:
|
|
$(MAKE) -f Makefile.SDL sv-tmp TYPE=_out-rel OUT_DIR="$(RELEASE_DIR)/$(SV_DIR)"
|
|
sv-dbg:
|
|
$(MAKE) -f Makefile.SDL sv-tmp TYPE=_out-dbg OUT_DIR="$(DEBUG_DIR)/$(SV_DIR)"
|
|
|
|
|
|
|
|
|
|
|
|
glcl-tmp:
|
|
$(MAKE) -f Makefile.SDL $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(GLCL_EXE_NAME)" CFLAGS="$(GL_CFLAGS)" LDFLAGS="$(GL_LDFLAGS)" OBJS="$(GLCL_OBJS)"
|
|
gl-tmp:
|
|
$(MAKE) -f Makefile.SDL $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(GL_EXE_NAME)" CFLAGS="$(GL_CFLAGS)" LDFLAGS="$(GL_LDFLAGS)" OBJS="$(GLCL_OBJS)"
|
|
|
|
glcl-rel:
|
|
$(MAKE) -f Makefile.SDL glcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(GLCL_DIR)"
|
|
glcl-dbg:
|
|
$(MAKE) -f Makefile.SDL glcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(GLCL_DIR)"
|
|
gl-rel:
|
|
$(MAKE) -f Makefile.SDL gl-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(GLB_DIR)"
|
|
gl-dbg:
|
|
$(MAKE) -f Makefile.SDL gl-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(GLB_DIR)"
|
|
|
|
ifdef windir
|
|
debugdir:
|
|
@-mkdir $(subst /,\, $(OUT_DIR))
|
|
reldir:
|
|
@-mkdir $(subst /,\, $(OUT_DIR))
|
|
else
|
|
reldir:
|
|
@-mkdir $(RELEASE_DIR)
|
|
@-mkdir $(OUT_DIR)
|
|
debugdir:
|
|
@-mkdir $(DEBUG_DIR)
|
|
@-mkdir $(OUT_DIR)
|
|
endif
|
|
|
|
help:
|
|
@-echo "Specfic targets:"
|
|
@-echo "clean - removes all output (use make dirs afterwards)"
|
|
@-echo "all - make all the targets possible"
|
|
@-echo ""
|
|
@-echo "Normal targets:"
|
|
@-echo "(each of these targets must have the postfix -rel or -dbg)"
|
|
@-echo "sv"
|
|
@-echo "gl"
|
|
|
|
clean:
|
|
-rm -f -r $(RELEASE_DIR)
|
|
-rm -f -r $(DEBUG_DIR)
|
|
|