-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
35 lines (26 loc) · 939 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
LIBNAME=fluxcapacitor_preload.so
TESTLIBNAME=fluxcapacitor_test.so
LOADERNAME=fluxcapacitor
LDOPTS+=-lrt -ldl -rdynamic
COPTS+=$(CFLAGS) -g -ggdb -Wall -Wextra -Wno-unused-parameter -O3 -fPIC
TESTLIB_FILES=src/testlib.c
LIB_FILES=src/preload.c
LOADER_FILES=src/wrapper.c src/parent.c src/misc.c src/uevent.c src/trace.c src/main.c
all: build test
.PHONY: build
build: $(TESTLIBNAME) $(LIBNAME) $(LOADERNAME)
$(TESTLIBNAME): Makefile $(TESTLIB_FILES)
$(CC) $(COPTS) $(TESTLIB_FILES) \
-fPIC -shared -Wl,-soname,$(TESTLIBNAME) -o $(TESTLIBNAME)
$(LIBNAME): Makefile $(LIB_FILES)
$(CC) $(COPTS) $(LIB_FILES) $(LDOPTS) \
-fPIC -shared -Wl,-soname,$(LIBNAME) -o $(LIBNAME)
$(LOADERNAME): Makefile $(LOADER_FILES)
$(CC) $(COPTS) $(LOADER_FILES) $(LDOPTS) \
-o $(LOADERNAME)
FCPATH ?= $(PWD)/$(LOADERNAME)
.PHONY:test
test:
FCPATH="$(FCPATH)" python2 tests/tests_basic.py
clean:
rm -f *.gcda *.so fluxcapacitor a.out gmon.out