summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2016-04-09 17:57:28 +0100
committerTim Angus <tim@ngus.net>2016-04-09 17:57:28 +0100
commitf45fbef604e05144057dec8d1dbfc5d4f5a2a822 (patch)
tree152d2a428b078f7a89756ea9e156695fc69f1686 /Makefile
parent7f9e97d611b4b267d9dd913144cb9632f96c90c2 (diff)
parent87abdd914988724e164ffb16380ad26be8420b84 (diff)
Merge branch 'master' into gpp
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile142
1 files changed, 43 insertions, 99 deletions
diff --git a/Makefile b/Makefile
index 2112370e..9ab4227a 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
-COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/)
+COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/ | sed -e 's/^arm.*/arm/')
ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
@@ -55,6 +55,13 @@ PLATFORM=$(COMPILE_PLATFORM)
endif
export PLATFORM
+ifeq ($(PLATFORM),mingw32)
+ MINGW=1
+endif
+ifeq ($(PLATFORM),mingw64)
+ MINGW=1
+endif
+
ifeq ($(COMPILE_ARCH),i86pc)
COMPILE_ARCH=x86
endif
@@ -150,7 +157,7 @@ USE_CURL=1
endif
ifndef USE_CURL_DLOPEN
- ifeq ($(PLATFORM),mingw32)
+ ifdef MINGW
USE_CURL_DLOPEN=0
else
USE_CURL_DLOPEN=1
@@ -181,10 +188,6 @@ ifndef USE_INTERNAL_LIBS
USE_INTERNAL_LIBS=1
endif
-ifndef USE_INTERNAL_SPEEX
-USE_INTERNAL_SPEEX=$(USE_INTERNAL_LIBS)
-endif
-
ifndef USE_INTERNAL_OGG
USE_INTERNAL_OGG=$(USE_INTERNAL_LIBS)
endif
@@ -239,7 +242,6 @@ CGDIR=$(MOUNT_DIR)/cgame
NDIR=$(MOUNT_DIR)/null
UIDIR=$(MOUNT_DIR)/ui
JPDIR=$(MOUNT_DIR)/jpeg-8c
-SPEEXDIR=$(MOUNT_DIR)/libspeex
OGGDIR=$(MOUNT_DIR)/libogg-1.3.1
VORBISDIR=$(MOUNT_DIR)/libvorbis-1.3.4
OPUSDIR=$(MOUNT_DIR)/opus-1.1
@@ -297,30 +299,18 @@ endif
# SETUP AND BUILD -- LINUX
#############################################################################
-## Defaults
-LIB=lib
-
INSTALL=install
MKDIR=mkdir
EXTRA_FILES=
CLIENT_EXTRA_FILES=
-ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
-
- ifeq ($(ARCH),x86_64)
- LIB=lib64
- else
- ifeq ($(ARCH),ppc64)
- LIB=lib64
- else
- ifeq ($(ARCH),s390x)
- LIB=lib64
- endif
- endif
- endif
+ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu"))
+ TOOLS_CFLAGS += -DARCH_STRING=\"$(COMPILE_ARCH)\"
+endif
+ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu"))
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
- -pipe -DUSE_ICON
+ -pipe -DUSE_ICON -DARCH_STRING=\\\"$(ARCH)\\\"
CLIENT_CFLAGS += $(SDL_CFLAGS)
OPTIMIZEVM = -O3
@@ -493,7 +483,7 @@ else # ifeq darwin
# SETUP AND BUILD -- MINGW32
#############################################################################
-ifeq ($(PLATFORM),mingw32)
+ifdef MINGW
ifeq ($(CROSS_COMPILING),1)
# If CC is already set to something generic, we probably want to use
@@ -507,7 +497,7 @@ ifeq ($(PLATFORM),mingw32)
MINGW_PREFIXES=amd64-mingw32msvc x86_64-w64-mingw32
endif
ifeq ($(ARCH),x86)
- MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32
+ MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 i686-pc-mingw32
endif
ifndef CC
@@ -639,7 +629,7 @@ ifeq ($(PLATFORM),mingw32)
SDLDLL=SDL2.dll
endif
-else # ifeq mingw32
+else # ifdef MINGW
#############################################################################
# SETUP AND BUILD -- FREEBSD
@@ -800,6 +790,7 @@ else # ifeq netbsd
#############################################################################
ifeq ($(PLATFORM),irix64)
+ LIB=lib
ARCH=mips
@@ -890,7 +881,7 @@ else # ifeq sunos
endif #Linux
endif #darwin
-endif #mingw32
+endif #MINGW
endif #FreeBSD
endif #OpenBSD
endif #NetBSD
@@ -966,8 +957,18 @@ ifeq ($(USE_CURL),1)
endif
endif
+ifeq ($(USE_VOIP),1)
+ CLIENT_CFLAGS += -DUSE_VOIP
+ SERVER_CFLAGS += -DUSE_VOIP
+ NEED_OPUS=1
+endif
+
ifeq ($(USE_CODEC_OPUS),1)
CLIENT_CFLAGS += -DUSE_CODEC_OPUS
+ NEED_OPUS=1
+endif
+
+ifeq ($(NEED_OPUS),1)
ifeq ($(USE_INTERNAL_OPUS),1)
OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DUSE_ALLOCA \
-I$(OPUSDIR)/include -I$(OPUSDIR)/celt -I$(OPUSDIR)/silk \
@@ -1013,19 +1014,6 @@ ifeq ($(USE_MUMBLE),1)
CLIENT_CFLAGS += -DUSE_MUMBLE
endif
-ifeq ($(USE_VOIP),1)
- CLIENT_CFLAGS += -DUSE_VOIP
- SERVER_CFLAGS += -DUSE_VOIP
- ifeq ($(USE_INTERNAL_SPEEX),1)
- SPEEX_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include
- else
- SPEEX_CFLAGS ?= $(shell pkg-config --silence-errors --cflags speex speexdsp || true)
- SPEEX_LIBS ?= $(shell pkg-config --silence-errors --libs speex speexdsp || echo -lspeex -lspeexdsp)
- endif
- CLIENT_CFLAGS += $(SPEEX_CFLAGS)
- CLIENT_LIBS += $(SPEEX_LIBS)
-endif
-
ifeq ($(USE_INTERNAL_ZLIB),1)
ZLIB_CFLAGS = -DNO_GZIP -I$(ZDIR)
else
@@ -1183,7 +1171,7 @@ ifeq ($(BUILD_MASTER_SERVER),1)
endif
ifneq ($(call bin_path, tput),)
- TERM_COLUMNS=$(shell echo $$((`tput cols`-4)))
+ TERM_COLUMNS=$(shell if c=`tput cols`; then echo $$(($$c-4)); else echo 76; fi)
else
TERM_COLUMNS=76
endif
@@ -1213,7 +1201,7 @@ endif
NAKED_TARGETS=$(shell echo $(TARGETS) | sed -e "s!$(B)/!!g")
-print_list=@for i in $(1); \
+print_list=-@for i in $(1); \
do \
echo " $$i"; \
done
@@ -1536,7 +1524,7 @@ Q3OBJ = \
$(B)/client/con_log.o \
$(B)/client/sys_main.o
-ifeq ($(PLATFORM),mingw32)
+ifdef MINGW
Q3OBJ += \
$(B)/client/con_passive.o
else
@@ -1550,6 +1538,7 @@ Q3R2OBJ = \
$(B)/renderergl2/tr_bsp.o \
$(B)/renderergl2/tr_cmds.o \
$(B)/renderergl2/tr_curve.o \
+ $(B)/renderergl2/tr_dsa.o \
$(B)/renderergl2/tr_extramath.o \
$(B)/renderergl2/tr_extensions.o \
$(B)/renderergl2/tr_fbo.o \
@@ -1557,11 +1546,12 @@ Q3R2OBJ = \
$(B)/renderergl2/tr_font.o \
$(B)/renderergl2/tr_glsl.o \
$(B)/renderergl2/tr_image.o \
- $(B)/renderergl2/tr_image_png.o \
- $(B)/renderergl2/tr_image_jpg.o \
$(B)/renderergl2/tr_image_bmp.o \
- $(B)/renderergl2/tr_image_tga.o \
+ $(B)/renderergl2/tr_image_jpg.o \
$(B)/renderergl2/tr_image_pcx.o \
+ $(B)/renderergl2/tr_image_png.o \
+ $(B)/renderergl2/tr_image_tga.o \
+ $(B)/renderergl2/tr_image_dds.o \
$(B)/renderergl2/tr_init.o \
$(B)/renderergl2/tr_light.o \
$(B)/renderergl2/tr_main.o \
@@ -1623,11 +1613,11 @@ Q3ROBJ = \
$(B)/renderergl1/tr_flares.o \
$(B)/renderergl1/tr_font.o \
$(B)/renderergl1/tr_image.o \
- $(B)/renderergl1/tr_image_png.o \
- $(B)/renderergl1/tr_image_jpg.o \
$(B)/renderergl1/tr_image_bmp.o \
- $(B)/renderergl1/tr_image_tga.o \
+ $(B)/renderergl1/tr_image_jpg.o \
$(B)/renderergl1/tr_image_pcx.o \
+ $(B)/renderergl1/tr_image_png.o \
+ $(B)/renderergl1/tr_image_tga.o \
$(B)/renderergl1/tr_init.o \
$(B)/renderergl1/tr_light.o \
$(B)/renderergl1/tr_main.o \
@@ -1725,53 +1715,7 @@ ifeq ($(ARCH),x86_64)
$(B)/client/ftola.o
endif
-ifeq ($(USE_VOIP),1)
-ifeq ($(USE_INTERNAL_SPEEX),1)
-Q3OBJ += \
- $(B)/client/bits.o \
- $(B)/client/buffer.o \
- $(B)/client/cb_search.o \
- $(B)/client/exc_10_16_table.o \
- $(B)/client/exc_10_32_table.o \
- $(B)/client/exc_20_32_table.o \
- $(B)/client/exc_5_256_table.o \
- $(B)/client/exc_5_64_table.o \
- $(B)/client/exc_8_128_table.o \
- $(B)/client/fftwrap.o \
- $(B)/client/filterbank.o \
- $(B)/client/filters.o \
- $(B)/client/gain_table.o \
- $(B)/client/gain_table_lbr.o \
- $(B)/client/hexc_10_32_table.o \
- $(B)/client/hexc_table.o \
- $(B)/client/high_lsp_tables.o \
- $(B)/client/jitter.o \
- $(B)/client/kiss_fft.o \
- $(B)/client/kiss_fftr.o \
- $(B)/client/lpc.o \
- $(B)/client/lsp.o \
- $(B)/client/lsp_tables_nb.o \
- $(B)/client/ltp.o \
- $(B)/client/mdf.o \
- $(B)/client/modes.o \
- $(B)/client/modes_wb.o \
- $(B)/client/nb_celp.o \
- $(B)/client/preprocess.o \
- $(B)/client/quant_lsp.o \
- $(B)/client/resample.o \
- $(B)/client/sb_celp.o \
- $(B)/client/smallft.o \
- $(B)/client/speex.o \
- $(B)/client/speex_callbacks.o \
- $(B)/client/speex_header.o \
- $(B)/client/stereo.o \
- $(B)/client/vbr.o \
- $(B)/client/vq.o \
- $(B)/client/window.o
-endif
-endif
-
-ifeq ($(USE_CODEC_OPUS),1)
+ifeq ($(NEED_OPUS),1)
ifeq ($(USE_INTERNAL_OPUS),1)
Q3OBJ += \
$(B)/client/opus/analysis.o \
@@ -1980,7 +1924,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
endif
endif
-ifeq ($(PLATFORM),mingw32)
+ifdef MINGW
Q3OBJ += \
$(B)/client/win_resource.o \
$(B)/client/sys_win32.o
@@ -2119,7 +2063,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
endif
endif
-ifeq ($(PLATFORM),mingw32)
+ifdef MINGW
Q3DOBJ += \
$(B)/ded/win_resource.o \
$(B)/ded/sys_win32.o \