"Build selected file" question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Build selected file" question

1,077 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fancypants on Sun Oct 19 23:42:45 MST 2014
Hi

This isn't a critical issue but I bring it up for visibility in case it can be fixed, or to get an answer "this is just the way it is".

Issue: when building a selected file (i.e. right click .c file in Project Explorer and select Build Selected File(s)) it isn't generating a listing file.

Details: my project is configured as an "LPCXpresso C Project" which I think means that it defaults to a managed makefile. The project's properties for "C/C++ Build" use "Builder type: External builder" with the default build command "make -r" and the other selections checked. Additionally, "C/C++ Build -> Settings -> Miscellaneous" has "Other flags: -Wa,-a,-ad="$*.lst"". When doing a "Build Project" I see in the console that the "external builder" is used and make properly generates the .lst files. However, when selecting "Build Selected File(s)" on a particular file, I see "Info: Internal Builder is used for build" in the console, and the "$*.lst" gets expanded to ".lst". After a lot of Google searches and trying to understand internal vs external builds (don't really have a good grasp on it), it seems there is a CDT bug that causes the internal builder not to expand some macros. It got me thinking though, shouldn't the external builder be used? Shouldn't selecting "Build Selected File(s)" just pass those files to make?

Like I said, I'm mentioning it in case this is a straightforward fix. I'm able to work around it doing a disassembly of the object file with source interspersed. However, the more I get to know Eclipse (I'm no expert but I do like it) the more complicated it gets, so I can understand if this is "just the way it works".

I'm using LPCXpresso v7.4.0 on OSX 10.9 for reference.

Thanks
-Kevin
0 Kudos
Reply
2 Replies

1,029 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fancypants on Mon Oct 20 10:52:17 MST 2014
Thanks, that did the trick.

Thought I had tried something like this previously but whatever I had done didn't work.

Your answer makes it a little clearer - "internal" is CDT's internal interpretation of make, not CDT's interpretation of gcc. Got it.

Thanks for the help.
-Kevin
0 Kudos
Reply

1,029 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Oct 20 01:21:00 MST 2014
Using the Internal builder vs the External builder (make) will produce the same results. However, you have used a make macro ($*) and as the Internal builder is not make, it does not understand the macro...

What you should do is use a Build Macro (see http://www.lpcware.com/content/faq/lpcxpresso/build-macros).

Specifically, change $*.lst to ${InputFileBaseName}.lst

This will then work regardless of which type of builder you use.

EDIT: Corrected the macro above
0 Kudos
Reply