2016-07-04 10:11:20 +03:00
|
|
|
COMPILER = /opt/intel/bin/icpc
|
|
|
|
SDKSRC = sdk
|
|
|
|
DIRSRC = src
|
|
|
|
NAME = metamod
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:11:20 +03:00
|
|
|
SRCFILES = src/api_hook.cpp src/api_info.cpp src/commands_meta.cpp src/conf_meta.cpp \
|
2016-07-04 13:11:25 +03:00
|
|
|
src/dllapi.cpp src/engine_api.cpp src/engineinfo.cpp src/game_support.cpp src/h_export.cpp src/linkplug.cpp \
|
2016-07-04 10:11:20 +03:00
|
|
|
src/log_meta.cpp src/meta_eiface.cpp src/metamod.cpp src/mlist.cpp src/mplayer.cpp \
|
|
|
|
src/mplugin.cpp src/mreg.cpp src/mutil.cpp src/osdep.cpp src/osdep_p.cpp src/reg_support.cpp src/sdk_util.cpp \
|
|
|
|
src/support_meta.cpp src/vdate.cpp src/osdep_linkent_linux.cpp src/osdep_detect_gamedll_linux.cpp
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 13:11:25 +03:00
|
|
|
OBJECTS = $(SRCFILES) lib/linux32/libaelf32.a
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:11:20 +03:00
|
|
|
LINK = -lm -ldl -static-intel -static-libgcc -no-intel-extensions
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:11:20 +03:00
|
|
|
OPT_FLAGS = -O3 -msse3 -no-prec-div -fp-model fast=2 -funroll-loops -fomit-frame-pointer -fno-stack-protector \
|
|
|
|
-D__METAMOD_BUILD__ -D__BUILD_FAST_METAMOD__ -D__INTERNALS_USE_REGPARAMS__
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:11:20 +03:00
|
|
|
INCLUDE = -I. -I$(DIRSRC) -I$(SDKSRC)/common -I$(SDKSRC)/engine -I$(SDKSRC)/dlls -I$(SDKSRC)/pm_shared
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:11:20 +03:00
|
|
|
BIN_DIR = Release
|
|
|
|
CFLAGS = $(OPT_FLAGS)
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:39:31 +03:00
|
|
|
CFLAGS += -g -DNDEBUG -Dlinux -D__linux__ -std=c++0x -shared -wd147,274 -fasm-blocks
|
2016-07-04 09:07:29 +03:00
|
|
|
|
2016-07-04 10:11:20 +03:00
|
|
|
OBJ_LINUX := $(OBJECTS:%.c=$(BIN_DIR)/%.o)
|
|
|
|
|
|
|
|
$(BIN_DIR)/%.o: %.c
|
|
|
|
$(COMPILER) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
all:
|
|
|
|
mkdir -p $(BIN_DIR)
|
|
|
|
mkdir -p $(BIN_DIR)/sdk
|
|
|
|
|
|
|
|
$(MAKE) $(NAME) && strip -x $(BIN_DIR)/$(NAME).so
|
|
|
|
|
|
|
|
$(NAME): $(OBJ_LINUX)
|
|
|
|
$(COMPILER) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o$(BIN_DIR)/$(NAME).so
|
|
|
|
|
|
|
|
check:
|
|
|
|
cppcheck $(INCLUDE) --quiet --max-configs=100 -D__linux__ -DNDEBUG -DHAVE_STDINT_H .
|
|
|
|
|
|
|
|
debug:
|
|
|
|
$(MAKE) all DEBUG=false
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf Release/*.o
|
|
|
|
rm -rf Release/$(NAME).so
|
|
|
|
rm -rf Debug/*.o
|
|
|
|
rm -rf Debug/$(NAME).so
|