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