This repository has been archived by the owner on Dec 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_make.txt
179 lines (107 loc) · 4.67 KB
/
install_make.txt
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
Please read "readme.txt" before reading this file!
Preparing the build environment on MS Windows
---------------------------------------------
Prerequisites
=============
In addition to the compiler specified in readme.txt, Cygwin is required
on MS Windows. It is available from:
https://www.cygwin.com/
Make sure to install the 32-bit version of Cygwin (setup-x86.exe) and to
install the 'make' package.
Build environment
=================
On MS Windows, you may build the SDK using either the Cygwin shell or the
Command Prompt (either cmd.exe or a Developer Command Prompt for Visual
Studio).
If you wish to use the Cygwin shell to build the SDK, start it with:
> C:\cygwin\cygwin.bat
If you wish to use the Command Prompt, you must add Cygwin's bin directory
to your PATH:
> set PATH=C:\cygwin\bin;%PATH%
You should then navigate to IDA's SDK directory, for example:
> cd C:\idasdk
The MS Windows build automatically generates a configuration file from the
top-level directory of the SDK. To build this configuration file directly,
invoke make from the top-level directory with:
C:\idasdk>make env
or, in a cygwin shell:
/cygdrive/c/idasdk $ make env
If this file is not generated, you will hit this error message:
cl : Command line error D8022 : cannot open '../../x64_win_vc_32.cfg'
Preparing the SDK
=================
The SDK provides a linker wrapper under the 'bin' directory. You may have to
set the executable flag on the 'bin\ld.exe' binary.
You must add the SDK's bin directory to your PATH.
On MS Windows' Command Prompt:
C:\idasdk>set PATH=C:\idasdk\bin;%PATH%
or, in a cygwin shell:
/cygdrive/c/idasdk $ export PATH=/cygdrive/c/idasdk/bin:$PATH
(please note that the separator is ':' here, not ';' as it would in cmd.exe)
Preparing the build environment on Linux and Mac OS X
-----------------------------------------------------
You must add the SDK's bin directory to your PATH.
$ export PATH=~/idasdk/bin:$PATH
Target platform
---------------
The target platform must be specified using one of the following environment
variables:
- MS Windows: __NT__
- Linux: __LINUX__
- Mac OS X: __MAC__
If no target platform is specified, the build defaults to MS Windows (__NT__).
It is a good idea to specify the platform directly on your ~/.bashrc file:
- MS Windows (Cygwin):
export __NT__=1
- Linux:
export __LINUX__=1
- Mac OS X:
export __MAC__=1
How to build the SDK from the command-line
------------------------------------------
All source files are the same for all platforms and are compiled using the
same makefiles. The build commands are different between operating systems.
On Linux and Mac OS X
=====================
It should suffice to invoke 'make' directly:
make
If you did not export the target platform's environment variable, you may
specify the target in the command line, for example:
make __LINUX__=1
To build for IDA64 (64-bit ea_t size):
make __EA64__=1
Please note that both ida32 and ida64 are 64-bit applications.
To build 32-bit debug servers, you must set the __X86__ variable. This can
be achieved in the command line with:
make __X86__=1
You may also run the 'idamake.pl' script instead of 'make'. It is a post-
processing script for make, and will prevent the printing of some warnings
which cannot be disabled in the compiler. For example, there is this warning
from gcc:
warning: format ‘%a’ expects argument of type ‘double’, but argument 2 has type ‘ea_t {aka unsigned int}’ [-Wformat=]
There is also an environment option IDAMAKE_SIMPLIFY which can be passed to
'idamake.pl', which turns on filtering of compiler command line.
Some examples:
make __LINUX__=1 -- non-optimized linux build
make NDEBUG=1 __MAC__=1 -- optimized mac build
make NDEBUG=1 __NT__=1 __EA64__=1 -- optimized ida64 windows build
IDAMAKE_SIMPLIFY=1 idamake.pl [...] -- filter build system output
On MS Windows
=============
The build target is selected by using special bat files, present in the bin/
directory
mo.bat - will build components for ida.exe
mmo.bat - will build components for ida64.exe
Note that 'm*.bat' files accept a '-j' argument, to parallelize the build:
E.g,
C:\idasdk>mo.bat -j 12
or, in a cygwin shell:
/cygdrive/c/idasdk $ mo.bat -j 12
Aliases
-------
Creating aliases for the build commands is a good idea. I have the following
in my .bashrc file:
export __LINUX__=1
export PATH=~/idasdk/bin:$PATH
alias mx='make 2>&1'
alias mmx='__EA64__=1 make 2>&1'