Debian Codegraph @

test/pptrace/comparison/programs/md/pin/Makefile

raw
1 # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis
2 # See COPYING in top-level directory.
3
4 BINARIES=my_pin.so
5
6 LIBINSTRUMENT_ROOT=$(realpath ../../../instrument/libinstrument-real)
7
8 PIN_ROOT=$(shell printenv PIN_ROOT)
9 LIBDWARF_DIR=$(shell printenv DWARF_LIBDIR)
10
11 PIN_CFLAGS=-DTARGET_IA32E -DFUND_TC_HOSTCPU=FUND_CPU_INTEL64 -DFUND_TC_TARGETCPU=FUND_CPU_INTEL64 -DTARGET_LINUX -DFUND_TC_HOSTOS=FUND_OS_LINUX -DFUND_TC_TARGETOS=FUND_OS_LINUX \
12 -fpermissive \
13 -I$(PIN_ROOT)/source/InstLib -I$(PIN_ROOT)/extras/xed2-intel64/include -I$(PIN_ROOT)/extras/components/include -I$(PIN_ROOT)/source/include -I$(PIN_ROOT)/source/include/gen
14 LIBINSTRUMENT_CFLAGS=-I$(LIBINSTRUMENT_ROOT)
15 LIBINSTRUMENT_DUMMY_CFLAGS=-I$(LIBINSTRUMENT_SIMPLE_ROOT)
16
17 PIN_LDFLAGS=-Wl,--version-script=$(PIN_ROOT)/source/include/pintool.ver -L../Lib/ -L../ExtLib/ -L$(PIN_ROOT)/extras/xed2-intel64/lib -L$(PIN_ROOT)/intel64/lib -L$(PIN_ROOT)/intel64/lib-ext \
18 -Wl,--rpath,$(PIN_ROOT)/extras/xed2-intel64/lib/ -L$(PIN_ROOT)/extras/xed2-intel64/lib/\
19 -lpin -lxed -lelf -ldl -Wl,--rpath,$(LIBDWARF_DIR) -L$(LIBDWARF_DIR) -ldwarf
20
21 LIBINSTRUMENT_LDFLAGS=-Wl,--rpath,$(LIBINSTRUMENT_ROOT) -L$(LIBINSTRUMENT_ROOT) -linstrument
22
23 all: $(BINARIES)
24
25 my_pin.so: my_pin.cpp
26 g++ -shared -o my_pin.so -fPIC my_pin.cpp $(PIN_CFLAGS) $(PIN_LDFLAGS) $(LIBINSTRUMENT_CFLAGS) $(LIBINSTRUMENT_LDFLAGS)
27
28 run:
29 @for i in $(TARGETS); do \
30 echo ================================================================================; \
31 echo Running PIN on `basename $$i` for real-life instrumentation; \
32 echo ================================================================================; \
33 echo; \
34 for j in {1..$(NBRUNS)}; do \
35 $(PIN_ROOT)/pin -t my_pin.so -- $$i | grep seconds | xargs echo | cut -f 1 -d " " | xargs echo -n; \
36 echo -n " "; \
37 done; \
38 echo; \
39 done
40
41 clean:
42 rm -f *.o $(BINARIES)
43