blob: e529cdc4215d54a6e82788b3b992e6545f8dd999 [file] [log] [blame]
Nguyen Anh Quynhd03edf42014-03-02 10:20:37 +08001# This file contains all customized compile options for Capstone.
Nguyen Anh Quynh250ac092015-05-17 00:52:12 +08002# Consult COMPILE.TXT & docs/README for details.
Nguyen Anh Quynhd03edf42014-03-02 10:20:37 +08003
Nguyen Anh Quynhfc83a432014-02-22 23:26:27 +08004################################################################################
Nguyen Anh Quynh3b53fc42014-02-28 11:05:01 +08005# Specify which archs you want to compile in. By default, we build all archs.
danghvu6f52bf92013-12-19 22:43:01 -06006
Nguyen Anh Quynh52a8d2a2014-05-26 23:24:11 +08007CAPSTONE_ARCHS ?= arm aarch64 mips powerpc sparc systemz x86 xcore
Nguyen Anh Quynh7e5a6b52014-02-23 00:47:38 +08008
9
10################################################################################
Nguyen Anh Quynhe31327d2014-04-29 14:25:15 +080011# Comment out the line below ('CAPSTONE_USE_SYS_DYN_MEM = yes'), or change it to
12# 'CAPSTONE_USE_SYS_DYN_MEM = no' if do NOT use malloc/calloc/realloc/free/
13# vsnprintf() provided by system for internal dynamic memory management.
Nguyen Anh Quynh7e5a6b52014-02-23 00:47:38 +080014#
Nguyen Anh Quynhb6ece8d2014-03-07 21:46:45 +080015# NOTE: in that case, specify your own malloc/calloc/realloc/free/vsnprintf()
Nguyen Anh Quynh951e8e52014-03-01 23:24:09 +080016# functions in your program via API cs_option(), using CS_OPT_MEM option type.
Nguyen Anh Quynhd03edf42014-03-02 10:20:37 +080017
Nguyen Anh Quynhe31327d2014-04-29 14:25:15 +080018CAPSTONE_USE_SYS_DYN_MEM ?= yes
Nguyen Anh Quynh7e5a6b52014-02-23 00:47:38 +080019
20
21################################################################################
22# Change 'CAPSTONE_DIET = no' to 'CAPSTONE_DIET = yes' to make the library
23# more compact: use less memory & smaller in binary size.
Nguyen Anh Quynhd5ca1452014-02-24 22:13:29 +080024# This setup will remove the @mnemonic & @op_str data, plus semantic information
Nguyen Anh Quynh838b3782014-03-04 18:20:28 +080025# such as @regs_read/write & @group. The amount of binary size reduced is
26# up to 50% in some individual archs.
Nguyen Anh Quynh7e5a6b52014-02-23 00:47:38 +080027#
28# NOTE: we still keep all those related fileds @mnemonic, @op_str, @regs_read,
Nguyen Anh Quynhd5ca1452014-02-24 22:13:29 +080029# @regs_write, @groups, etc in fields in cs_insn structure regardless, but they
Nguyen Anh Quynh838b3782014-03-04 18:20:28 +080030# will not be updated (i.e empty), thus become irrelevant.
Nguyen Anh Quynhd03edf42014-03-02 10:20:37 +080031
Nguyen Anh Quynhdc09a9a2014-04-29 12:59:01 +080032CAPSTONE_DIET ?= no
Nguyen Anh Quynh95181482014-03-25 23:20:41 +080033
34
35################################################################################
Nguyen Anh Quynh59b54892014-03-27 10:54:44 +080036# Change 'CAPSTONE_X86_REDUCE = no' to 'CAPSTONE_X86_REDUCE = yes' to remove
Nguyen Anh Quynh6d3c7112014-03-27 15:38:23 +080037# non-critical instruction sets of X86, making the binary size smaller by ~60%.
Nguyen Anh Quynh95181482014-03-25 23:20:41 +080038# This is desired in special cases, such as OS kernel, where these kind of
39# instructions are not used.
40#
41# The list of instruction sets to be removed includes:
Nguyen Anh Quynh01d8a492014-03-26 14:49:19 +080042# - Floating Point Unit (FPU)
43# - MultiMedia eXtension (MMX)
44# - Streaming SIMD Extensions (SSE)
45# - 3DNow
46# - Advanced Vector Extensions (AVX)
47# - Fused Multiply Add Operations (FMA)
48# - eXtended Operations (XOP)
Nguyen Anh Quynh01d8a492014-03-26 14:49:19 +080049# - Transactional Synchronization Extensions (TSX)
Nguyen Anh Quynh95181482014-03-25 23:20:41 +080050#
51# Due to this removal, the related instructions are nolonger supported.
52#
Nguyen Anh Quynh59b54892014-03-27 10:54:44 +080053# By default, Capstone is compiled with 'CAPSTONE_X86_REDUCE = no',
Nguyen Anh Quynh5fbcc9e2014-03-26 16:20:25 +080054# thus supports complete X86 instructions.
Nguyen Anh Quynh95181482014-03-25 23:20:41 +080055
Nguyen Anh Quynhdc09a9a2014-04-29 12:59:01 +080056CAPSTONE_X86_REDUCE ?= no
Ole André Vadla Ravnås927fcbc2014-05-01 16:00:52 +020057
baguette86e84502014-08-17 20:59:05 +020058################################################################################
59# Change 'CAPSTONE_X86_ATT_DISABLE = no' to 'CAPSTONE_X86_ATT_DISABLE = yes' to
60# disable AT&T syntax on x86 to reduce library size.
61
62CAPSTONE_X86_ATT_DISABLE ?= no
Ole André Vadla Ravnås927fcbc2014-05-01 16:00:52 +020063
64################################################################################
65# Change 'CAPSTONE_STATIC = yes' to 'CAPSTONE_STATIC = no' to avoid building
66# a static library.
67
68CAPSTONE_STATIC ?= yes
69
70
71################################################################################
72# Change 'CAPSTONE_SHARED = yes' to 'CAPSTONE_SHARED = no' to avoid building
73# a shared library.
74
75CAPSTONE_SHARED ?= yes
Pbb8741bd2015-11-10 23:02:26 +010076
77################################################################################
78# Change 'CAPSTONE_HAS_OSXKERNEL = no' to 'CAPSTONE_HAS_OSXKERNEL = yes' to
79# enable OS X kernel embedding support. If 'CAPSTONE_USE_SYS_DYN_MEM = yes',
80# then kern_os_* functions are used for memory management.
81
82CAPSTONE_HAS_OSXKERNEL ?= no