-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·99 lines (72 loc) · 2.54 KB
/
Makefile
File metadata and controls
executable file
·99 lines (72 loc) · 2.54 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
PIN_KIT=/path/to/pin
##
## PIN tools
##
##############################################################
#
# Here are some things you might want to configure
#
##############################################################
TARGET_COMPILER?=gnu
ifdef OS
ifeq (${OS},Windows_NT)
TARGET_COMPILER=ms
endif
endif
##############################################################
#
# include *.config files
#
##############################################################
ifeq ($(TARGET_COMPILER),gnu)
include ${PIN_KIT}/source/tools/makefile.gnu.config
LINKER?=${CXX}
CXXFLAGS ?= -g -Wall -Werror -Wno-unknown-pragmas $(DBG) $(OPT)
endif
ifeq ($(TARGET_COMPILER),ms)
include ${PIN_KIT}/source/tools/makefile.ms.config
DBG?=
endif
##############################################################
#
# Tools sets
#
##############################################################
TOOL_ROOTS = pincomm
STATIC_TOOL_ROOTS =
TOOLS = $(TOOL_ROOTS:%=$(OBJDIR)%$(PINTOOL_SUFFIX))
STATIC_TOOLS = $(STATIC_TOOL_ROOTS:%=$(OBJDIR)%$(SATOOL_SUFFIX))
##############################################################
#
# build rules
#
##############################################################
all: tools
tools: $(OBJDIR) $(TOOLS) $(STATIC_TOOLS)
test: $(OBJDIR) $(TOOL_ROOTS:%=%.test) $(STATIC_TOOL_ROOTS:%=%.test)
# stand alone pin tool
statica.test: $(OBJDIR)statica$(SATOOL_SUFFIX) statica.tested statica.failed $(OBJDIR)statica
./$(OBJDIR)statica$(SATOOL_SUFFIX) -i ./$(OBJDIR)statica > statica.dmp
rm statica.failed statica.dmp
replacesigprobed.test : $(OBJDIR)replacesigprobed$(PINTOOL_SUFFIX) replacesigprobed.tested replacesigprobed.failed
$(PIN) -probe -t $< -- $(TESTAPP) makefile $<.makefile.copy > $<.out 2>&1
rm replacesigprobed.failed $<.out $<.makefile.copy
## build rules
$(OBJDIR):
mkdir -p $(OBJDIR)
$(OBJDIR)%.o : %.cpp binstore/libbinstore.a
$(CXX) -c $(CXXFLAGS) $(PIN_CXXFLAGS) -Ibinstore ${OUTOPT}$@ $<
$(TOOLS): $(PIN_LIBNAMES) binstore/libbinstore.a Makefile
$(TOOLS): %$(PINTOOL_SUFFIX) : %.o
${LINKER} $(PIN_LDFLAGS) $(LINK_DEBUG) ${LINK_OUT}$@ $< ${PIN_LPATHS} $(PIN_LIBS) -Lbinstore -lbinstore -lz $(DBG)
$(STATIC_TOOLS): $(PIN_LIBNAMES)
$(STATIC_TOOLS): %$(SATOOL_SUFFIX) : %.o
${LINKER} $(PIN_SALDFLAGS) $(LINK_DEBUG) ${LINK_OUT}$@ $< ${PIN_LPATHS} $(SAPIN_LIBS) -Lbinstore -lbinstore -lz $(DBG)
## cleaning
clean:
-rm -rf $(OBJDIR) *.tested *.failed *.makefile.copy
example: example.c
gcc -g -O1 -o example example.c
demo: $(TOOLS) example
-$(PIN_KIT)/pin -t $(OBJDIR)/pincomm.so -- ./example
./pinprocess.py --groupby r