Other Parts Discussed in Thread: DRV8353
Hi all,
For context, I am setting up an automated embedded build pipeline using Jenkins+LDRA. I have encountered an issue where the source makefiles that are generated for a CCS build are in a strange format for some builds, and this has ramifications for the LDRA build analysis tools. What I need to know, is how to prevent CCS from generating makefiles in this "strange" format.
The problem is best shown by presenting two autogenerated makefiles. These makefiles are both from the same CCS project, same file, same CCS build configuration, but one is manually triggered by myself on the command line and the other is built via Jenkins; both on the same computer. For some inexplicable reason (to me!), the difference in the build environment is producing the strange makefiles. I will label the "strange" makefile as the "jenkins" makefile, and the "normal" makefile as "manual", simply because this is how I have experienced the problem; it is not necessarily because this is a Jenkins related problem. Please see the makefiles below; note that I have removed the include paths for brevity.
"Jenkins" makefile
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
SHELL = cmd.exe
# Each subdirectory must supply rules for building sources it contributes
src/brompton/assistance/%.obj: ../src/brompton/assistance/%.c $(GEN_OPTS) | $(GEN_FILES) $(GEN_MISC_FILES)
@echo 'Building file: "$<"'
@echo 'Invoking: C2000 Compiler'
@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="<removed include paths for brevity>" --advice:performance=all --define=_F28004x --define=DEBUG --define=_INLINE --define=_FLASH --define=DRV8353_SPI --c11 --c++03 --float_operations_allowed=32 --diag_warning=225 --diag_wrap=off --display_error_number --emit_warnings_as_errors --verbose_diagnostics --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="src/brompton/assistance/$(basename $(<F)).d_raw" --include_path="C:/jenkins_home/workspace/283-implement-jenkins-pipeline_2/brixton-f280049c-application/LDRA/syscfg"'
@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="<removed include paths for brevity>" --advice:performance=all --define=_F28004x --define=DEBUG --define=_INLINE --define=_FLASH --define=DRV8353_SPI --c11 --c++03 --float_operations_allowed=32 --diag_warning=225 --diag_wrap=off --display_error_number --emit_warnings_as_errors --verbose_diagnostics --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="src/brompton/assistance/$(basename $(<F)).d_raw" --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/assistance" $(GEN_OPTS__FLAG) >> "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: "$<"'
@echo ' '
"Manual" Makefile
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
SHELL = cmd.exe
# Each subdirectory must supply rules for building sources it contributes
src/brompton/assistance/%.obj: ../src/brompton/assistance/%.c $(GEN_OPTS) | $(GEN_FILES) $(GEN_MISC_FILES)
@echo 'Building file: "$<"'
@echo 'Invoking: C2000 Compiler'
"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="<removed include paths for brevity>" --advice:performance=all --define=_F28004x --define=DEBUG --define=_INLINE --define=_FLASH --define=DRV8353_SPI --c11 --c++03 --float_operations_allowed=32 --diag_warning=225 --diag_wrap=off --display_error_number --emit_warnings_as_errors --verbose_diagnostics --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="src/brompton/assistance/$(basename $(<F)).d_raw" --obj_directory="src/brompton/assistance" $(GEN_OPTS__FLAG) "$<"
@echo 'Finished building: "$<"'
@echo ' '
In the "manual" makefile, we can see that all of the build flags are supplied in the call to the cl2000 compiler for this file. However, in the "jenkins" makefile this is not the case; it just echoes the flags and there are no flags present in the cl2000 compiler call. What I want to know, is what is causing the makefile format to change in the "jenkins" example? I need to have the makefile present all of the compiler arguments on the command line as in the "manual" makefile, as without these flags being present on the command line the LDRA build analysis tool cannot understand how each source file is compiled. I should note that I have only experienced the "strange" makefiles when building under Jenkins; the makefiles are generated normally when performing local builds, even on the same computer using exactly the same versions of CCS and C2000 CGT.
Any insight as to why these makefiles are different or what causes the different formats would be greatly appreciated.
Thanks