makefile. compiler name.

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

A.B.
Posts: 1
Joined: Thu Aug 15, 2019 1:49 pm

makefile. compiler name.

Postby A.B. » Thu Aug 15, 2019 2:08 pm

Hi everyone.

Sadly, the search engine ignores most relevant words of my problem.
I am using
about.jpg

My problem is:
I need makefiles for automation of some processes. For some of them, I need to replace the compiler with a different tool during the build process.
But automaticaly generated makefile does expand the compilername in my version with my configuration.
My tries to find an option to deactivate this behaviour were fruitless.
I tried it with this option
expand_option.jpg

but it didnt work as expected.
Is there a way to force atollic builder to generate makefiles with invocation of compiler over $(cc) variable, to solve this?
expanded_name.jpg

so that I can use syntax like

make -e cc=path/to/mytool myproject

Or would that be only possible by parsing the autogenerated makefile myself to replace all the compiler entries?

thanks in advance!
You do not have the required permissions to view the files attached to this post.

Mattias Norlander
Posts: 273
Joined: Fri Apr 29, 2016 10:01 am

Re: makefile. compiler name.

Postby Mattias Norlander » Wed Aug 21, 2019 12:28 pm

One approach that could work for you would be to replace the command used to invoke the various tools.
Example:
Open Build Settings --> Tool Settings --> C Compiler. The field Command = "arm-atollic-eabi-gcc -c".
This gives makefiles with:
arm-atollic-eabi-gcc -c "$<" -mthumb -mcpu=cortex-m4 -std=gnu11 -DSTM32L475xx -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I"C:\Users\norlandm\Atollic\TrueSTUDIO\STM32_workspace_9.3\smt32l475_emb_c_prj_ext_bld\Drivers\CMSIS\Include" -O0 -g -fstack-usage -Wall -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@"

If I replace the value of the Command field above with:
C:\ST\STM32CubeIDE_1.0.2\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\bin\arm-none-eabi-gcc -c

I can see that subdirs.mk contains the correct compiler invocation. Do the same for Assembler and and C Linker.

Dirty-hack? Yes... Nevertherless I was able to build the project with another compiler. So now I can have some separate build configurations for the use case of the external tools. There are probably other better approaches. You could also just create a makefile project where you are in control of tools?!


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 2 guests