Updated makefiles yet again to add GCC version checking for some cool new optimization flags
authorScott Ehlert <ds@alliedmods.net>
Mon Aug 14 20:14:02 2006 +0000 (2006-08-14)
changeset 2502eac473ac291
parent 249 eaf9071cedc8
child 251 3bd7e7008ac3
Updated makefiles yet again to add GCC version checking for some cool new optimization flags
sourcemm/Makefile
sourcemm/sample_mm/Makefile
sourcemm/stub_mm/Makefile
     1.1 --- a/sourcemm/Makefile	Mon Aug 14 19:39:47 2006 +0000
     1.2 +++ b/sourcemm/Makefile	Mon Aug 14 20:14:02 2006 +0000
     1.3 @@ -4,11 +4,11 @@
     1.4  HL2SDK = ../hl2sdk
     1.5  SMM_ROOT = ..
     1.6  SRCDS = ~/srcds
     1.7 -EXTRA_FLAGS = 
     1.8  
     1.9  ### EDIT BELOW FOR OTHER PROJECTS ###
    1.10  
    1.11  OPT_FLAGS = -O2 -funroll-loops -s -pipe
    1.12 +GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
    1.13  DEBUG_FLAGS = -g -ggdb3
    1.14  CPP = gcc-4.1
    1.15  BINARY = server_i486.so
    1.16 @@ -31,7 +31,13 @@
    1.17  	CFLAGS = $(OPT_FLAGS)
    1.18  endif
    1.19  
    1.20 -CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse $(EXTRA_FLAGS)
    1.21 +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
    1.22 +
    1.23 +CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
    1.24 +
    1.25 +ifeq "$(GCC_VERSION)" "4"
    1.26 +	CFLAGS += $(GCC4_FLAGS)
    1.27 +endif
    1.28  
    1.29  OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    1.30  
     2.1 --- a/sourcemm/sample_mm/Makefile	Mon Aug 14 19:39:47 2006 +0000
     2.2 +++ b/sourcemm/sample_mm/Makefile	Mon Aug 14 20:14:02 2006 +0000
     2.3 @@ -4,11 +4,11 @@
     2.4  HL2SDK = ../../hl2sdk
     2.5  SMM_ROOT = ../..
     2.6  SRCDS = ~/srcds
     2.7 -EXTRA_FLAGS = 
     2.8  
     2.9  ### EDIT BELOW FOR OTHER PROJECTS ###
    2.10  
    2.11  OPT_FLAGS = -O3 -funroll-loops -s -pipe
    2.12 +GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
    2.13  DEBUG_FLAGS = -g -ggdb3
    2.14  CPP = gcc-4.1
    2.15  BINARY = sample_mm_i486.so
    2.16 @@ -30,7 +30,13 @@
    2.17  	CFLAGS = $(OPT_FLAGS)
    2.18  endif
    2.19  
    2.20 -CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse $(EXTRA_FLAGS)
    2.21 +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
    2.22 +
    2.23 +CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
    2.24 +
    2.25 +ifeq "$(GCC_VERSION)" "4"
    2.26 +	CFLAGS += $(GCC4_FLAGS)
    2.27 +endif
    2.28  
    2.29  OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    2.30  
     3.1 --- a/sourcemm/stub_mm/Makefile	Mon Aug 14 19:39:47 2006 +0000
     3.2 +++ b/sourcemm/stub_mm/Makefile	Mon Aug 14 20:14:02 2006 +0000
     3.3 @@ -4,11 +4,11 @@
     3.4  HL2SDK = ../../hl2sdk
     3.5  SMM_ROOT = ../..
     3.6  SRCDS = ~/srcds
     3.7 -EXTRA_FLAGS = 
     3.8  
     3.9  ### EDIT BELOW FOR OTHER PROJECTS ###
    3.10  
    3.11  OPT_FLAGS = -O3 -funroll-loops -s -pipe
    3.12 +GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
    3.13  DEBUG_FLAGS = -g -ggdb3
    3.14  CPP = gcc-4.1
    3.15  BINARY = stub_mm_i486.so
    3.16 @@ -30,7 +30,13 @@
    3.17  	CFLAGS = $(OPT_FLAGS)
    3.18  endif
    3.19  
    3.20 -CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse $(EXTRA_FLAGS)
    3.21 +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
    3.22 +
    3.23 +CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
    3.24 +
    3.25 +ifeq "$(GCC_VERSION)" "4"
    3.26 +	CFLAGS += $(GCC4_FLAGS)
    3.27 +endif
    3.28  
    3.29  OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    3.30