Makefile
author Ruben Gonzalez <drifter01620@gmail.com>
Wed Oct 01 11:50:24 2014 -0400 (2014-10-01)
changeset 193 277c856152b0
parent 53 3c0401873aa6
permissions -rw-r--r--
Update linix CS:GO gamedata
     1 #(C)2004-2006 SourceMM Development Team
     2 # Makefile written by David "BAILOPAN" Anderson
     3 
     4 SMSDK = ../sourcemod-1.3
     5 SOURCEMM = ../mmsource-1.8
     6 HL2SDK = ../hl2sdk-ob-valve
     7 
     8 #####################################
     9 ### EDIT BELOW FOR OTHER PROJECTS ###
    10 #####################################
    11 
    12 PROJECT = cssdm
    13 
    14 OBJECTS = sdk/smsdk_ext.cpp cssdm_weapons.cpp cssdm_utils.cpp cssdm_players.cpp \
    15 	cssdm_main.cpp cssdm_ffa.cpp cssdm_events.cpp cssdm_detours.cpp cssdm_ctrl.cpp \
    16 	cssdm_config.cpp cssdm_callbacks.cpp 
    17 
    18 ##############################################
    19 ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
    20 ##############################################
    21 
    22 C_OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing
    23 C_DEBUG_FLAGS = -g -ggdb3
    24 CPP_GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
    25 CPP = gcc
    26 
    27 OS := $(shell uname -s)
    28 ifeq "$(OS)" "Darwin"
    29 	LIB_EXT = dylib
    30 	HL2LIB = $(HL2SDK)/lib/mac
    31 	CFLAGS += -isysroot /Developer/SDKs/MacOSX10.5.sdk
    32 	LINK = -dynamiclib -lstdc++ -mmacosx-version-min=10.5
    33 else
    34 	LIB_EXT = so
    35 	CFLAGS += -D_LINUX
    36 	LINK = -shared
    37 	HL2LIB = $(HL2SDK)/lib/linux
    38 endif
    39 
    40 HL2PUB = $(HL2SDK)/public
    41 
    42 LINK_HL2 = $(HL2LIB)/tier1_i486.a libvstdlib.$(LIB_EXT) libtier0.$(LIB_EXT)
    43 LINK += $(LINK_HL2) -static-libgcc
    44 
    45 INCLUDE = -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/game/server -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 \
    46 	-I$(HL2PUB)/tier1 -I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(SOURCEMM)/core \
    47 	-I$(SOURCEMM)/core/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions \
    48 	-I$(HL2SDK)/game/server -I$(HL2SDK)/game/shared
    49 
    50 CFLAGS += -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
    51 	 -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
    52 	 -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch -Wno-unused -Wno-invalid-offsetof -fPIC \
    53 	 -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -Wno-uninitialized -m32
    54 CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
    55 
    56 ################################################
    57 ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
    58 ################################################
    59 
    60 ifeq "$(DEBUG)" "true"
    61 	BIN_DIR = Debug
    62 	CFLAGS += $(C_DEBUG_FLAGS)
    63 else
    64 	BIN_DIR = Release
    65 	CFLAGS += $(C_OPT_FLAGS)
    66 endif
    67 
    68 
    69 GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
    70 ifeq "$(GCC_VERSION)" "4"
    71 	CPPFLAGS += $(CPP_GCC4_FLAGS)
    72 endif
    73 
    74 BINARY = $(PROJECT).ext.$(LIB_EXT)
    75 
    76 OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    77 
    78 $(BIN_DIR)/%.o: %.cpp
    79 	$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o [email protected] -c $<
    80 
    81 all:
    82 	mkdir -p $(BIN_DIR)/sdk
    83 	ln -sf $(HL2LIB)/libvstdlib.$(LIB_EXT) libvstdlib.$(LIB_EXT)
    84 	ln -sf $(HL2LIB)/libtier0.$(LIB_EXT) libtier0.$(LIB_EXT)
    85 	$(MAKE) extension
    86 
    87 extension: $(OBJ_LINUX)
    88 	$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o $(BIN_DIR)/$(BINARY)
    89 
    90 debug:	
    91 	$(MAKE) all DEBUG=true
    92 
    93 default: all
    94 
    95 clean:
    96 	rm -rf Release/*.o
    97 	rm -rf Release/sdk/*.o
    98 	rm -rf Release/$(BINARY)
    99 	rm -rf Debug/*.o
   100 	rm -rf Debug/sdk/*.o
   101 	rm -rf Debug/$(BINARY)