#######################################################################################################
项目管理输出makefile,make程序调用并分析组织关系。完成源码到嵌入式可执行代码的输出。   
Project management outputs makefiles, calls the make program, and analyzes organizational relationships. Complete the output of source code to embedded executable code.

非IDE环境项目管理情况下，利用python的脚本实现输出makefile文件。文件扫描顺序的差异将产生最终输出程序的差异，其差异在同一套工具链的规则下。意味着他们都是正确的。
In non IDE environment project management, use Python scripts to output makefile files. The difference in file scanning order will result in differences in the final output program, which are governed by the same set of tool chain rules. It means they are all right.

提供样例脚本kf32_makefile.py，可以独立安装python或利用ChipON工具下同路径的python启动。
Provide sample script kf32_makefile.py, which can be independently installed in Python or started using Python from the same path under the Chipon tool.

在使用该脚本之前，你需要通过简单的配置告知项目与其他相关信息。可以建立该脚本的副本并进行修改后调用。
Before using this script, you need to inform the project and other relevant information through simple configuration. You can create a copy of the script and call it after modification.
#######################################################################################################

首先维护项目所在路径和项目名称，如Project_Path = 'D:/workspace32' 和 Project_Name = 'Demo' 。路径应该使用\\或/符号的间隔。
First, maintain the path and name of the project, such as Project_ Path = 'D:/workspace32'  And Project_ Name = 'Demo' 。 The path should use 
File Separation / or \\

配置项目的编译工作路径，即项目根目录下，如Release,Debug 或其他。若配置其他名字，应将该路径添加到过滤路径(即C输出过程s文件不做处理输入），示例项目模式为 Project_Mode = 'Release'
Configure the compilation working path of the project, which is located in the root directory of the project, such as Release, Debug, or others. If a different name is configured, the path should be added to the filtering path (i.e. C output process s file does not process input), and the example project mode is Project_ Mode = 'Release'

配置项目使用的芯片型号Project_Chip和内核绑定的低级运行库Chip_Kernel_lib。如Project_Chip = 'KF32A150MQV' Chip_Kernel_lib = 'crtv1'。其中Chip_Kernel_lib应根据型号选择对应的运行时库，如A156MQV对应crtv2。具体可对照ChipON IDE环境变量CHIP_KERNEL_LIB.
The chip model used in the configuration project Project_ Chip, a low-level runtime library bound to the kernel_ Kernel_ lib。 Like Project_ Chip = 'KF32A150MQV' Chip_ Kernel_ lib = 'crtv1'。 Among them, Chip_ Kernel_ Lib should select the corresponding runtime library based on the model, such as A156MQV corresponding to crtv2. Specific reference can be made to the Chipon IDE environment variable CHIP_ KERNEL_ LIB.

配置编译器的位置Tool_Path和选择的编译器工具Tool_Select。其中路径输入到ChipONCC32.如示例选择工具Tool_Select = 'ccr1_issue'。
Configure the location tool for the compiler_ Path and Selected Compiler Tool_ Select。 Enter the path to ChiponCC32. As shown in the example, select the tool Tool_ Select = 'ccr1_ issue'。

配置项目的脚本文件Project_LD_Script。其中脚本可以选择工具默认或项目根目录下同芯片名的脚本，对应默认工具平台Project_LD_Script_Default或项目下Project_LD_Script_Default2。也可以直接这里输入其脚本全路径。路径分隔符推荐/或\\
Configure the script file for the project Project_ LD_ Script。 The script can be selected from the default tool or a script with the same chip name in the project root directory, corresponding to the default tool platform Project_ LD_ Script_ Default or Project under Project_ LD_ Script_ Default2。 You can also directly enter the full path of its script here. Path separator recommendation/or\\

若存在项目路径下部分路径屏蔽，请扩展filter_rPath的内容，默认屏蔽Release等，即不做输入文件扫描。
If there is partial path blocking under the project path, please extend the filter_ The content of rPath is blocked by default, such as Release, which means no input file scanning is performed.

配置编译工具，一般可默认，这里可根据需要将程序名称前添加'@',即基于make调用时不输出命令行自身。如CC	= 'kf32-gcc'  或CC	= '@kf32-gcc'
Configure compilation tools, which can generally be defaulted. Here, you can add '@' before the program name as needed, which means that the command line itself is not output when making calls. For example, CC='kf32 gcc' or CC='@ kf32 gcc'

根据需要配置构建过程信息输出到文件或者当前调用环境的控制台，即OPEN或CLOSE 控制项#OutToolLog2File='true' 
Configure the build process information to output to the file or the console of the current calling environment as required, that is, OPEN or CLOSE control item # OutToolLog2File='true '

根据需要配置配置构建前pre_build_command与构建后post_build_command的自定义命令，这里仅示意的打印字符串信息。
Build pre according to configuration configuration_ build_ Command and post build_ build_ The custom command for command is only indicative of printing string information.

根据需要配置遇到错误终止与否和是否启动多核构建，默认MAKE_Flag='-k' 完整编译和MAKE_JOBS='-j12' 的多核构建。
Configure whether to terminate when encountering errors and whether to start a multi-core build as needed, with the default being MAKE_ Flag='- k' Complete compilation and Multi core construction with MAKE_JOBS='- j12'.
#######################################################################################################
默认C编译选项提供了推荐的最小选项配置，可以根据需要调整编译优化等级和扩展宏定义的实现等。其变量为ClassC_Flag，可参考文档样例进行选项扩展。
The default C compilation option provides the recommended minimum option configuration, and can adjust the compilation optimization level and implementation of extension macro definitions as needed. Its variable is ClassC_ Flag, can refer to the document examples for option extension.

提供默认C++编译选项的选项配置，其变量为ClassCPP_Flag。可根据需要进行调整或扩展。
Provide option configuration for default C++compilation options, with the variable ClassCPP_ Flag。 Adjustments or extensions can be made as needed.

链接选项可根据需要添加库搜索路径-L和库-l。其他功能具体查看链接器支持的选项。其选项变量为ClassLink_Flag。
The link option can add library search paths - L and library - l as needed. For other functions, see the options supported by the linker. Its option variable is ClassLink_ Flag。

默认输出hex s19以及bin文件，一般不需要传递kf32-objcopy选项，其变量为ClassOjbcopy_Flag
The default output is hex s19 and bin files. Generally, there is no need to pass the kf32 objcopy option, and its variable is ClassOjbcopy_ Flag

默认输出反汇编的lst文件，并反汇编内容仅限.text的默认程序段，全局初始化变量包括ram函数段data，以及全局未初始化变量bss段。若存在自定义内存段，可仿照扩展选项增加段参与反汇编输出。其选项变量为ClassObjdump_Flag
The default output is the disassembled LST file, and the disassembly content is limited to the default program segment of. text. The global initialization variables include the RAM function segment data and the global uninitialized variable BSS segment. If there are custom memory segments, you can follow the extension option to add segments to participate in disassembly output.Its option variable is ClassObjdump_Flag
#######################################################################################################
在功能函数genMakefileStr中实现了默认工具的头文件路径包含，型号与构建模式宏定义等。具体可根据需要选择调整。
In the functional function genMakefileStr, the header file path of the default tool is implemented, including model and build mode macro definitions. You can choose to adjust according to your needs.

源码扫描支持汇编文件s和asm.源码文件c，cpp和C。遇到存在h文件的路径自动追加到编译的文件搜索路径中，即选项-I扩展。
Source code scanning supports assembly files s and asm. Source code files c, cpp, and C. Automatically append the path containing the h file to the compiled file search path, that is, option - I extension.
#######################################################################################################
设计了脚本参数，可以根据需要调用时传入，推荐唯一脚本的私有工作，即可以建立多个脚本文件。
Script parameters have been designed, which can be passed in when needed. It is recommended to create multiple script files for the private work of a unique script.

设计编译结果的主要文件包括map、elf、lst、hex输出在项目根目录，若配置日志输出到文件，其为位于项目根目录的build_log.txt。
The main files for designing compilation results include map, elf, lst, and hex output in the project root directory. If the configuration log is output to the file, it is the build located in the project root directory_ log.txt。

设计脚本运行过程日志，如启动，编译，结果识别。其启动时移除历史的主要文件输出，包括map,elf,lst。结束时提示文件是否存在的直观显示编译工作是否正确输出。
Design script running process logs, such as startup, compilation, and result recognition. When it starts, it removes the main file outputs of history, including map, elf, and lst. The visual display of whether the file exists at the end indicates whether the compilation work is output correctly.
#######################################################################################################
更多细节请查阅脚本的具体内容。
For more details, please refer to the specific content of the script.