User forums > Using Code::Blocks
Get current compile file variable
(1/1)
Yury:
I would like to get mixed asm + sources file. So I changed build options for single file:
--- Code: ---$compiler $options -Wa,-adhln=$file.lst $includes -c $file -o $object
--- End code ---
And it is works well, but I need it for all project (more then 50 source files)...
Another way is add generating mix info to global build options, like this:
--- Code: ----Wa,-adhln=$(SOME_VARIABLE_OR_COMMAND)".lst"
--- End code ---
but what variable I should use?
oBFusCATed:
Have you tried something from here: http://wiki.codeblocks.org/index.php/Adding_support_for_non_C/C%2B%2B_files_to_the_build_system ?
Yury:
Yes, I tried this way, and it works well, as I wrote. But this way works only for one file, so I need to change compiler command line for more than 50 files.
So, I would like to change only one parameter: general compiler options.
Right now it looks:
--- Code: ----pipe
-mthreads
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]
-Winvalid-pch
-include wx_pch.h
--- End code ---
I need something like:
--- Code: ----pipe
-mthreads
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]
-Winvalid-pch
-include wx_pch.h
-Wa,-adhln=$(ACTIVE_COMPILED_FILENAME_VARIABLE).lst
--- End code ---
But I do not know what variable I should use.
oBFusCATed:
--- Quote from: Yury on July 03, 2017, 09:27:40 am ---Yes, I tried this way, and it works well, as I wrote. But this way works only for one file, so I need to change compiler command line for more than 50 files.
--- End quote ---
Hm, the article explains how to setup C::B, so it recognizes files with particular extension and uses non-default build commands for them. It specifically mentions that it is not required to manually change the compile command per file. What is the extension of your asm files?
Yury:
Sorry for my stupid. Yes, it is the right solution.
Thanks a lot!!!
Navigation
[0] Message Index
Go to full version