|
| 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 | + |
| 9 | + - compiler flags settings |
| 10 | + |
| 11 | + - setting options linker |
| 12 | + |
| 13 | + - list of link libraries |
| 14 | + |
| 15 | + - list of compiled project files |
| 16 | + |
| 17 | + |
| 18 | + ### Data conversion for NDK configuration, Android.mk file: |
| 19 | + |
| 20 | + - automatic calculation of paths for `include` and their inclusion in the variable` LOCAL_C_INCLUDES` |
| 21 | + |
| 22 | + - automatic calculation of connected libraries and their inclusion in the variable `LOCAL_LDLIBS` |
| 23 | + |
| 24 | + - automatic calculation of extensions of compiled files and their inclusion in the variable `LOCAL_CPP_EXTENSION` |
| 25 | + |
| 26 | + - automatic distribution of flags between the variables `LOCAL_CFLAGS` and` LOCAL_CPPFLAGS` according to their language |
| 27 | + |
| 28 | + - listing the compiled project files and adding them to the variable `LOCAL_SRC_FILES` |
| 29 | + |
| 30 | + - export the command line for the autorun application from `Project -> Program launch parameters` in` Makefile` and the startup script |
| 31 | + |
| 32 | + - 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 `_`. |
| 33 | + |
| 34 | + - 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. |
| 35 | + |
| 36 | + - 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. |
| 37 | + |
| 38 | + |
| 39 | +### Rewritable variables in the Android.mk file: |
| 40 | + |
| 41 | + The following variables can be overwritten, do not fill them in manually. |
| 42 | + |
| 43 | + - `LOCAL_CPP_EXTENSION` |
| 44 | + |
| 45 | + - `LOCAL_SRC_FILES` |
| 46 | + |
| 47 | + - `LOCAL_CFLAGS` |
| 48 | + |
| 49 | + - `LOCAL_CPPFLAGS` |
| 50 | + |
| 51 | + - `LOCAL_LDFLAGS` |
| 52 | + |
| 53 | + - `LOCAL_LDLIBS` |
| 54 | + |
| 55 | + - `LOCAL_C_INCLUDES` |
| 56 | + |
| 57 | + - `LOCAL_MODULE` (in case of file creation) |
| 58 | + |
| 59 | + |
| 60 | + Variables not included in this list will be saved with the values and overwritten with the new configuration. |
| 61 | + |
| 62 | + |
| 63 | +### Adding a menu to C :: B |
| 64 | + |
| 65 | + ! [cbp2ndk menu in CodeBlocks] (img / Image15.png) |
| 66 | + |
| 67 | + ### Sources: |
| 68 | + |
| 69 | + Download [cbp2ndk v.0.0.14.79 / win32 (07/03/2019)] (https://clnviewer.github.io/Code-Blocks-Android-NDK/cbp2ndk.zip) |
| 70 | + |
| 71 | + Go to the [cbp2ndk] directory (https://github.com/ClnViewer/Code-Blocks-Android-NDK/tree/master/cbp2ndk) |
| 72 | + |
| 73 | + Learn more about the format and capabilities of the file [Android.mk] (https://developer.android.com/ndk/guides/android_mk) |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +### Command line parameters: |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +### Recommendations: |
| 82 | + |
| 83 | +> Always use a Unix-style slash (/) in assembly files. The build system incorrectly handles the backslash in Windows style. |
| 84 | +> 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. |
| 85 | + |
0 commit comments