Rework CFLAGS: separate CFLAGS for client, server, and VMs. (#3533)

This commit is contained in:
Thilo Schulz 2009-11-08 17:04:30 +00:00
parent 5785b45e6a
commit cd38bf6bf5

204
Makefile
View file

@ -151,8 +151,8 @@ ifndef USE_LOCAL_HEADERS
USE_LOCAL_HEADERS=1 USE_LOCAL_HEADERS=1
endif endif
ifndef USE_DEBUG_CFLAGS ifndef DEBUG_CFLAGS
USE_DEBUG_CFLAGS=-g -O0 DEBUG_CFLAGS=-g -O0
endif endif
############################################################################# #############################################################################
@ -259,38 +259,43 @@ ifeq ($(PLATFORM),linux)
endif endif
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-pipe -DUSE_ICON $(SDL_CFLAGS) -pipe -DUSE_ICON
CLIENT_CFLAGS = $(SDL_CFLAGS)
SERVER_CFLAGS =
ifeq ($(USE_OPENAL),1) ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL CLIENT_CFLAGS += -DUSE_OPENAL
ifeq ($(USE_OPENAL_DLOPEN),1) ifeq ($(USE_OPENAL_DLOPEN),1)
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
endif endif
endif endif
ifeq ($(USE_CURL),1) ifeq ($(USE_CURL),1)
BASE_CFLAGS += -DUSE_CURL CLIENT_CFLAGS += -DUSE_CURL
ifeq ($(USE_CURL_DLOPEN),1) ifeq ($(USE_CURL_DLOPEN),1)
BASE_CFLAGS += -DUSE_CURL_DLOPEN CLIENT_CFLAGS += -DUSE_CURL_DLOPEN
endif endif
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
BASE_CFLAGS += -DUSE_CODEC_VORBIS CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
endif endif
OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
OPTIMIZE = -O3 -fomit-frame-pointer -ffast-math -funroll-loops \ OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops \
-falign-loops=2 -falign-jumps=2 -falign-functions=2 \ -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
-fstrength-reduce -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
else else
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \ OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer \
-funroll-loops -falign-loops=2 -falign-jumps=2 \ -funroll-loops -falign-loops=2 -falign-jumps=2 \
-falign-functions=2 -fstrength-reduce -falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
else else
ifeq ($(ARCH),ppc) ifeq ($(ARCH),ppc)
@ -303,6 +308,7 @@ ifeq ($(PLATFORM),linux)
endif endif
ifeq ($(ARCH),sparc) ifeq ($(ARCH),sparc)
OPTIMIZE += -mtune=ultrasparc3 -mv8plus OPTIMIZE += -mtune=ultrasparc3 -mv8plus
OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
endif endif
endif endif
@ -342,7 +348,7 @@ ifeq ($(PLATFORM),linux)
endif endif
ifeq ($(USE_LOCAL_HEADERS),1) ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -I$(SDLHDIR)/include CLIENT_CFLAGS += -I$(SDLHDIR)/include
endif endif
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
@ -353,10 +359,6 @@ ifeq ($(PLATFORM),linux)
BASE_CFLAGS += -m64 BASE_CFLAGS += -m64
endif endif
endif endif
DEBUG_CFLAGS = $(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
else # ifeq Linux else # ifeq Linux
############################################################################# #############################################################################
@ -366,19 +368,21 @@ else # ifeq Linux
ifeq ($(PLATFORM),darwin) ifeq ($(PLATFORM),darwin)
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
CLIENT_LIBS= CLIENT_LIBS=
OPTIMIZE= OPTIMIZEVM=
BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes
CLIENT_CFLAGS =
SERVER_CFLAGS =
ifeq ($(ARCH),ppc) ifeq ($(ARCH),ppc)
BASE_CFLAGS += -faltivec BASE_CFLAGS += -faltivec
OPTIMIZE += -O3 OPTIMIZEVM += -O3
endif endif
ifeq ($(ARCH),ppc64) ifeq ($(ARCH),ppc64)
BASE_CFLAGS += -faltivec BASE_CFLAGS += -faltivec
endif endif
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
OPTIMIZE += -march=prescott -mfpmath=sse OPTIMIZEVM += -march=prescott -mfpmath=sse
# x86 vm will crash without -mstackrealign since MMX instructions will be # x86 vm will crash without -mstackrealign since MMX instructions will be
# used no matter what and they corrupt the frame pointer in VM calls # used no matter what and they corrupt the frame pointer in VM calls
BASE_CFLAGS += -mstackrealign BASE_CFLAGS += -mstackrealign
@ -391,21 +395,21 @@ ifeq ($(PLATFORM),darwin)
ifneq ($(USE_OPENAL_DLOPEN),1) ifneq ($(USE_OPENAL_DLOPEN),1)
CLIENT_LIBS += -framework OpenAL CLIENT_LIBS += -framework OpenAL
else else
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
endif endif
endif endif
ifeq ($(USE_CURL),1) ifeq ($(USE_CURL),1)
BASE_CFLAGS += -DUSE_CURL CLIENT_CFLAGS += -DUSE_CURL
ifneq ($(USE_CURL_DLOPEN),1) ifneq ($(USE_CURL_DLOPEN),1)
CLIENT_LIBS += -lcurl CLIENT_LIBS += -lcurl
else else
BASE_CFLAGS += -DUSE_CURL_DLOPEN CLIENT_CFLAGS += -DUSE_CURL_DLOPEN
endif endif
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
BASE_CFLAGS += -DUSE_CODEC_VORBIS CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
CLIENT_LIBS += -lvorbisfile -lvorbis -logg CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif endif
@ -422,16 +426,13 @@ ifeq ($(PLATFORM),darwin)
CLIENT_LIBS += -framework Cocoa -framework IOKit -framework OpenGL \ CLIENT_LIBS += -framework Cocoa -framework IOKit -framework OpenGL \
$(LIBSDIR)/macosx/libSDL-1.2.0.dylib $(LIBSDIR)/macosx/libSDL-1.2.0.dylib
OPTIMIZE += -ffast-math -falign-loops=16 OPTIMIZEVM += -falign-loops=16
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
ifneq ($(HAVE_VM_COMPILED),true) ifneq ($(HAVE_VM_COMPILED),true)
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
endif endif
DEBUG_CFLAGS = $(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
SHLIBEXT=dylib SHLIBEXT=dylib
SHLIBCFLAGS=-fPIC -fno-common SHLIBCFLAGS=-fPIC -fno-common
SHLIBLDFLAGS=-dynamiclib $(LDFLAGS) SHLIBLDFLAGS=-dynamiclib $(LDFLAGS)
@ -463,6 +464,8 @@ ifeq ($(PLATFORM),mingw32)
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-DUSE_ICON -DUSE_ICON
CLIENT_CFLAGS =
SERVER_CFLAGS =
# In the absence of wspiapi.h, require Windows XP or later # In the absence of wspiapi.h, require Windows XP or later
ifeq ($(shell test -e $(CMDIR)/wspiapi.h; echo $$?),1) ifeq ($(shell test -e $(CMDIR)/wspiapi.h; echo $$?),1)
@ -470,22 +473,23 @@ ifeq ($(PLATFORM),mingw32)
endif endif
ifeq ($(USE_OPENAL),1) ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL CLIENT_CFLAGS += -DUSE_OPENAL
BASE_CFLAGS += $(OPENAL_CFLAGS) CLIENT_CFLAGS += $(OPENAL_CFLAGS)
ifeq ($(USE_OPENAL_DLOPEN),1) ifeq ($(USE_OPENAL_DLOPEN),1)
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
else else
CLIENT_LDFLAGS += $(OPENAL_LDFLAGS) CLIENT_LDFLAGS += $(OPENAL_LDFLAGS)
endif endif
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
BASE_CFLAGS += -DUSE_CODEC_VORBIS CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
endif endif
OPTIMIZE = -O3 -march=i586 -fno-omit-frame-pointer -ffast-math \ OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer \
-falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \ -falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \
-fstrength-reduce -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
@ -500,11 +504,11 @@ ifeq ($(PLATFORM),mingw32)
CLIENT_LIBS = -lgdi32 -lole32 -lopengl32 CLIENT_LIBS = -lgdi32 -lole32 -lopengl32
ifeq ($(USE_CURL),1) ifeq ($(USE_CURL),1)
BASE_CFLAGS += -DUSE_CURL CLIENT_CFLAGS += -DUSE_CURL
BASE_CFLAGS += $(CURL_CFLAGS) CLIENT_CFLAGS += $(CURL_CFLAGS)
ifneq ($(USE_CURL_DLOPEN),1) ifneq ($(USE_CURL_DLOPEN),1)
ifeq ($(USE_LOCAL_HEADERS),1) ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -DCURL_STATICLIB CLIENT_CFLAGS += -DCURL_STATICLIB
CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a
else else
CLIENT_LIBS += $(CURL_LIBS) CLIENT_LIBS += $(CURL_LIBS)
@ -521,22 +525,17 @@ ifeq ($(PLATFORM),mingw32)
BASE_CFLAGS += -m32 BASE_CFLAGS += -m32
endif endif
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
# libmingw32 must be linked before libSDLmain # libmingw32 must be linked before libSDLmain
CLIENT_LIBS += -lmingw32 CLIENT_LIBS += -lmingw32
ifeq ($(USE_LOCAL_HEADERS),1) ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -I$(SDLHDIR)/include CLIENT_CFLAGS += -I$(SDLHDIR)/include
CLIENT_LIBS += $(LIBSDIR)/win32/libSDLmain.a \ CLIENT_LIBS += $(LIBSDIR)/win32/libSDLmain.a \
$(LIBSDIR)/win32/libSDL.dll.a $(LIBSDIR)/win32/libSDL.dll.a
else else
BASE_CFLAGS += $(SDL_CFLAGS) CLIENT_CFLAGS += $(SDL_CFLAGS)
CLIENT_LIBS += $(SDL_LIBS) CLIENT_LIBS += $(SDL_LIBS)
endif endif
BUILD_CLIENT_SMP = 0 BUILD_CLIENT_SMP = 0
else # ifeq mingw32 else # ifeq mingw32
@ -553,38 +552,39 @@ ifeq ($(PLATFORM),freebsd)
ARCH=i386 ARCH=i386
endif #alpha test endif #alpha test
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-DUSE_ICON $(SDL_CFLAGS) -DUSE_ICON
CLIENT_CFLAGS = $(SDL_CFLAGS)
SERVER_CFLAGS =
ifeq ($(USE_OPENAL),1) ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL CLIENT_CFLAGS += -DUSE_OPENAL
ifeq ($(USE_OPENAL_DLOPEN),1) ifeq ($(USE_OPENAL_DLOPEN),1)
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
endif endif
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
BASE_CFLAGS += -DUSE_CODEC_VORBIS CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
endif endif
OPTIMIZEVM = -DNDEBUG -O3 -funroll-loops -fomit-frame-pointer
ifeq ($(ARCH),axp) ifeq ($(ARCH),axp)
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \ OPTIMIZEVM += -fexpensive-optimizations
-fomit-frame-pointer -fexpensive-optimizations
else else
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \ OPTIMIZEVM += -mtune=pentiumpro \
-march=pentium -fomit-frame-pointer -pipe -ffast-math \ -march=pentium -pipe -falign-loops=2 -falign-jumps=2 \
-falign-loops=2 -falign-jumps=2 -falign-functions=2 \ -falign-functions=2 -funroll-loops -fstrength-reduce
-funroll-loops -fstrength-reduce
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
else else
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
endif endif
endif endif
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS) OPTIMIZE = $(OPTIMIZEVM) -ffast-math
SHLIBEXT=so SHLIBEXT=so
SHLIBCFLAGS=-fPIC SHLIBCFLAGS=-fPIC
@ -619,32 +619,30 @@ ifeq ($(PLATFORM),openbsd)
#default to i386, no tests done on anything else #default to i386, no tests done on anything else
ARCH=i386 ARCH=i386
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-DUSE_ICON $(SDL_CFLAGS) -DUSE_ICON
CLIENT_CFLAGS = $(SDL_CFLAGS)
SERVER_CFLAGS =
ifeq ($(USE_OPENAL),1) ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL CLIENT_CFLAGS += -DUSE_OPENAL
ifeq ($(USE_OPENAL_DLOPEN),1) ifeq ($(USE_OPENAL_DLOPEN),1)
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
endif endif
endif endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
BASE_CFLAGS += -DUSE_CODEC_VORBIS CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
endif endif
ifeq ($(USE_CURL),1) ifeq ($(USE_CURL),1)
BASE_CFLAGS += -DUSE_CURL $(CURL_CFLAGS) CLIENT_CFLAGS += -DUSE_CURL $(CURL_CFLAGS)
USE_CURL_DLOPEN=0 USE_CURL_DLOPEN=0
endif endif
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG
HAVE_VM_COMPILED=false HAVE_VM_COMPILED=false
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
SHLIBEXT=so SHLIBEXT=so
SHLIBNAME=.$(SHLIBEXT) SHLIBNAME=.$(SHLIBEXT)
SHLIBCFLAGS=-fPIC SHLIBCFLAGS=-fPIC
@ -692,13 +690,13 @@ ifeq ($(PLATFORM),netbsd)
THREAD_LIBS=-lpthread THREAD_LIBS=-lpthread
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
CLIENT_CFLAGS =
SERVER_CFLAGS =
ifneq ($(ARCH),i386) ifneq ($(ARCH),i386)
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
endif endif
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
BUILD_CLIENT = 0 BUILD_CLIENT = 0
BUILD_GAME_QVM = 0 BUILD_GAME_QVM = 0
@ -716,9 +714,9 @@ ifeq ($(PLATFORM),irix64)
MKDIR = mkdir -p MKDIR = mkdir -p
BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 \ BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 \
-I. $(SDL_CFLAGS) -I$(ROOT)/usr/include -DNO_VM_COMPILED -I. -I$(ROOT)/usr/include -DNO_VM_COMPILED
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 CLIENT_CFLAGS = $(SDL_CFLAGS)
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS) OPTIMIZE = -O3
SHLIBEXT=so SHLIBEXT=so
SHLIBCFLAGS= SHLIBCFLAGS=
@ -755,36 +753,35 @@ ifeq ($(PLATFORM),sunos)
endif endif
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-pipe -DUSE_ICON $(SDL_CFLAGS) -pipe -DUSE_ICON
CLIENT_CFLAGS = $(SDL_CFLAGS)
SERVER_CFLAGS =
OPTIMIZE = -O3 -ffast-math -funroll-loops OPTIMIZEVM = -O3 -funroll-loops -DNDEBUG
ifeq ($(ARCH),sparc) ifeq ($(ARCH),sparc)
OPTIMIZE = -O3 -ffast-math \ OPTIMIZEVM += -O3 \
-fstrength-reduce -falign-functions=2 \ -fstrength-reduce -falign-functions=2 \
-mtune=ultrasparc3 -mv8plus -mno-faster-structs \ -mtune=ultrasparc3 -mv8plus -mno-faster-structs
-funroll-loops #-mv8plus
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
else else
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \ OPTIMIZEVM += -march=i586 -fomit-frame-pointer \
-funroll-loops -falign-loops=2 -falign-jumps=2 \ -falign-loops=2 -falign-jumps=2 \
-falign-functions=2 -fstrength-reduce -falign-functions=2 -fstrength-reduce
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
BASE_CFLAGS += -m32 BASE_CFLAGS += -m32
BASE_CFLAGS += -I/usr/X11/include/NVIDIA CLIENT_CFLAGS += -I/usr/X11/include/NVIDIA
CLIENT_LDFLAGS += -L/usr/X11/lib/NVIDIA -R/usr/X11/lib/NVIDIA CLIENT_LDFLAGS += -L/usr/X11/lib/NVIDIA -R/usr/X11/lib/NVIDIA
endif endif
endif endif
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
ifneq ($(HAVE_VM_COMPILED),true) ifneq ($(HAVE_VM_COMPILED),true)
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
endif endif
DEBUG_CFLAGS = $(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
SHLIBEXT=so SHLIBEXT=so
SHLIBCFLAGS=-fPIC SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS) SHLIBLDFLAGS=-shared $(LDFLAGS)
@ -802,8 +799,7 @@ else # ifeq sunos
# SETUP AND BUILD -- GENERIC # SETUP AND BUILD -- GENERIC
############################################################################# #############################################################################
BASE_CFLAGS=-DNO_VM_COMPILED BASE_CFLAGS=-DNO_VM_COMPILED
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS) OPTIMIZE = -DNDEBUG -O3
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3
SHLIBEXT=so SHLIBEXT=so
SHLIBCFLAGS=-fPIC SHLIBCFLAGS=-fPIC
@ -868,13 +864,13 @@ ifneq ($(BUILD_GAME_QVM),0)
endif endif
ifeq ($(USE_MUMBLE),1) ifeq ($(USE_MUMBLE),1)
BASE_CFLAGS += -DUSE_MUMBLE CLIENT_CFLAGS += -DUSE_MUMBLE
endif endif
ifeq ($(USE_VOIP),1) ifeq ($(USE_VOIP),1)
BASE_CFLAGS += -DUSE_VOIP CLIENT_CFLAGS += -DUSE_VOIP
ifeq ($(USE_INTERNAL_SPEEX),1) ifeq ($(USE_INTERNAL_SPEEX),1)
BASE_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include CLIENT_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include
else else
CLIENT_LIBS += -lspeex -lspeexdsp CLIENT_LIBS += -lspeex -lspeexdsp
endif endif
@ -925,17 +921,17 @@ endif
define DO_CC define DO_CC
$(echo_cmd) "CC $<" $(echo_cmd) "CC $<"
$(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) $(BASE_CFLAGS) $(CLIENT_CFLAGS) $(OPTIMIZE) -o $@ -c $<
endef endef
define DO_SMP_CC define DO_SMP_CC
$(echo_cmd) "SMP_CC $<" $(echo_cmd) "SMP_CC $<"
$(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) $(BASE_CFLAGS) $(CLIENT_CFLAGS) $(OPTIMIZE) -DSMP -o $@ -c $<
endef endef
define DO_BOT_CC define DO_BOT_CC
$(echo_cmd) "BOT_CC $<" $(echo_cmd) "BOT_CC $<"
$(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) $(BASE_CFLAGS) $(BOTCFLAGS) $(OPTIMIZE) -DBOTLIB -o $@ -c $<
endef endef
ifeq ($(GENERATE_DEPENDENCIES),1) ifeq ($(GENERATE_DEPENDENCIES),1)
@ -944,60 +940,60 @@ endif
define DO_SHLIB_CC define DO_SHLIB_CC
$(echo_cmd) "SHLIB_CC $<" $(echo_cmd) "SHLIB_CC $<"
$(Q)$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_GAME_CC define DO_GAME_CC
$(echo_cmd) "GAME_CC $<" $(echo_cmd) "GAME_CC $<"
$(Q)$(CC) -DQAGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DQAGAME $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_CGAME_CC define DO_CGAME_CC
$(echo_cmd) "CGAME_CC $<" $(echo_cmd) "CGAME_CC $<"
$(Q)$(CC) -DCGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DCGAME $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_UI_CC define DO_UI_CC
$(echo_cmd) "UI_CC $<" $(echo_cmd) "UI_CC $<"
$(Q)$(CC) -DUI $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DUI $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_SHLIB_CC_MISSIONPACK define DO_SHLIB_CC_MISSIONPACK
$(echo_cmd) "SHLIB_CC_MISSIONPACK $<" $(echo_cmd) "SHLIB_CC_MISSIONPACK $<"
$(Q)$(CC) -DMISSIONPACK $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DMISSIONPACK $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_GAME_CC_MISSIONPACK define DO_GAME_CC_MISSIONPACK
$(echo_cmd) "GAME_CC_MISSIONPACK $<" $(echo_cmd) "GAME_CC_MISSIONPACK $<"
$(Q)$(CC) -DMISSIONPACK -DQAGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DMISSIONPACK -DQAGAME $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_CGAME_CC_MISSIONPACK define DO_CGAME_CC_MISSIONPACK
$(echo_cmd) "CGAME_CC_MISSIONPACK $<" $(echo_cmd) "CGAME_CC_MISSIONPACK $<"
$(Q)$(CC) -DMISSIONPACK -DCGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DMISSIONPACK -DCGAME $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_UI_CC_MISSIONPACK define DO_UI_CC_MISSIONPACK
$(echo_cmd) "UI_CC_MISSIONPACK $<" $(echo_cmd) "UI_CC_MISSIONPACK $<"
$(Q)$(CC) -DMISSIONPACK -DUI $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DMISSIONPACK -DUI $(SHLIBCFLAGS) $(BASE_CFLAGS) $(OPTIMIZEVM) -o $@ -c $<
$(Q)$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_AS define DO_AS
$(echo_cmd) "AS $<" $(echo_cmd) "AS $<"
$(Q)$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $< $(Q)$(CC) $(BASE_CFLAGS) $(OPTIMIZE) -x assembler-with-cpp -o $@ -c $<
endef endef
define DO_DED_CC define DO_DED_CC
$(echo_cmd) "DED_CC $<" $(echo_cmd) "DED_CC $<"
$(Q)$(CC) $(NOTSHLIBCFLAGS) -DDEDICATED $(CFLAGS) -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) -DDEDICATED $(BASE_CFLAGS) $(SERVER_CFLAGS) $(OPTIMIZE) -o $@ -c $<
endef endef
define DO_WINDRES define DO_WINDRES
@ -1014,12 +1010,14 @@ default: release
all: debug release all: debug release
debug: debug:
@$(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEPEND_CFLAGS) \ @$(MAKE) targets B=$(BD) BASE_CFLAGS="$(BASE_CFLAGS) $(DEPEND_CFLAGS)" \
$(DEBUG_CFLAGS)" V=$(V) OPTIMIZE="$(DEBUG_CFLAGS)" OPTIMIZEVM="$(DEBUG_CFLAGS)" \
CLIENT_CFLAGS="$(CLIENT_CFLAGS)" SERVER_CFLAGS="$(SERVER_CFLAGS)" V=$(V)
release: release:
@$(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(DEPEND_CFLAGS) \ @$(MAKE) targets B=$(BR) BASE_CFLAGS="$(BASE_CFLAGS) $(DEPEND_CFLAGS)" \
$(RELEASE_CFLAGS)" V=$(V) OPTIMIZE="$(OPTIMIZE)" OPTIMIZEVM="$(OPTIMIZEVM)" \
CLIENT_CFLAGS="$(CLIENT_CFLAGS)" SERVER_CFLAGS="$(SERVER_CFLAGS)" V=$(V)
# Create the build directories, check libraries and print out # Create the build directories, check libraries and print out
# an informational message, then start building # an informational message, then start building