forked from Samsung/ADBI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILDING
80 lines (49 loc) · 2.96 KB
/
BUILDING
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
Building adbiserver
-------------------
Overview
--------
The project uses a Makefile build system. After proper setup, the main Makefile in the root directory should build the
whole project by recursively running make in some of the subdirectories and by compiling and linking all object files.
Although adbiserver currently only supports the ARM architecture, the Makefiles are written in a portable way, so
porting to other platforms should be easy. All compilation and linking is done by running a the binary from the $(CC)
variable. This variable should point to a GCC compiler. Note that this must be GCC, because adbiserver heavily relies
on some features it provides.
Of course, the project should be cross-compiled for ARM. For this reason it is suggested to generate a standalone
toolchain generated by the Android NDK. For easy building the source directory includes a compressed minimal
standalone toolchain. It was generated using the Android NDK and optimized for size (to not keep large binary files in
the repo).
By default, the build scripts look for a toolchain in the toolchain subdirectory, but this behavior can be changed by
setting make variables.
Requirements
------------
To build adbiserver the following tools are required:
* GNU make
* Python 2.7
* Binutils
Build steps
-----------
0. If you don't have a toolchain and don't want to build one, unpack the supplied toolchain by entering:
make toolchain
1. Run GNU make to build the project
make
Generating a standalone Android toolchain
-----------------------------------------
To generate your own Android toolchain follow these steps:
1. Download the newest Android NDK from http://developer.android.com/tools/sdk/ndk
wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2
2. Unpack the downloaded file and enter the unpacked directory
tar -xf android-ndk-r9-linux-x86_64.tar.bz2
cd android-ndk-r9
3. Generate a standalone toolchain using the build/tools/make-standalone-toolchain.sh script. The script takes many
parameters, but most are not important to us. The general toolchain generation process is described in the NDK
documentation at docs/STANDALONE-TOOLCHAIN.html. Here's a typical example command to generate a toolchain for
adbiserver:
build/tools/make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-4.8 --install-dir=adbitoolchain
4. (optional) Move the generated toolchain directory to adbi (you can also create a symbolic link):
mv adbitoolchain ~/adbiserver/toolchain
Variables
---------
You can change the compiler used during adbiserver compilation by modifying one or more of the following variables:
* CC -- the path to the C compiler
* PREFIX -- the prefix of the compiler. If CC is not set, the scripts will look for a compiler named $(PREFIX)gcc
* TOOLCHAINDIR -- the path to root directory of the toolchain.