2007-05-04 12:51:13 +00:00
|
|
|
#(C)2004-2005 AMX Mod X Development Team
|
|
|
|
# Makefile written by David "BAILOPAN" Anderson
|
|
|
|
|
|
|
|
HLSDK = ../../../hlsdk
|
2010-04-05 00:55:37 +00:00
|
|
|
MM_ROOT = ../../../metamod/metamod
|
2007-05-04 12:51:13 +00:00
|
|
|
|
|
|
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
|
|
|
|
|
|
|
|
2007-05-16 15:24:14 +00:00
|
|
|
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing -DNDEBUG
|
2007-05-04 12:51:13 +00: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 13:59:54 +00:00
|
|
|
call_funcs.cpp hook_create.cpp DataHandler.cpp pdata.cpp
|
2007-05-04 12:51:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
LINK =
|
|
|
|
|
|
|
|
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
2008-08-16 23:24:25 +00:00
|
|
|
-I$(MM_ROOT) -I$(HLSDK)/common -I$(HLSDK)/pm_shared -I./tableentries -Isdk
|
2007-05-04 12:51:13 +00:00
|
|
|
|
|
|
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
|
|
|
|
|
|
|
ifeq "$(DEBUG)" "true"
|
|
|
|
BIN_DIR = Debug
|
|
|
|
CFLAGS = $(DEBUG_FLAGS)
|
|
|
|
else
|
2007-05-16 15:24:14 +00:00
|
|
|
BIN_DIR = Release
|
|
|
|
|
2007-05-04 12:51:13 +00:00
|
|
|
ifeq "$(GCC_VERSION)" "4"
|
2007-05-16 03:57:18 +00:00
|
|
|
OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
|
2007-05-04 12:51:13 +00:00
|
|
|
endif
|
|
|
|
CFLAGS = $(OPT_FLAGS)
|
|
|
|
endif
|
|
|
|
|
2008-08-16 09:48:39 +00:00
|
|
|
CFLAGS += -Wall -Wno-non-virtual-dtor -fno-exceptions -DHAVE_STDINT_H -fno-rtti -Werror -m32
|
2007-05-04 12:51:13 +00: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)
|
|
|
|
|