-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
83 lines (67 loc) · 1.74 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
##
## compiling under ubuntu:
## for compiling linux: make
## for compiling win32: make OSTYPE=win32
##
## borrowed from: https://github.com/Bots-United/jk_botti
##
ifeq ($(OSTYPE),win32)
CPP = i686-w64-mingw32-gcc -m32
LINKFLAGS = -mdll -lm -Xlinker -add-stdcall-alias -s
DLLEND = .dll
else
CPP = gcc -m32
ARCHFLAG = -fPIC
LINKFLAGS = -fPIC -shared -ldl -lm -s
DLLEND = .so
endif
TARGET = foxbot
BASEFLAGS = -Wall -Wno-write-strings -Wno-attributes -Wno-unused-function \
-std=gnu++17 -static-libstdc++ -shared-libgcc
ARCHFLAG += -march=i686 -mtune=generic -msse -msse2 -mmmx -mfpmath=sse
ifeq ($(DBG_FLGS),1)
OPTFLAGS = -O0 -g3 -ggdb3 -D_DEBUG
else
OPTFLAGS = -O2 -fomit-frame-pointer -g0
OPTFLAGS += -funsafe-math-optimizations
LINKFLAGS += ${OPTFLAGS}
endif
INCLUDES = -I"./metamod" \
-I"./hlsdk/common" \
-I"./hlsdk/dlls" \
-I"./hlsdk/engine" \
-I"./hlsdk/pm_shared"
CFLAGS = ${BASEFLAGS} ${OPTFLAGS} ${ARCHFLAG} ${INCLUDES}
CPPFLAGS += -fno-rtti -fno-exceptions -fno-threadsafe-statics ${CFLAGS}
SRC = bot.cpp \
bot_client.cpp \
bot_combat.cpp \
bot_job_assessors.cpp \
bot_job_functions.cpp \
bot_job_think.cpp \
bot_navigate.cpp \
bot_start.cpp \
botcam.cpp \
dll.cpp \
engine.cpp \
h_export.cpp \
linkfunc.cpp \
meta_api.cpp \
sdk_util.cpp \
util.cpp \
version.cpp \
waypoint.cpp
OBJ = $(SRC:%.cpp=%.o)
${TARGET}${DLLEND}: ${OBJ}
${CPP} -o $@ ${OBJ} ${LINKFLAGS}
cp $@ addons/foxbot/bin/
clean:
rm -f *.o ${TARGET}${DLLEND} Rules.depend
distclean:
rm -f Rules.depend ${TARGET}.dll ${TARGET}.so addons/foxbot/bin/*
%.o: %.cpp
${CPP} ${CPPFLAGS} -c $< -o $@
depend: Rules.depend
Rules.depend: Makefile $(SRC)
$(CPP) -MM ${INCLUDES} $(SRC) > $@
include Rules.depend