-
Notifications
You must be signed in to change notification settings - Fork 9
/
makefile.rules
333 lines (277 loc) · 8.78 KB
/
makefile.rules
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
##############################################################
#
# This file includes all the test targets as well as all the
# non-default build rules and test recipes.
#
##############################################################
###### Additional includes that are specific to this directory ######
# Placeholder for additional include files.
##############################################################
#
# Test targets
#
##############################################################
###### Place all generic definitions here ######
# This defines tests which run tools of the same name. This is simply for convenience to avoid
# defining the test name twice (once in TOOL_ROOTS and again in TEST_ROOTS).
# Tests defined here should not be defined in TOOL_ROOTS and TEST_ROOTS.
TEST_TOOL_ROOTS :=
# This defines the tests to be run that were not already defined in TEST_TOOL_ROOTS.
TEST_ROOTS :=
# This defines a list of tests that should run in the "short" sanity. Tests in this list must also
# appear either in the TEST_TOOL_ROOTS or the TEST_ROOTS list.
# If the entire directory should be tested in sanity, assign TEST_TOOL_ROOTS and TEST_ROOTS to the
# SANITY_SUBSET variable in the tests section below (see example in makefile.rules.tmpl).
SANITY_SUBSET :=
# This defines the tools which will be run during the the tests, and were not already defined in
# TEST_TOOL_ROOTS.
TOOL_ROOTS := gentrace bpt
# This defines the static analysis tools which will be run during the the tests. They should not
# be defined in TEST_TOOL_ROOTS. If a test with the same name exists, it should be defined in
# TEST_ROOTS.
# Note: Static analysis tools are in fact executables linked with the Pin Static Analysis Library.
# This library provides a subset of the Pin APIs which allows the tool to perform static analysis
# of an application or dll. Pin itself is not used when this tool runs.
SA_TOOL_ROOTS :=
# This defines all the applications that will be run during the tests.
APP_ROOTS :=
# This defines any additional object files that need to be compiled.
OBJECT_ROOTS :=
# This defines any additional dlls (shared objects), other than the pintools, that need to be compiled.
DLL_ROOTS :=
# This defines any static libraries (archives), that need to be built.
LIB_ROOTS :=
###### Place architecture-specific definitions here ######
# Place ia32-specific definitions here if they apply to all supported operating systems.
ifeq ($(TARGET),ia32)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
# Place intel64-specific definitions here if they apply to all supported operating systems.
ifeq ($(TARGET),intel64)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
###### Place probe mode tests here ######
ifeq ($(PROBE),1)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
###### Place OS-specific definitions here ######
# Android
ifeq ($(TARGET_OS),android)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
ifeq ($(TARGET),ia32)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
ifeq ($(TARGET),intel64)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
endif
# Linux
ifeq ($(TARGET_OS),linux)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
ifeq ($(TARGET),ia32)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
ifeq ($(TARGET),intel64)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
endif
# Mac
ifeq ($(TARGET_OS),mac)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
ifeq ($(TARGET),ia32)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
ifeq ($(TARGET),intel64)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
endif
# Windows
ifeq ($(TARGET_OS),windows)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
ifeq ($(TARGET),ia32)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
ifeq ($(TARGET),intel64)
TEST_TOOL_ROOTS +=
TEST_ROOTS +=
SANITY_SUBSET +=
TOOL_ROOTS +=
SA_TOOL_ROOTS +=
APP_ROOTS +=
OBJECT_ROOTS +=
DLL_ROOTS +=
LIB_ROOTS +=
endif
endif
###### Handle exceptions here ######
# If some tests need to be disabled, do this here
##############################################################
#
# Test recipes
#
##############################################################
###### Finalize sanity here ######
# If all tests in this directory should run in sanity, uncomment the following line.
# SANITY_SUBSET := $(TEST_TOOL_ROOTS) $(TEST_ROOTS)
# This section contains recipes for tests other than the default.
# See makefile.default.rules for the default test rules.
# All tests in this section should adhere to the naming convention: <testname>.test
##############################################################
#
# Build rules
#
##############################################################
# This section contains the build rules for all binaries that have special build rules.
# See makefile.default.rules for the default build rules.
###### Special tools' build rules ######
# placeholder for special tools' build rules
###### Special applications' build rules ######
# placeholder for special applications' build rules
###### Special objects' build rules ######
# placeholder for special objects' build rules
###### Special dlls' build rules ######
# placeholder for special dlls' build rules
ifeq ($(COMPILER),gcc)
TOOL_CXXFLAGS += -Wno-error
endif
ifeq ($(TARGET_OS),windows)
TOOL_CXXFLAGS += -Iddk-inc
endif
TOOL_LIBS += -L$(HOME)/opt/libtrace/lib -ltrace -lprotobuf -lz -lpthread -lcrypto++ -lboost_filesystem
TOOL_CXXFLAGS += -DUSING_PIN -I$(HOME)/opt/libtrace/include
BAPOBJS = $(OBJDIR)pivot$(OBJ_SUFFIX) \
$(OBJDIR)pin_misc$(OBJ_SUFFIX) \
$(OBJDIR)pin_taint$(OBJ_SUFFIX) \
$(OBJDIR)reg_mapping_pin$(OBJ_SUFFIX) \
$(OBJDIR)winsyscalls$(OBJ_SUFFIX)
$(OBJDIR)gentrace$(PINTOOL_SUFFIX): $(OBJDIR)gentrace$(OBJ_SUFFIX) $(BAPOBJS) $(LIBTRACE)
$(LINKER) $(TOOL_LDFLAGS) $(LINK_EXE)$(OBJDIR)gentrace$(PINTOOL_SUFFIX) $^ $(TOOL_LPATHS) $(TOOL_LIBS)
BPTOBJS = $(OBJDIR)bpt$(OBJ_SUFFIX) \
$(OBJDIR)bpt_args_list$(OBJ_SUFFIX) \
$(OBJDIR)bpt_inspection$(OBJ_SUFFIX) \
$(OBJDIR)bpt_events$(OBJ_SUFFIX) \
$(OBJDIR)bpt_bytes_io$(OBJ_SUFFIX) \
$(OBJDIR)bpt_modload_event$(OBJ_SUFFIX) \
$(OBJDIR)bpt_syscall_event$(OBJ_SUFFIX) \
$(OBJDIR)bpt_operation_event$(OBJ_SUFFIX) \
$(OBJDIR)bpt_register_events$(OBJ_SUFFIX) \
$(OBJDIR)bpt_flags_events$(OBJ_SUFFIX) \
$(OBJDIR)bpt_memory_events$(OBJ_SUFFIX) \
$(OBJDIR)bpt_inst_counter$(OBJ_SUFFIX) \
$(OBJDIR)bpt_writer_text$(OBJ_SUFFIX) \
$(OBJDIR)bpt_writer_frames$(OBJ_SUFFIX)
$(OBJDIR)bpt$(PINTOOL_SUFFIX): $(OBJDIR)bpt_main$(OBJ_SUFFIX) $(BPTOBJS) $(LIBTRACE)
$(LINKER) $(TOOL_LDFLAGS) $(LINK_EXE)$(OBJDIR)bpt$(PINTOOL_SUFFIX) $^ $(TOOL_LPATHS) $(TOOL_LIBS)
###### Special libs' build rules ######
# placeholder for special libs' build rules