forked from snipersim/snipersim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.config
67 lines (59 loc) · 1.17 KB
/
Makefile.config
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
ARCH_QUERY=$(shell uname -m)
ifeq ($(ARCH_QUERY),i686)
SNIPER_TARGET_ARCH = ia32
else
ifeq ($(ARCH_QUERY),x86_64)
SNIPER_TARGET_ARCH ?= intel64
#SNIPER_TARGET_ARCH = ia32
else
$(error Unknown target arch: $(ARCH_QUERY))
endif
endif
export SIM_ROOT
PIN_HOME ?= $(SIM_ROOT)/pin_kit
SDE_HOME ?= $(SIM_ROOT)/sde_kit
ifneq (,$(USE_SDE))
PIN_HOME := $(SIM_ROOT)/sde_kit/pinkit
SDE_BUILD_KIT := $(SDE_HOME)
export SDE_BUILD_KIT
else
undefine SDE_HOME
undefine SDE_BUILD_KIT
endif
PIN_ROOT := $(PIN_HOME)
export PIN_ROOT
XED_INSTALL ?= $(SIM_ROOT)/xed
XED_HOME ?= $(SIM_ROOT)/xed_kit
RV8_HOME ?= $(SIM_ROOT)/../rv8
ifeq ($(wildcard $(RV8_HOME)),)
BUILD_RISCV ?= 0
else
BUILD_RISCV ?= 1
endif
ifeq ($(wildcard $(CAPSTONE_ROOT)),)
BUILD_ARM ?= 0
else
BUILD_ARM ?= 1
endif
CC ?= gcc
CXX ?= g++
CXX_MAJOR_VER=$(shell $(CXX) --version | head -n 1 | rev | cut -d ' ' -f 1 | rev | cut -d . -f 1)
ifeq ($(CXX_MAJOR_VER),4)
$(error Sniper requires GCC >= 5)
endif
ifneq ($(DEBUG_SHOW_COMPILE),)
SHOW_COMPILE=1
MAKE_QUIET=
_MSG=@echo >/dev/null
_CMD=
else
SHOW_COMPILE=
MAKE_QUIET=--quiet
_MSG=@echo
_CMD=@
endif
ifneq ($(DEBUG),)
OPT_CFLAGS = -O0 -g
else
OPT_CFLAGS = -O2 -g
endif