# mkexe

Source: [https://docs.qualcomm.com/doc/80-41102-4/topic/mkexe.html](https://docs.qualcomm.com/doc/80-41102-4/topic/mkexe.html)

`mkexe` builds an executable for a target without packaging it as an app. It's used to build some internal parts of the framework, such as the Supervisor and Service Directory.

`mkexe` is normally not needed outside of the framework build. Instead, [mksys](https://docs.qualcomm.com/doc/80-41102-4/topic/mksys.html) (or [mkapp](https://docs.qualcomm.com/doc/80-41102-4/topic/mkapp.html)) should be used to build apps to deploy to a target device.

`mkexe` can be used to build command-line tools to copy to a target or to bundle in a root file system image; but using `mkexe` for this purpose isn't really necessary. Command-line tools can be placed inside an app and either that app can be installed directly on the target, or the executable can be copied from the app's build directory on the build PC file system after the app has been built.

## Usage

`mkexe` provides flags to set the target, set build options, and specify additional search directories:

Command line parameters:

      -C, --cflags, <string>
            (Multiple, optional) Specify extra flags to be passed to the C compiler.
    
      -L, --ldflags, <string>
            (Multiple, optional) Specify extra flags to be passed to the linker when linking
            executables.
    
      -X, --cxxflags, <string>
            (Multiple, optional) Specify extra flags to be passed to the C++ compiler.
    
      -c, --component-search, <string>
            (Multiple, optional) (DEPRECATED) Add a directory to the source search path (same as -s).
    
      -d, --debug-dir, <string>
            (Optional) Generate debug symbols and place them in the specified directory.  Debug symbol
            files will be named with build-id
    
      -g, --generate-code
            (Optional) Only generate code, but don't compile or link anything. The interface definition
            (include) files will be generated, along with component and executable main files. This is
            useful for supporting context-sensitive auto-complete and related features in source code
            editors, for example.
    
      -i, --interface-search, <string>
            (Multiple, optional) Add a directory to the interface search path.
    
      -l, --lib-output-dir, <string>
            (Optional) Specify the directory into which any generated runtime libraries should be put.
    
      -n, --dont-run-ninja
            (Optional) Even if a build.ninja file exists, ignore it, parse all inputs, and generate all
            output files, including a new copy of the build.ninja, then exit without running ninja.
            This is used by the build.ninja to to regenerate itself and any other files that need to be
            regenerated when the build.ninja finds itself out of date.
    
      -o, --output, <string>
            The path of the executable file to generate.
    
      -s, --source-search, <string>
            (Multiple, optional) Add a directory to the source search path.
    
      -t, --target, <string>
            (Optional) Specify the target device to build for (sa515m).
    
      -v, --verbose
            (Optional) Set into verbose mode for extra diagnostic information.
    
      -w, --object-dir, <string>
            (Optional) Specify the directory into which any intermediate build artifacts (such as .o
            files and generated source code files) should be put.Copy to clipboard

See [Tool Chain Configuration](https://docs.qualcomm.com/doc/80-41102-4/topic/mk-Tools.html#concept.dita_9bcf13bd-17cd-4a87-ac7c-dcbd92c5bded__section_yw2_fcz_rvb) for information on how `mkexe` decides what compilers, etc. to use.

**Parent Topic:** [mk Tools](https://docs.qualcomm.com/doc/80-41102-4/topic/mk-Tools.html)

Last Published: Jan 13, 2025

[Previous Topic
mkapp](https://docs.qualcomm.com/bundle/publicresource/80-41102-4/topics/mkapp.md) [Next Topic
mkcomp](https://docs.qualcomm.com/bundle/publicresource/80-41102-4/topics/mkcomp.md)