2010-03-29 22:22:59     Eclipse Help - Redirecting Compiler Output

Document created by Aaronwu Employee on Sep 26, 2013
Version 1Show Document
  • View in full screen mode

2010-03-29 22:22:59     Eclipse Help - Redirecting Compiler Output

Doug Phillips (UNITED STATES)

Message: 87807   

 

I've been tasked with getting our software up and running with Eclipse, but must follow some basic rules.  One of which is the fact that many workspaces may interact with any one given project.  Because of this, the output files for a project must live with the workspace and not the project (due to preprocessor differences during compilation).

 

Besides resolving to building my own makefiles, is there a method, inside the Eclipse IDE, for redirecting the output of the compiler to a specified directory?

 

If I perform a search in the Eclipse Help for "output directory", a topic exists that points me to Project Properties->C/C++ General->Paths and symbols.  Here it states there is a tab labeled "Output location".  The Bfin version of Eclipse doesn't have this tab however.  Does anyone know if there are plans to support this?

 

Oh, and I'm not sure if this matters, but just in case, I'm stuck using linked files as our legacy file structure is not setup for the standard Eclipse project setup.

 

Thanks!

QuoteReplyEditDelete

 

 

2010-03-30 14:49:35     Re: Eclipse Help - Redirecting Compiler Output

Robin Getz (UNITED STATES)

Message: 87856   

 

Doug:

 

There aren't that many Eclipse guru's that hang around  here -- let me find some, and I'll see what I can find out. Between then and now - what version of Eclipse are you using?

 

-Robin

QuoteReplyEditDelete

 

 

2010-03-30 16:01:22     Re: Eclipse Help - Redirecting Compiler Output

Doug Phillips (UNITED STATES)

Message: 87867   

 

Robin,

 

I'm using the version supplied with the Bfin Linux toolchain:

 

blackfin-toolchain-win32-2009R1.1.exe

 

    Eclipse Platform: 3.5.2.R35

    Eclipse EPP CPP Bundle : 1.2.2

    Eclipse CDT: 6.0.2

    Eclipse Mylyn: 3.2.3

    ADI Bfin GNU Toolchain: 1.0.1

 

Doug

QuoteReplyEditDelete

 

 

2010-03-30 18:31:38     Re: Eclipse Help - Redirecting Compiler Output

Mike Frysinger (UNITED STATES)

Message: 87868   

 

you can always download a newer eclipse from eclipse.org and install the Blackfin plugins from the interface ...

QuoteReplyEditDelete

 

 

2010-03-30 21:29:45     Re: Eclipse Help - Redirecting Compiler Output

Doug Phillips (UNITED STATES)

Message: 87870   

 

Mike,

 

Thanks for the response.  I just double checked.  The version of Eclipse I'm using matches the latest at eclipse.org.

 

Doug

QuoteReplyEditDelete

 

 

2010-03-31 10:27:12     Re: Eclipse Help - Redirecting Compiler Output

Glen Anderson (UNITED STATES)

Message: 87924   

 

If there isn't a specific text field in the settings page to control the output there does exist another mechanism to manipulate the overall command line without having to resort to writing your own makefiles. I haven't verified this but you could try:

 

1.) Right click on the project and select Properties

 

2.) C/C++ Build -> Settings -> Tool Settings -> Blackfin C Compiler

 

3.) Here you'll see a field called Command line pattern that looks something like this:

 

${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

 

You should be able to insert a path between ${OUTPUT_FLAG} and ${OUTPUT_PREFIX} like so:

 

${COMMAND} ${FLAGS} ${OUTPUT_FLAG}/some/other/path/${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

 

in theory this should translate all of the generated calls to the compiler to be something like:

 

gcc ... -o/some/other/path/foo.o foo.c

 

Again, I haven't tried this myself specifically with GCC but I've used this trick in other situations with no problems.

QuoteReplyEditDelete

 

 

2010-03-31 12:08:06     Re: Eclipse Help - Redirecting Compiler Output

Doug Phillips (UNITED STATES)

Message: 87928   

 

Glen,

 

I don't know why I didn't think of that before.  It ain't purty, but is sure do wurk gooood.

 

I had a problem with relative pathing, but once I put c:/test/${OUTPUT_PREFIX}, everything worked fine.  To get this into the workspace, I'll just need to add another environment variable.  This will allow for different target locations based on the directory:

 

${workspace_loc}/output/

 

The only problem with this is that the output directories need to exist before compilation occurs.  This is easy to solve with a pre-build step though.

 

Thanks!

Attachments

    Outcomes