主题中讨论的其他器件:DRV8353
大家好、
在上下文中、我将使用 Jenkins+LDRA 设置自动嵌入式构建流水线。 我遇到了一个问题、即为 CCS 编译生成的源 makefile 对于某些编译采用奇怪的格式、这对 LDRA 编译分析工具有影响。 我需要知道的是、如何防止 CCS 生成此"奇怪"格式的 makefile。
最好通过演示两个自动生成的 makefile 来显示该问题。 这些 makefile 文件来自相同的 CCS 工程、相同的文件、相同的 CCS 编译配置、但一个由我在命令行上手动触发、另一个由 Jenkins 编译;两者都在同一台计算机上。 出于某种无法解释的原因(对我来说!)、构建环境的差异正在产生奇怪的 makefile。 我要将"奇怪的" makefile 文件标记为"Jenkins" makefile、将"正常的" makefile 标记为"手动"、只是因为这就是我遇到问题的原因;这不一定是因为这是一个与 Jenkins 相关的问题。 请参阅下面的 makefile 文件;请注意、为简洁起见、我删除了包含路径。
"Jenkins" makefile
############################################################################################################################
#自动生成的文件。 请勿编辑!
############################################################################################################################
Shell = cmd.exe
#每个子目录都必须提供用于构建其贡献的源的规则
src="Brompton/Assistance/%.obj:./src/brompton/assistance /%.c $(GEN_OPTS)|$(GEN_FILES)$(GEN_MISC_FILES)
@echo 'building file:"$<"'(构建文件:"$<")
@echo '调用:C2000编译器'
@echo 'Flags:-v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -O2 --opt_for_speed=2 --fp_mode=relaxed --include_path=" "--advice:performance=all --define=f28004x --define=debug --define=_inline --define=_flash --define=DRV8353_SPI --c11 --c+03 --float_operations_allowed=32 --emit_warning=225 --display_errors=f_exclus_enus_exclusions="-c+c+enchintrabus_prines=/prendicature_enchines="-prine_enchinum_enchinum_enchines=32 --enframe_enchines=/enchinum_enchinum_enchinum_enchines=ature_enchines=ature_enchines---ines--enchinum_enchinum_enchines---ines--enchines--enframe/enchines=/enchines
@echo 'Flags (cont-d):-obj_directory="src/Brompton/Assistance "$(GEN_opts__flag)"
$(shell echo -v28 -ml -mt ---cla_support=cla2 -float_support=fpu32 -tmu_support=tmu0 -vcu_support=vcu0 -O2 -opt_for_speed=2 -fp_mode=relaxed --include_path=" "--advice:performance=all --define=f28004x --define=debug --define=_inline --define=_flash --define=DRV8353_SPI --c11 --c++03 --float_operations_allowed=32 --emit_warning=225 --display_errors=proc-base_influe_warnations=prisnations--proc-as/subsectionsprendatures=prise_influatures=prisor_abi_decnations=atures=atures=aturations-bast_en_subs=aturations-bast_subs=off --probuls--proband- " --include_path="C:/jenkins_home/workspace/283-implement-jenkins-pipeline_2/brixton-f280049c-application/LDRA/syscfg">"src/Brompton/Assistance/$(basename $(<F))_ccsCompiler.opt") ">
$(shell echo --obj_directory="src/Brompton/Assistion"$(GEN_opts__flag)>>"src="src="src="/src/Brompton/Assistance/$(basename $(<F))_ccsCompiler.opt")
$(shell echo "$ <" >>"src/Brompton/Assistance/$(basename $(<F))_ccsCompiler.opt")
"C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/bin/cl2000 -@"src/Brompton/Assistance/$(basename $(<F))_ccsCompiler.opt"
@echo 'finished building:"$<"'(已完成的建筑物:"$<"
@回波''
"手动"Makefile
############################################################################################################################
#自动生成的文件。 请勿编辑!
############################################################################################################################
Shell = cmd.exe
#每个子目录都必须提供用于构建其贡献的源的规则
src="Brompton/Assistance/%.obj:./src/brompton/assistance /%.c $(GEN_OPTS)|$(GEN_FILES)$(GEN_MISC_FILES)
@echo 'building file:"$<"'(构建文件:"$<")
@echo '调用:C2000编译器'
"C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/bin/cl2000 -v28 -ml -mt --cla_support=cla2 -float_support=fpu32 -tmu_support=tmu0 -vcu_support=vcu0 -O2 -opt_for_speed=2 -fp_mode=relaxed --include_path=" "--advice:performance=all --define=f28004x --define=debug --define=_inline --define=_flash --define=DRV8353_SPI --c11 --c++03 --float_operations_allowed=32 --emit_warning=225 --display_errors=proc-refus_subsections=prendics-bast_en_abus-probas_subsections=prendics-bas/subs=prendics-bast_guides=prendics-bas_guides=prendance_ines--probuls=aturations-buls=aturations-band_debon_guest_sub <F)).d_raw" --obj_directory="src/brompton/assistance" $(GEN_OPTS__FLAG) "$<"
@echo 'finished building:"$<"'(已完成的建筑物:"$<"
@回波''
在"manual"makefile 文件中、我们可以看到所有构建标志都是在此文件的 cl2000编译器调用中提供的。 但是、在"Jenkins" makefile 文件中、情况并非如此;它只是回传标志、而 cl2000编译器调用中没有标志。 我想知道的是、什么会导致"Jenkins"示例中的 makefile 格式发生变化? 我需要使 makefile 像在"manual"makefile 中一样呈现命令行上的所有编译器参数、因为如果命令行上没有这些标志、LDRA 编译分析工具就无法了解每个 源文件的编译方式。 我应该注意的是、在 Jenkins 下构建时、我只遇到了"奇怪的" makefile 文件;在执行本地编译时、即使在使用完全相同版本的 CCS 和 C2000 CGT 的同一台计算机上也会正常生成 makefile 文件。
对于这些 makefile 文件的不同原因或导致不同格式的原因有任何见解、我们将不胜感激。
谢谢