When you run the

make getlibs

command, the build system finds all the .

mtb

files in the application directory and performs

git clone

operations on them. A .

mtb

file contains the source location of a library repo, a specific tag for a version of the code, and the location to store the library.

The

getlibs

target finds and processes all .

mtb

files and uses the

git clone

command to clone or pull the code as appropriate. The target generates .

mtb

files for indirect dependencies. Then, it checks out the specific tag listed in the .

mtb

file. The Project Creator and Library Manager invoke this process automatically.



Note: ModusToolbox™ version 3.x no longer supports the old LIB flow, thus all .lib files are ignored.

  • The

    getlibs

    target must be invoked separately from any other make target (for example, the command

    make getlibs build

    is not allowed and the

    Makefiles

    will generate an error; however, a command such as

    make clean build

    is allowed).

  • The

    getlibs

    target performs a

    git fetch

    on existing libraries but will always checkout the tag pointed to by the overseeing .

    mtb

    file.

  • The

    getlibs

    target detects if users have modified standard code and will not overwrite their work. This allows you to perform some action (for example commit code or revert changes, as appropriate) instead of overwriting the changes.

The build system also has a

printlibs

target that can be used to print the status of the cloned libraries.

repos

The cloned libraries are located in their individual git repos in the directory pointed to by the

CY_GETLIBS_PATH

variable (for example,

/deps

). These all point to the "our" remote origin. You can point your repo by editing the .

git/config

file or by running the git remote command.

If the repos are modified, add the changes to your source control (git branch is recommended). When

make getlibs

is run (to either add new libraries or update libraries), it requires the repos to be clean (that is, all changes must be committed). You may also use the .

gitignore

file for adding untracked files when running

make getlibs

. See also

KBA231252

.