Author Topic: Get current compile file variable  (Read 617 times)

Offline Yury

  • Single posting newcomer
  • *
  • Posts: 3
Get current compile file variable
« on: June 30, 2017, 11:13:12 am »
I would like to get mixed asm + sources file. So I changed build options for single file:
Code: [Select]
$compiler $options -Wa,-adhln=$file.lst $includes -c $file -o $objectAnd 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: [Select]
-Wa,-adhln=$(SOME_VARIABLE_OR_COMMAND)".lst"but what variable I should use?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10796
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Yury

  • Single posting newcomer
  • *
  • Posts: 3
Re: Get current compile file variable
« Reply #2 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.
So, I would like to change only one parameter: general compiler options.

Right now it looks:
Code: [Select]
-pipe
-mthreads
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]
-Winvalid-pch
-include wx_pch.h

I need something like:
Code: [Select]
-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
But I do not know what variable I should use.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10796
    • Travis build status
Re: Get current compile file variable
« Reply #3 on: July 03, 2017, 09:51:01 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.
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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Yury

  • Single posting newcomer
  • *
  • Posts: 3
Re: Get current compile file variable
« Reply #4 on: July 03, 2017, 11:04:46 am »
Sorry for my stupid. Yes, it is the right solution.
Thanks a lot!!!