2007-05-04 16:51:13 +04:00
|
|
|
#(C)2004-2005 AMX Mod X Development Team
|
|
|
|
# Makefile written by David "BAILOPAN" Anderson
|
|
|
|
|
|
|
|
HLSDK = ../../../hlsdk
|
2010-04-05 04:55:37 +04:00
|
|
|
MM_ROOT = ../../../metamod/metamod
|
2007-05-04 16:51:13 +04:00
|
|
|
|
|
|
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
|
|
|
|
|
|
|
|
2007-05-16 19:24:14 +04:00
|
|
|
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing -DNDEBUG
|
2007-05-04 16:51:13 +04:00
|
|
|
|
|
|
|
DEBUG_FLAGS = -g -ggdb3
|
|
|
|
CPP = gcc-4.1
|
|
|
|
#CPP = gcc-2.95
|
|
|
|
NAME = hamsandwich
|
|
|
|
|
|
|
|
BIN_SUFFIX = amxx_i386.so
|
|
|
|
|
|
|
|
OBJECTS = sdk/amxxmodule.cpp amxx_api.cpp config_parser.cpp \
|
|
|
|
hook_callbacks.cpp hook_native.cpp srvcmd.cpp \
|
2007-05-13 17:59:54 +04:00
|
|
|
call_funcs.cpp hook_create.cpp DataHandler.cpp pdata.cpp
|
2007-05-04 16:51:13 +04:00
|
|
|
|
|
|
|
|
|
|
|
LINK =
|
|
|
|
|
|
|
|
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
2008-08-17 03:24:25 +04:00
|
|
|
-I$(MM_ROOT) -I$(HLSDK)/common -I$(HLSDK)/pm_shared -I./tableentries -Isdk
|
2007-05-04 16:51:13 +04:00
|
|
|
|
|
|
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
|
|
|
|
|
|
|
ifeq "$(DEBUG)" "true"
|
|
|
|
BIN_DIR = Debug
|
|
|
|
CFLAGS = $(DEBUG_FLAGS)
|
|
|
|
else
|
2007-05-16 19:24:14 +04:00
|
|
|
BIN_DIR = Release
|
|
|
|
|
2007-05-04 16:51:13 +04:00
|
|
|
ifeq "$(GCC_VERSION)" "4"
|
2007-05-16 07:57:18 +04:00
|
|
|
OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
|
2007-05-04 16:51:13 +04:00
|
|
|
endif
|
|
|
|
CFLAGS = $(OPT_FLAGS)
|
|
|
|
endif
|
|
|
|
|
2008-08-16 13:48:39 +04:00
|
|
|
CFLAGS += -Wall -Wno-non-virtual-dtor -fno-exceptions -DHAVE_STDINT_H -fno-rtti -Werror -m32
|
2007-05-04 16:51:13 +04:00
|
|
|
|
|
|
|
BINARY = $(NAME)_$(BIN_SUFFIX)
|
|
|
|
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
|
|
|
OPT_FLAGS += -march=i586
|
|
|
|
|
|
|
|
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|
|
|
|
|
|
|
$(BIN_DIR)/%.o: %.cpp
|
|
|
|
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
all:
|
|
|
|
mkdir -p $(BIN_DIR)
|
|
|
|
mkdir -p $(BIN_DIR)/sdk
|
|
|
|
$(MAKE) hamsandwich
|
|
|
|
|
|
|
|
hamsandwich: $(OBJ_LINUX)
|
|
|
|
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
|
|
|
|
|
|
debug:
|
|
|
|
$(MAKE) all DEBUG=true
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf Release/*.o
|
|
|
|
rm -rf Release/sdk/*.o
|
|
|
|
rm -rf Release/$(NAME)_$(BIN_SUFFIX)
|
|
|
|
rm -rf Debug/*.o
|
|
|
|
rm -rf Debug/sdk/*.o
|
|
|
|
rm -rf Debug/$(NAME)_$(BIN_SUFFIX)
|
|
|
|
|