Skip to content

Commit 34e8cb9

Browse files
committed
Create CBNDKAUTOINSTALL.EN.md
1 parent 2afa1dc commit 34e8cb9

File tree

12 files changed

+703
-545
lines changed

12 files changed

+703
-545
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![HOWTO RU](https://img.shields.io/badge/HOWTO-RU-brightgreen.svg?style=flat)](https://clnviewer.github.io/Code-Blocks-Android-NDK/)
1+
[![HOWTO RU](https://img.shields.io/badge/HOWTO-DOC-brightgreen.svg?style=flat)](https://clnviewer.github.io/Code-Blocks-Android-NDK/)
22
[![C::B project template](https://img.shields.io/badge/CodeBlocks-template-brightgreen.svg?style=flat)](https://github.com/ClnViewer/Code-Blocks-Android-NDK/tree/master/CB-Template)
33
[![License MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat)](https://github.com/ClnViewer/Code-Blocks-Android-NDK/blob/master/LICENSE)
44

@@ -7,21 +7,21 @@
77
[![Code size](https://img.shields.io/github/languages/code-size/ClnViewer/Code-Blocks-Android-NDK.svg?style=flat)](https://github.com/ClnViewer/Code-Blocks-Android-NDK/)
88

99

10-
# Code-Blocks-Android-NDK
11-
`Code::Blocks` + `Android NDK` project template [HOWTO](https://clnviewer.github.io/Code-Blocks-Android-NDK/)
12-
`Code::Blocks Template` [auto installation](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBNDKAUTOINSTALL.html) | [exe](https://clnviewer.github.io/Code-Blocks-Android-NDK/CodeBlocksNdkTemplate.exe)
13-
`Code::Blocks Template utilities` [cbp2ndk](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBP2NDK.html) | [zip](https://clnviewer.github.io/Code-Blocks-Android-NDK/cbp2ndk.zip)
10+
# Code::Blocks Android NDK
11+
`Code::Blocks` + `Android NDK` project template __HOWTO__ [EN](https://clnviewer.github.io/Code-Blocks-Android-NDK/README.EN.html) | [RU](https://clnviewer.github.io/Code-Blocks-Android-NDK/README.RU.html)
12+
`Code::Blocks Template` __auto installation__ [EN](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBNDKAUTOINSTALL.EN.html) | [RU](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBNDKAUTOINSTALL.RU.html) | [exe](https://clnviewer.github.io/Code-Blocks-Android-NDK/CodeBlocksNdkTemplate.exe)
13+
`Code::Blocks Template utilities` __cbp2ndk__ [EN](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBP2NDK.EN.html) | [RU](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBP2NDK.RU.html) | [zip](https://clnviewer.github.io/Code-Blocks-Android-NDK/cbp2ndk.zip)
1414
`Code::Blocks Template utilities` [android-elf-cleaner](https://clnviewer.github.io/Code-Blocks-Android-NDK/) | [zip](https://clnviewer.github.io/Code-Blocks-Android-NDK/android-elf-cleaner.zip)
1515

1616

1717
### Support:
1818

19-
- No root device!
20-
- Build Debug (NDK toolchain)
21-
- Build Release (NDK toolchain)
22-
- Run from device
23-
- Debug from device.
24-
- Auto start/stop `gdbserver`from device.
19+
- No root device!
20+
- Build Debug (NDK toolchain).
21+
- Build Release (NDK toolchain).
22+
- Run from device.
23+
- Debug from device.
24+
- Auto start/stop `gdbserver`from device.
2525
- No wrappers from `Gradle/Java` code required, works directly with the device.
2626
- Advanced project export to `Android.mk` file format, possible using utility [cbp2ndk](cbp2ndk/).
2727

@@ -32,8 +32,7 @@
3232

3333

3434

35-
3635
## License
3736

38-
_MIT_
37+
_MIT_
3938

cbp2ndk/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,34 @@
55
## Code::Blocks to Android NDK configuration converter
66

77

8-
Описание работы [cbp2ndk](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBP2NDK.html)
8+
Описание работы __cbp2ndk__ [EN](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBP2NDK.EN.html) | [RU](https://clnviewer.github.io/Code-Blocks-Android-NDK/CBP2NDK.RU.html)
9+
Скачать `Code::Blocks` to `Android NDK` [configuration converter](https://clnviewer.github.io/Code-Blocks-Android-NDK/cbp2ndk.zip) v.0.0.14.79 (03.07.2019)
910

10-
Скачать [cbp2ndk](https://clnviewer.github.io/Code-Blocks-Android-NDK/cbp2ndk.zip)
11+
12+
### Параметры командной строки:
13+
14+
15+
Options:
16+
-a, --auto find .cbp project file from current directory
17+
-c, --cbp path to .cbp project file
18+
-d, --dump dump current configuration
19+
-t, --tag building tag: Debug|Release|OtherTag
20+
-q, --quiet quiet all messages
21+
-v, --verbose verbose output to console
22+
-n --nodefault no set default values (libs, include paths)
23+
--cbtmpl install C::B wizard template Makefile file
24+
--api android API number (Application.mk)
25+
--abi android ABI platform (Application.mk)
26+
--ndkopt android NDK options (Application.mk)
27+
28+
Using:
29+
cbp2ndk.exe <BuildTag> <path\project.cbp>
30+
cbp2ndk.exe -t <BuildTag> -c <path\project.cbp> -v
31+
cbp2ndk.exe -a --api android-28 --abi armeabi-v7a --ndkopt debug
32+
cbp2ndk.exe -a
33+
34+
35+
## License
36+
37+
_MIT_
1138

cbp2ndk/dist/README.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/CBNDKAUTOINSTALL.EN.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
### Installing the NDK installer C :: B template
2+
3+
----------
4+
5+
- Download the installer `NDK C::B template` [CodeBlocksNdkTemplate v.0.0.14.79 / win32 (07/03/2019)](https://clnviewer.github.io/Code-Blocks-Android-NDK/CodeBlocksNdkTemplate.exe)
6+
- Run the installer and install the `NDK C::B template`
7+
- Edit the file `config.script` and add the template to the list used.
8+
9+
### Editing the C::B file with config.script
10+
11+
The file must be in the following path:
12+
13+
```
14+
<CodeBlocks base directory>\share\CodeBlocks\templates\wizard\config.script
15+
16+
```
17+
18+
You must add the following code to the `RegisterWizards()` function:
19+
20+
```
21+
function RegisterWizards()
22+
{
23+
//...
24+
RegisterWizard(
25+
wizProject,
26+
_T("ndk_android"),
27+
_T("NDK Android"),
28+
_T("Native")
29+
);
30+
//...
31+
32+
```
33+
34+
Before using the template, after making these changes, you must restart `C::B`
35+
36+
37+
### NDK C::B template Wizard
38+
39+
![Image1](img/Wizard1.png)
40+
41+
![Image1](img/Wizard2.png)
42+
43+
![Image1](img/Wizard3.png)
44+
45+
![Image1](img/Wizard4.png)
46+
47+
![Image1](img/Wizard5.png)
48+
49+
![Image1](img/Wizard6.png)
50+
51+
![Image1](img/Wizard7.png)
52+
53+
54+
### Features
55+
56+
> __Bag? __: unfortunately I did not find a direct way to add debugger parameters directly to the `C::B` project using its API.
57+
> Currently, the debugger parameters are entered into the `Extensions/debugger1` section, but for operation it is necessary that these parameters be in the `Extensions/debugger` section.
58+
> After creating the project, use the editor to remove the `Extensions/debugger` section and rename the `Extensions/debugger1` section to `Extensions/debugger`.
59+
> An example of the contents of this section is given below.
60+
61+
```xml
62+
<debugger>
63+
/// One actually platform path
64+
// <search_path add="obj/local/arm64-v8a" />
65+
// <search_path add="obj/local/x86" />
66+
// <search_path add="obj/local/x86_64" />
67+
<search_path add="obj/local/armeabi-v7a" />
68+
<remote_debugging target="Debug">
69+
<options
70+
conn_type="0"
71+
serial_baud="115200"
72+
ip_address="127.0.0.1"
73+
ip_port="59999"
74+
additional_cmds_before="set solib-search-path obj/local/armeabi-v7a&#x0A;file obj/local/armeabi-v7a/$(TARGET_OUTPUT_BASENAME)&#x0A;"
75+
/>
76+
</remote_debugging>
77+
</debugger>
78+
```
79+
80+
> __Attention! __: the `cbp2ndk` and` android-elf-cleaner` utilities used in `NDK C::B template` are built for the 32bit version of Windows.
81+
> If you are using a 64bit platform and want to have executable files of the corresponding bitness, you need to rebuild the project yourself.
82+
> The `cbp2ndk` and` android-elf-cleaner` utilities in `C::B` are located along the following path:
83+
84+
```
85+
<CodeBlocks base directory>\share\CodeBlocks\templates\wizard\ndk_android\exec\
86+
```
87+
88+
## License
89+
90+
_MIT_
91+
92+
93+

docs/CBNDKAUTOINSTALL.md renamed to docs/CBNDKAUTOINSTALL.RU.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
/>
7676
</remote_debugging>
7777
</debugger>
78-
7978
```
8079

8180
> __Внимание!__: утилиты `cbp2ndk` и `android-elf-cleaner` используемые в `NDK C::B template` собраны для 32bit версии Windows.
@@ -84,6 +83,5 @@
8483
8584
```
8685
<CodeBlocks base directory>\share\CodeBlocks\templates\wizard\ndk_android\exec\
87-
8886
```
8987

docs/CBP2NDK.EN.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
### cbp2ndk export utility
2+
3+
The goal of the `cbp2ndk` utility is to transfer settings and settings made in `Code::Blocks` to the format of `Android NDK`
4+
5+
### Supported C::B configuration blocks:
6+
7+
- both global settings blocks and corresponding tags are supported
8+
- compiler flags settings
9+
- setting options linker
10+
- list of link libraries
11+
- list of compiled project files
12+
13+
14+
### Data conversion for NDK configuration, Android.mk file:
15+
16+
- automatic calculation of paths for `include` and their inclusion in the variable `LOCAL_C_INCLUDES`
17+
- automatic calculation of connected libraries and their inclusion in the variable `LOCAL_LDLIBS`
18+
- automatic calculation of extensions of compiled files and their inclusion in the variable `LOCAL_CPP_EXTENSION`
19+
- automatic distribution of flags between the variables `LOCAL_CFLAGS` and `LOCAL_CPPFLAGS` according to their language
20+
- listing the compiled project files and adding them to the variable `LOCAL_SRC_FILES`
21+
- export the command line for the autorun application from `Project -> Program launch parameters` in `Makefile` and the startup script
22+
- if the file `Android.mk` is not in the directory pointed to by the path to the `.cbp` project, it will be created automatically. If you create `Android.mk`, the name for the application will be taken from the name of the project and all the specials. characters and spaces will be replaced with the underscore `_`.
23+
- the files `Application.mk` and `Makefile` in the absence of the directory pointed to by the path to the project `.cbp`, will be created automatically. In `Makefile` you need to edit the variable` NDKROOT` indicating the path to `Android NDK` on your system.
24+
- by default, the debug print library for Android, liblog is always included in the variable `LOCAL_LDLIBS`, and the project root directory is included in the variable `LOCAL_C_INCLUDES`
25+
26+
27+
### Rewritable variables in the Android.mk file:
28+
29+
The following variables can be overwritten, do not fill them in manually.
30+
31+
- `LOCAL_CPP_EXTENSION`
32+
- `LOCAL_SRC_FILES`
33+
- `LOCAL_CFLAGS`
34+
- `LOCAL_CPPFLAGS`
35+
- `LOCAL_LDFLAGS`
36+
- `LOCAL_LDLIBS`
37+
- `LOCAL_C_INCLUDES`
38+
- `LOCAL_MODULE` (in case of file creation)
39+
40+
Variables not included in this list will be saved with the values ​​and overwritten with the new configuration.
41+
42+
### Command line parameters:
43+
44+
Options:
45+
-a, --auto find .cbp project file from current directory
46+
-c, --cbp path to .cbp project file
47+
-d, --dump dump current configuration
48+
-t, --tag building tag: Debug|Release|OtherTag
49+
-q, --quiet quiet all messages
50+
-v, --verbose verbose output to console
51+
-n --nodefault no set default values (libs, include paths)
52+
--cbtmpl install C::B wizard template Makefile file
53+
--api android API number (Application.mk)
54+
--abi android ABI platform (Application.mk)
55+
--ndkopt android NDK options (Application.mk)
56+
57+
Using:
58+
cbp2ndk.exe <BuildTag> <path\project.cbp>
59+
cbp2ndk.exe -t <BuildTag> -c <path\project.cbp> -v
60+
cbp2ndk.exe -a --api android-28 --abi armeabi-v7a --ndkopt debug
61+
cbp2ndk.exe -a
62+
63+
64+
### Adding a menu to C::B
65+
66+
![cbp2ndk menu in CodeBlocks](img/Image15.png)
67+
68+
### Sources:
69+
70+
Download [cbp2ndk v.0.0.14.79 / win32 (07/03/2019)](https://clnviewer.github.io/Code-Blocks-Android-NDK/cbp2ndk.zip)
71+
See [cbp2ndk directory](https://github.com/ClnViewer/Code-Blocks-Android-NDK/tree/master/cbp2ndk)
72+
Learn more about the format and capabilities of the file [Android.mk](https://developer.android.com/ndk/guides/android_mk)
73+
74+
75+
### Recommendations:
76+
77+
> Always use a Unix-style slash (/) in assembly files. The build system incorrectly handles the backslash in Windows style.
78+
79+
80+
> Try not to change the level of optimization / debugging in your `Android.mk` file. This allows the build system to generate useful data files used during debugging. It is meant to exclude the use of the flags `-g`,` -s`, `-O` and their analogues.
81+
82+
## License
83+
84+
_MIT_
85+
86+
87+

0 commit comments

Comments
 (0)