forked from nyx-fuzz/libxdc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (27 loc) · 1.05 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
IDIR =../include
CC=gcc
CFLAGS= -g -Ofast -fPIC -fvisibility=hidden -flto -finline-functions #-fprofile-use=program.gcda #-fprofile-generate #-g -fsanitize=address
LDFLAGS=-flto
ODIR=build
SDIR=src
LDIR =build
_OBJ = cfg.o disassembler.o tnt_cache.o decoder.o libxdc.o mmh3.o trace_cache.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
default: tester_dyn tester_static
$(ODIR)/%.o: $(SDIR)/%.c $(SDIR)/*.h libxdc.h
mkdir -p build
$(CC) -c -o $@ $< $(CFLAGS)
dynlib: $(OBJ)
$(CC) $^ -o build/libxdc.so -shared $(CFLAGS) $(LDFLAGS) -l:libcapstone.so.4
staticlib: $(OBJ)
ar rcs build/libxdc.a $^
tester_dyn: dynlib test/*.c test/*.h
$(CC) test/tester.c test/page_cache.c test/helper.c -o build/tester -Itest/ -I./ -Lbuild/ -lxdc $(CFLAGS) $(LDFLGAS)
tester_static: staticlib test/*.c test/*.h
$(CC) test/tester.c test/page_cache.c test/helper.c -o build/tester_static -Itest/ -I./ -Lbuild/ -l:libxdc.a -l:libcapstone.so.4 $(CFLAGS) $(LDFLAGS)
install: dynlib
cp libxdc.h /usr/include/
cp build/libxdc.so /usr/lib/
.PHONY: clean
clean:
rm -f $(ODIR)/*.o build/*