forked from taviso/loadlibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 991 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
CFLAGS = -O3 -march=native -ggdb3 -m32 -std=gnu99 -fshort-wchar -Wno-multichar -Iinclude -mstackrealign
CPPFLAGS=-DNDEBUG -D_GNU_SOURCE -I. -Iintercept -Ipeloader
LDFLAGS = $(CFLAGS) -m32 -lm -Wl,--dynamic-list=exports.lst
LDLIBS = intercept/libdisasm.a -Wl,--whole-archive,peloader/libpeloader.a,--no-whole-archive
.PHONY: clean peloader intercept
TARGETS=mpclient
all: $(TARGETS)
-mkdir -p faketemp
intercept:
make -C intercept all
peloader:
make -C peloader all
script.h: javascript.txt
hexdump -v -e '8/1 "%#02x," "\n"' < $^ > $@
mpscript.o: script.h
intercept/hook.o: intercept
mpclient: mpclient.o intercept/hook.o | peloader
$(CC) $(CFLAGS) $^ -o $@ $(LDLIBS) $(LDFLAGS)
# mpscript requires libreadline-dev:i386
mpscript: mpscript.o intercept/hook.o | peloader
$(CC) $(CFLAGS) $^ -o $@ $(LDLIBS) $(LDFLAGS) -lreadline
clean:
rm -f a.out core *.o core.* vgcore.* gmon.out script.h mpclient mpscript
make -C intercept clean
make -C peloader clean
rm -rf faketemp