주요 콘텐츠

이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

코드 컴파일 사용자 지정

빌드 프로세스의 사용자 지정 컴파일

지원되는 빌드 툴을 설치하면 코드 생성 후 실행 가능한 코드를 생성하는 빌드 프로세스를 구성할 수 있습니다. 빌드 프로세스의 컴파일 단계를 사용자 지정할 수 있습니다.

타깃 프레임워크를 사용하여 다음을 수행할 수 있습니다.

  • 사용자 지정 CMake 툴체인 정의를 만듭니다.

  • 사용자 지정 makefile 기반 툴체인을 정의하고 등록합니다.

ToolchainInfo 객체를 사용하여 사용자 지정 makefile 기반 툴체인을 등록해 사용할 수도 있습니다.

템플릿 makefile 접근 방법의 경우, 함께 제공되는 탬플릿 makefile을 사용자 지정하십시오.

CMake, ToolchainInfo 및 템플릿 makefile 접근 방법의 경우:

  • 코드 생성 후 명령을 만들고 실행합니다.

  • 빌드 프로세스의 특정 지점에서 후크 메서드를 생성하고 적용합니다.

  • S-Function 코드의 컴파일을 구성합니다.

네임스페이스

targetManage target hardware and build tool information

클래스

모두 확장

target.BuildToolDescribe build tool (R2023a 이후)
target.BuildToolTypeDescribe build tool type (R2023a 이후)
target.CMakeSpecify CMake installation for building generated code (R2022b 이후)
target.CMakeBuildTypeDescribe CMake build type or build configuration (R2022b 이후)
target.CMakeBuilder Configure how CMake builds generated code (R2022b 이후)
target.CMakeCacheEntryConfigure a CMake cache entry (R2022b 이후)
target.DirectiveDescribe command-line flag for tool (R2023a 이후)
target.EnvironmentConfigurationConfigure system environment for toolchain (R2022b 이후)
target.FileTypeDefine identifier for file type (R2023a 이후)
target.HardwareComponentSupportDescribe support for a hardware component (R2022b 이후)
target.MakefileBuilderSpecify that toolchain is makefile-based (R2023a 이후)
target.MakeToolTypeDescribe syntax for makefile type (R2023a 이후)
target.PairedDirectiveDescribe pair of command-line flags (R2023a 이후)
target.RepeatingDirectiveDescribe repeated command-line flag for tools (R2023a 이후)
target.ToolchainCapture high-level information about toolchain (R2022b 이후)

객체

모두 확장

RTW.BuildInfoProvide information for compiling and linking generated code

함수

모두 확장

addCompileFlagsAdd compiler options to build information
addDefinesAdd preprocessor macro definitions to build information
addIncludeFilesAdd include files to build information
addIncludePathsAdd include paths to build information
addLinkFlagsAdd link options to build information
addLinkObjectsAdd link objects to build information
addNonBuildFilesAdd nonbuild-related files to build information
addPreincludeFilesAdd preinclude files to build information (R2024a 이후)
addSourceFilesAdd source files to build information
addSourcePathsAdd source paths to build information
addTMFTokensAdd template makefile (TMF) tokens to build information
addUndefinesAdd undefine preprocessor directives to build information (R2024a 이후)
removeIncludePathsRemove include paths from build information (R2023b 이후)
removeSourceFilesRemove source files from build information object (R2021b 이후)
removeUndefinesRemove undefine preprocessor macros from build information (R2024a 이후)
findBuildArgFind a specific build argument in build information
findIncludeFilesFind and add include (header) files to build information
getBuildArgsGet build arguments from build information
getCompileFlagsGet compiler options from build information
getDefinesGet preprocessor macro definitions from build information
getFullFileListGet list of files from build information
getIncludeFilesGet include files from build information
getIncludePathsGet include paths from build information
getLinkFlagsGet link options from build information
getNonBuildFilesGet nonbuild-related files from build information
getPreincludeFilesGet preinclude files from build information (R2024a 이후)
getSourceFilesGet source files from build information
getSourcePathsGet source paths from build information
getUndefinesFrom build information, get preprocessor macros to undefine (R2024a 이후)
setTargetProvidesMainDisable inclusion of code generator provided (generated or static) main.c source file during build
updateFilePathsAndExtensionsUpdate files in build information with missing paths and file extensions
updateFileSeparatorUpdate file separator character for file lists in build information
target.connection.openCreate a connection between MATLAB development computer and remote build computer (R2024a 이후)
target.connection.showShow connection between MATLAB development computer and remote build computer (R2024a 이후)
target.connection.closeClose connection between MATLAB development computer and remote build computer (R2024a 이후)
codebuildCompile and link generated code

도움말 항목

컴파일러

라이브러리 이름 및 위치

타깃 프레임워크를 사용한 CMake 및 Makefile 기반 툴체인

ToolchainInfo를 사용한 makefile 기반 툴체인

템플릿 makefile 접근 방식

고급 기법