-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
50 lines (35 loc) · 973 Bytes
/
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
CC=g++.exe
CFLAGS=-Wall
ODIR=./obj
BDIR=./bin
LIBS=-lmingw32
MKDIR_P=mkdir -p
all: directories hack copy
copy:
cp ./bin/hack.dll ./injector
# Directories that need to exist (that are not in the repository) are created here
directories: $(ODIR) $(BDIR)
$(ODIR):
$(MKDIR_P) $(ODIR)
$(BDIR):
$(MKDIR_P) $(BDIR)
# End directories
# All header files that need to be compiled go here
HL_COMMON=$(wildcard ./HLSDK/common/*.h)
HL_ENGINE=$(wildcard ./HLSDK/engine/*.h)
HL_MISC=$(wildcard ./HLSDK/misc/*.h)
DEPS=SDK.h $(HL_COMMON) $(HL_ENGINE) $(HL_MISC)
# All object files (which correspond to compiled .c files) go here
_OBJ=hack.o
OBJ=$(patsubst %,$(ODIR)/%,$(_OBJ))
$(ODIR)/%.o:./%.cpp $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
# $@ means left side of :
# $^ means right side of :
# -shared to make a dll
# -fPIC for position independent code
hack: $(OBJ)
$(CC) -shared -fPIC -o ./bin/[email protected] $^ $(CFLAGS) $(LIBS)
.PHONY: clean directories
clean:
rm -f $(ODIR)/*.o