forked from intel/kernel-fuzzer-for-xen-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.manual
88 lines (69 loc) · 1.83 KB
/
Makefile.manual
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
84
85
86
87
APP_FUZZER=kfx
APP_FORKVM=forkvm
APP_RWMEM=rwmem
ifeq ($(local),y)
XEN_ROOT=/home/$(USER)/dev/xen.clone.4.14.git
XEN_DIST=$(XEN_ROOT)/dist/install/root/dist/xen
KFX_ROOT=/home/$(USER)/dev/FUZZ/kfx.git
else
XEN_DIST=/root/dist/xen
KFX_ROOT=/root/kfx.git
endif
LIBVMI_ROOT=$(KFX_ROOT)/libvmi
LIBXDC_ROOT=$(KFX_ROOT)/libxdc
XEN_INCLUDE=$(XEN_DIST)/include
XEN_LIB=$(XEN_DIST)/lib
CC=gcc
CFLAGS=-Wall -Wextra
ifeq ($(is_debug),y)
CFLAGS+=-g -O0
else
CFLAGS+=-O3
endif
CFLAGS+=-fstack-protector
CFLAGS+=-I. -Ilibvmi -I$(XEN_INCLUDE)
CFLAGS+=-I/usr/include/glib-2.0
CFLAGS+=-I$(KFX_ROOT)/capstone/include/capstone
ifeq ($(local),y)
CFLAGS+=-I/usr/lib/x86_64-linux-gnu/glib-2.0/include
else
CFLAGS+=-I/usr/lib/glib-2.0/include/
endif
CFLAGS+=-I$(LIBXDC_ROOT)
LDFLAGS+=-L$(XEN_ROOT)/tools/libs/ctrl -L$(XEN_LIB) -lxenctrl -lxenforeignmemory
LDFLAGS+=-L$(LIBVMI_ROOT)/libvmi/.libs -lvmi
LDFLAGS+=-lglib-2.0 -lcapstone
LDFLAGS+=-L$(LIBXDC_ROOT)/build -lxdc
LDFLAGS+=-lpthread
LDFLAGS+=-L$(XEN_ROOT)/tools/libs/store -lxenstore
APP_FUZZER_SOURCES=src/main.c \
src/private.c \
src/signal.c \
src/vmi.c \
src/setup.c \
src/afl.c \
src/tracer.c \
src/forkvm.c \
src/pv_no_cloning.c \
src/ptcov.c
APP_FUZZER_OBJS := $(patsubst %.c,%.o,$(APP_FUZZER_SOURCES))
APP_FORKVM_SOURCES=src/common.c \
src/forkvm.c \
src/forkvm_main.c
APP_FORKVM_OBJS := $(patsubst %.c,%.o,$(APP_FORKVM_SOURCES))
APP_RWMEM_SOURCES=src/common.c \
src/vmi.c \
src/rwmem.c
APP_RWMEM_OBJS := $(patsubst %.c,%.o,$(APP_RWMEM_SOURCES))
all: $(APP_FUZZER) $(APP_FORKVM) $(APP_RWMEM)
$(APP_FUZZER): $(APP_FUZZER_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
$(APP_FORKVM): $(APP_FORKVM_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
$(APP_RWMEM): $(APP_RWMEM_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
.PHONY=clean
clean:
rm $(APP_FUZZER_OBJS) $(APP_FUZZER)
rm $(APP_FORKVM_OBJS) $(APP_FORKVM)
rm $(APP_RWMEM_OBJS) $(APP_RWMEM)