2010-04-23 22:59:32 +02:00
|
|
|
# (C)2004-2010 SourceMod Development Team
|
2008-11-14 11:04:02 +01:00
|
|
|
# Makefile written by David "BAILOPAN" Anderson
|
|
|
|
|
|
|
|
HL2SDK_OB = ../../hl2sdk-ob
|
2012-08-20 20:25:56 +02:00
|
|
|
HL2SDK_CSS = ../../hl2sdk-css
|
2009-10-29 22:23:25 +01:00
|
|
|
HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve
|
2008-11-14 11:04:02 +01:00
|
|
|
HL2SDK_L4D = ../../hl2sdk-l4d
|
2009-10-29 16:57:27 +01:00
|
|
|
HL2SDK_L4D2 = ../../hl2sdk-l4d2
|
2012-05-26 23:07:26 +02:00
|
|
|
HL2SDK_CSGO = ../../hl2sdk-csgo
|
2008-11-14 11:04:02 +01:00
|
|
|
|
|
|
|
#####################################
|
|
|
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
|
|
|
#####################################
|
|
|
|
|
2011-04-27 18:49:25 +02:00
|
|
|
OBJECTS = metamod.cpp \
|
|
|
|
metamod_util.cpp \
|
|
|
|
metamod_console.cpp \
|
|
|
|
metamod_oslink.cpp \
|
|
|
|
metamod_plugins.cpp \
|
|
|
|
sourcehook/sourcehook.cpp \
|
|
|
|
sourcehook/sourcehook_hookmangen.cpp \
|
|
|
|
sourcehook/sourcehook_impl_chookidman.cpp \
|
|
|
|
sourcehook/sourcehook_impl_chookmaninfo.cpp \
|
|
|
|
sourcehook/sourcehook_impl_cproto.cpp \
|
|
|
|
sourcehook/sourcehook_impl_cvfnptr.cpp \
|
|
|
|
provider/console.cpp \
|
|
|
|
provider/provider_ep2.cpp \
|
|
|
|
vsp_bridge.cpp \
|
|
|
|
gamedll_bridge.cpp
|
2008-11-14 11:04:02 +01:00
|
|
|
|
|
|
|
##############################################
|
|
|
|
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
|
|
|
##############################################
|
|
|
|
|
|
|
|
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
|
|
|
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
|
|
|
C_GCC4_FLAGS = -fvisibility=hidden
|
|
|
|
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
2012-08-20 20:25:56 +02:00
|
|
|
CPP = gcc
|
2008-11-14 11:04:02 +01:00
|
|
|
|
|
|
|
override ENGSET = false
|
|
|
|
ifeq "$(ENGINE)" "orangebox"
|
|
|
|
HL2SDK = $(HL2SDK_OB)
|
2009-10-29 16:57:27 +01:00
|
|
|
HL2PUB = $(HL2SDK)/public
|
|
|
|
HL2LIB = $(HL2SDK)/lib/linux
|
2008-11-17 07:57:17 +01:00
|
|
|
CFLAGS += -DSOURCE_ENGINE=3
|
2009-10-29 16:57:27 +01:00
|
|
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
2008-11-16 04:54:46 +01:00
|
|
|
BINARY = metamod.2.ep2.so
|
2010-04-23 22:55:51 +02:00
|
|
|
LIB_SUFFIX = _i486.so
|
2008-11-14 11:04:02 +01:00
|
|
|
override ENGSET = true
|
|
|
|
endif
|
2012-08-20 20:25:56 +02:00
|
|
|
ifeq "$(ENGINE)" "css"
|
|
|
|
HL2SDK = $(HL2SDK_CSS)
|
|
|
|
HL2PUB = $(HL2SDK)/public
|
|
|
|
HL2LIB = $(HL2SDK)/lib/linux
|
|
|
|
CFLAGS += -DSOURCE_ENGINE=6
|
|
|
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
|
|
BINARY = metamod.2.css.so
|
|
|
|
LIB_PREFIX = lib
|
2013-02-05 22:26:40 +01:00
|
|
|
LIB_SUFFIX = _srv.so
|
2012-08-20 20:25:56 +02:00
|
|
|
override ENGSET = true
|
|
|
|
endif
|
2009-10-29 22:23:25 +01:00
|
|
|
ifeq "$(ENGINE)" "orangeboxvalve"
|
|
|
|
HL2SDK = $(HL2SDK_OB_VALVE)
|
|
|
|
HL2PUB = $(HL2SDK)/public
|
|
|
|
HL2LIB = $(HL2SDK)/lib/linux
|
2012-08-20 20:25:56 +02:00
|
|
|
CFLAGS += -DSOURCE_ENGINE=7
|
2009-10-29 22:23:25 +01:00
|
|
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
|
|
BINARY = metamod.2.ep2v.so
|
2010-04-29 08:19:40 +02:00
|
|
|
LIB_PREFIX = lib
|
2012-10-27 17:48:06 +02:00
|
|
|
LIB_SUFFIX = _srv.so
|
2009-10-29 22:23:25 +01:00
|
|
|
override ENGSET = true
|
|
|
|
endif
|
2008-11-14 11:04:02 +01:00
|
|
|
ifeq "$(ENGINE)" "left4dead"
|
|
|
|
HL2SDK = $(HL2SDK_L4D)
|
2009-10-29 16:57:27 +01:00
|
|
|
HL2PUB = $(HL2SDK)/public
|
|
|
|
HL2LIB = $(HL2SDK)/lib/linux
|
2012-08-20 20:25:56 +02:00
|
|
|
CFLAGS += -DSOURCE_ENGINE=8
|
2009-10-29 16:57:27 +01:00
|
|
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
2008-11-17 07:57:17 +01:00
|
|
|
BINARY = metamod.2.l4d.so
|
2013-06-30 16:39:04 +02:00
|
|
|
LIB_PREFIX = lib
|
|
|
|
LIB_SUFFIX = .so
|
2008-11-14 11:04:02 +01:00
|
|
|
override ENGSET = true
|
|
|
|
endif
|
2009-10-29 16:57:27 +01:00
|
|
|
ifeq "$(ENGINE)" "left4dead2"
|
|
|
|
HL2SDK = $(HL2SDK_L4D2)
|
|
|
|
HL2PUB = $(HL2SDK)/public
|
|
|
|
HL2LIB = $(HL2SDK)/lib/linux
|
2012-08-20 20:25:56 +02:00
|
|
|
CFLAGS += -DSOURCE_ENGINE=9
|
2009-10-29 16:57:27 +01:00
|
|
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
|
|
BINARY = metamod.2.l4d2.so
|
2010-04-23 22:55:51 +02:00
|
|
|
LIB_PREFIX = lib
|
2013-06-30 16:39:04 +02:00
|
|
|
LIB_SUFFIX = _srv.so
|
2009-10-29 16:57:27 +01:00
|
|
|
override ENGSET = true
|
|
|
|
endif
|
2012-05-26 23:07:26 +02:00
|
|
|
ifeq "$(ENGINE)" "csgo"
|
|
|
|
HL2SDK = $(HL2SDK_CSGO)
|
|
|
|
HL2PUB = $(HL2SDK)/public
|
|
|
|
HL2LIB = $(HL2SDK)/lib/linux
|
2012-08-20 20:25:56 +02:00
|
|
|
CFLAGS += -DSOURCE_ENGINE=12
|
2012-05-26 23:07:26 +02:00
|
|
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
|
|
BINARY = metamod.2.csgo.so
|
|
|
|
LIB_PREFIX = lib
|
|
|
|
LIB_SUFFIX = .so
|
|
|
|
override ENGSET = true
|
|
|
|
endif
|
2008-11-14 11:04:02 +01:00
|
|
|
|
2012-05-26 23:07:26 +02:00
|
|
|
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \
|
2012-08-20 20:25:56 +02:00
|
|
|
-DSE_CSS=6 -DSE_ORANGEBOXVALVE=7 -DSE_LEFT4DEAD=8 -DSE_LEFT4DEAD2=9 -DSE_ALIENSWARM=10 \
|
|
|
|
-DSE_PORTAL2=11 -DSE_CSGO=12
|
2008-11-17 07:57:17 +01:00
|
|
|
|
2012-10-26 17:19:02 +02:00
|
|
|
ifeq "$(ENGINE)" "csgo"
|
|
|
|
LINK += $(HL2LIB)/interfaces_i486.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
LINK += $(HL2LIB)/tier1_i486.a $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) $(LIB_PREFIX)tier0$(LIB_SUFFIX) \
|
2010-04-23 22:55:51 +02:00
|
|
|
-static-libgcc
|
2008-11-14 11:04:02 +01:00
|
|
|
|
2011-04-27 18:49:25 +02:00
|
|
|
INCLUDE += -I. -I.. -I../public -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
|
2008-11-16 06:46:27 +01:00
|
|
|
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I. -Isourcehook -I../loader
|
2008-11-14 11:04:02 +01:00
|
|
|
|
2012-05-26 23:07:26 +02:00
|
|
|
CFLAGS += -D_LINUX -DPOSIX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
2008-11-14 11:04:02 +01:00
|
|
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
2012-05-26 23:07:26 +02:00
|
|
|
-Dstrcmpi=strcasecmp -Wall -Werror -Wno-uninitialized -mfpmath=sse -msse -DHAVE_STDINT_H -m32 \
|
|
|
|
-DCOMPILER_GCC
|
2008-11-14 11:04:02 +01:00
|
|
|
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|
|
|
|
|
|
|
################################################
|
|
|
|
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
|
|
|
################################################
|
|
|
|
|
|
|
|
ifeq "$(DEBUG)" "true"
|
|
|
|
BIN_DIR = Debug.$(ENGINE)
|
|
|
|
CFLAGS += $(C_DEBUG_FLAGS)
|
|
|
|
else
|
|
|
|
BIN_DIR = Release.$(ENGINE)
|
|
|
|
CFLAGS += $(C_OPT_FLAGS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
|
|
|
ifeq "$(GCC_VERSION)" "4"
|
|
|
|
CFLAGS += $(C_GCC4_FLAGS)
|
|
|
|
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|
|
|
OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
|
|
|
|
|
|
|
|
$(BIN_DIR)/%.o: %.cpp
|
|
|
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
$(BIN_DIR)/%.o: %.c
|
|
|
|
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
all: check
|
|
|
|
mkdir -p $(BIN_DIR)
|
2008-11-14 11:14:35 +01:00
|
|
|
mkdir -p $(BIN_DIR)/provider
|
|
|
|
mkdir -p $(BIN_DIR)/sourcehook
|
2010-04-23 22:55:51 +02:00
|
|
|
ln -sf $(HL2LIB)/$(LIB_PREFIX)vstdlib$(LIB_SUFFIX)
|
|
|
|
ln -sf $(HL2LIB)/$(LIB_PREFIX)tier0$(LIB_SUFFIX)
|
2008-11-14 11:04:02 +01:00
|
|
|
$(MAKE) -f Makefile metamod
|
|
|
|
|
|
|
|
check:
|
2008-12-08 06:49:13 +01:00
|
|
|
if [ "$(ENGSET)" = "false" ]; then \
|
2009-10-29 22:23:25 +01:00
|
|
|
echo "You must supply one of the following values for ENGINE:"; \
|
2012-08-20 20:25:56 +02:00
|
|
|
echo "csgo, left4dead2, left4dead, orangeboxvalve, css or orangebox"; \
|
2008-11-14 11:04:02 +01:00
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
metamod: check $(OBJ_LINUX)
|
|
|
|
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
|
|
|
|
|
|
debug:
|
|
|
|
$(MAKE) -f Makefile all DEBUG=true
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
|
|
|
clean: check
|
|
|
|
rm -rf $(BIN_DIR)/*.o
|
2008-11-14 11:14:35 +01:00
|
|
|
rm -rf $(BIN_DIR)/sourcehook/*.o
|
|
|
|
rm -rf $(BIN_DIR)/provider/*.o
|
2008-11-14 11:04:02 +01:00
|
|
|
rm -rf $(BIN_DIR)/$(BINARY)
|
2008-11-14 11:14:35 +01:00
|
|
|
|