Package generated code in ZIP file for relocation
packNGo(
packages the code files in a compressed ZIP file so that you can relocate, unpack, and
rebuild them in another development environment. The list of name-value pairs is
optional.buildInfo
,Name,Value
)
The types of code files in the ZIP file include:
Source files (for example, .c
and .cpp
files)
Header files (for example, .h
and .hpp
files)
MAT-file that contains the build information object (.mat
file)
Nonbuild-related files (for example, .dll
files and
.txt
informational files) required for a final executable
Build-generated binary files (for example, executable .exe
file
or dynamic link library .dll
).
The code generator includes the build-generated binary files (if present) in the ZIP file. The ignoreFileMissing property does not apply to build-generated binary files.
Use this function to relocate files. You can then recompile the files for a specific target environment or rebuild them in a development environment in which MATLAB® is not installed. By default, the function packages the files as a flat folder structure in a ZIP file within the code generation folder. You can customize the output by specifying name-value pairs. After relocating the ZIP file, use a standard ZIP utility to unpack the compressed file.
The packNGo
function can potentially modify the build information
passed in the first packNGo
argument. As part of code packaging,
packNGo
can find additional files from source and include paths
recorded in the build information. When these files are found, packNGo
adds them to the build information.
To ensure that packNGo
finds
header files, add their paths to buildInfo
by using the
addIncludePaths
function.
Note
When generating standalone code by using the codegen
command, you can use the -package
option to
both generate code and package the code in a ZIP file in a single step.
The function operates on source files only, such as *.c
,
*.cpp
, and *.h
files. The function does not
support compile flags, defines, or makefiles.
The function does not package source files for reusable library subsystems.
Unnecessary files might be included. The function might find additional files from source paths and include paths recorded in the build information, even if those files are not used.