-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
48 lines (34 loc) · 1.24 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
.PHONY: all clean cvars
.FORCE:
CXX=g++-10
SDIR=src
ODIR=obj
SRCS=$(wildcard $(SDIR)/*.cpp)
SRCS+=$(wildcard $(SDIR)/Features/*.cpp)
SRCS+=$(wildcard $(SDIR)/Features/Modifiers/*.cpp)
SRCS+=$(wildcard $(SDIR)/Offsets/*.cpp)
SRCS+=$(wildcard $(SDIR)/Offsets/Linux/*.cpp)
SRCS+=$(wildcard $(SDIR)/Modules/*.cpp)
SRCS+=$(wildcard $(SDIR)/Utils/*.cpp)
OBJS=$(patsubst $(SDIR)/%.cpp, $(ODIR)/%.o, $(SRCS))
# VERSION=$(shell git describe --tags)
VERSION=1.1
# Header dependency target files; generated by g++ with -MMD
DEPS=$(OBJS:%.o=%.d)
WARNINGS=-Wall -Wno-unused-function -Wno-unused-variable -Wno-parentheses -Wno-unknown-pragmas -Wno-register -Wno-sign-compare
CXXFLAGS=-std=c++17 -m32 $(WARNINGS) -I$(SDIR) -fPIC -D_GNU_SOURCE -DSFML_STATIC -DCURL_STATICLIB
LDFLAGS=-m32 -shared -lstdc++fs
# Import config.mk, which can be used for optional config
-include config.mk
all: krzymod.so
clean:
rm -rf $(ODIR) krzymod.so src/Version.hpp
-include $(DEPS)
krzymod.so: src/Version.hpp $(OBJS)
$(CXX) $^ $(LDFLAGS) -o $@
$(ODIR)/%.o: $(SDIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -MMD -c $< -o $@
src/Version.hpp: .FORCE
echo "#define PLUGIN_VERSION \"$(VERSION)\"" >"$@"
if [ -z "$$RELEASE_BUILD" ]; then echo "#define PLUGIN_DEV_BUILD 1" >>"$@"; fi