-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
53 lines (30 loc) · 1.1 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
cc = g++
flags = -Wall --std=c++11 -static-libgcc -static-libstdc++
dllflags = -Wall --std=c++11
ifeq ($(debug), true)
flags += -g
endif
all: rootkit test dll
rootkit_target = rootkit.exe
rootkit_cppsources = src/main.cpp src/dll_injector.cpp
rootkit_cppobjects = $(rootkit_cppsources:.cpp=.o)
rootkit: $(rootkit_cppobjects)
$(cc) $(flags) $(rootkit_cppobjects) -o $(rootkit_target) -Wl,-subsystem,windows
src/main.o: src/main.cpp
$(cc) $(flags) -c src/main.cpp -o src/main.o
src/dll_injector.o: src/dll_injector.cpp src/dll_injector.h
$(cc) $(flags) -c src/dll_injector.cpp -o src/dll_injector.o
dll_target = win-rootkit.dll
dll_cppsources = src/dllmain.cpp src/hook.cpp
dll_cppobjects = $(dll_cppsources:.cpp=.o)
dll: $(dll_cppobjects)
$(cc) $(dllflags) $(dll_cppobjects) -shared -o $(dll_target)
src/dllmain.o: src/dllmain.cpp
$(cc) $(dllflags) -c src/dllmain.cpp -o src/dllmain.o -DBUILDING_EXAMPLE_DLL
src/hook.o: src/hook.cpp
$(cc) $(dllflags) -c src/hook.cpp -o src/hook.o -DBUILDING_EXAMPLE_DLL
test_target=test.exe
test:
$(cc) $(flags) src/test.cpp -o $(test_target)
clean:
$(RM) src/*.o