After I've made edits to the NDK code, how do I rebuild its libraries to view my changes in action?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
After I've made edits to the NDK code, how do I rebuild its libraries to view my changes in action?
Rebuilding The NDK Core Using Gmake
Note: Build instructions for NDK versions 3.70 and above can be found in the NDK user guide.
Note: The instructions here apply to NDK versions 2.21 - 3.60.
Overview
The Network Developer's Kit (NDK) version 2.21.00.32 includes source files and a makefile that allow you to modify the stack sources and rebuild its libraries. You can rebuild the NDK in order to modify, update, or add functionality. If you edit the NDK source code, an NDK project file, and/or an NDK RTSC build script, you must also rebuild the NDK in order to create new libraries containing these modifications. The instructions on this page are intended for rebuilding the NDK on Microsoft Windows or Linux using Gmake.
Warning: We strongly recommend that you copy the NDK installation to a directory with a different name and rebuild that copy, rather than rebuilding the original installation.
Prerequisites
In order to rebuild the NDK, the SYS/BIOS and XDCtools products must both be installed. It is important to build SYS/BIOS with a compatible version of XDCtools. To find out which versions are compatible, see the “Compatibility Information” section of the Release Notes in the top-level directory of your SYS/BIOS installation.
Note: You should generally avoid installing the various Texas Instruments tools and source distributions in directories that have spaces in their paths.
Rebuilding The NDK Core Using The ndk.mak (or imports.mak) Makefile
The NDK ships with an ndk.mak (or imports.mak in SimpleLink SDK distributions) file in the top-level installation directory. This makefile enables you to easily (re)build the NDK core using your choice of compilers and desired "targets".
A target incorporates a particular ISA and a runtime model; for example, cortex-M3 and the TI compiler with specific options.
The instructions in this section can be used to (re)build core libraries on Windows or Linux. If you are using a Windows machine, you can use the regular DOS command shell provided with Windows. For Windows users, the XDCtools top-level installation directory contains gmake.exe, which is used in the commands that follow to run the Makefile.
If you are using Linux, change the "gmake" command to "make" in the commands that follow.
For these instructions, suppose you have the following directories:
$BASE/ndk/ndk_2_21_00_32 — The location where you installed NDK.
$BASE/ndk/copy-ndk_2_21_00_32 — The location of a copy of the NDK installation.
$BASE/sysbios/bios_6_32_03_43 — The location where you installed SYS/BIOS.
$BASE/xdctools_3_22_03_41 — The location where you installed XDCtools.
Make sure you have access to compilers for any targets for which you want to be able to build applications using the rebuilt NDK. Note the path to the directory containing the executable for each compiler. These compilers can include Texas Instruments compilers as well as any other command-line compilers for any targets supported by NDK.
If you are using Windows and the gmake utility provided in the top-level directory of the XDCtools installation, you should add the <xdc_install_dir> to your PATH environment variable so that the gmake executable can be found.
The following steps refer to the top-level directory of the XDCtools installation as <xdc_install_dir>. They refer to the top-level directory of the copy of the NDK installation as <ndkcopy_install_dir>. ndk.mak can be replaced with imports.mak in the NDK distributed with the SimpleLink SDK.
Follow these steps to rebuild the NDK:
XDC_INSTALL_DIR ?= $(BASE)/xdctools_3_22_03_41
ti.targets.arm.elf.M3 ?= /opt/ti/ccsv5/tools/compiler/tms470
ti.targets.arm.elf.M3 ?= c:/ti/ccsv5/tools/compiler/tms470
gmake -f ndk.mak
The NDK installation can be cleaned with the following command:
gmake -f ndk.mak clean
If you want to build NDK in debug mode, you have to uncomment a couple of lines in ndk.bld
/* Uncomment the following lines to build libraries for debug mode: */ // Pkg.attrs.profile = "debug"; // c6xOpts += " -g -o0 "; // armOpts += " -g -o0 "; // gnuOpts += " -g ";
If you want to specify options on the command line to override the settings in ndk.mak, use a command similar to the following:
gmake -f ndk.mak XDC_INSTALL_DIR=<xdc_install_dir> ti.targets.C674=<compiler_path>