This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Controlling output directories and output extensions


On 9/24/2010 12:34 PM, Ian Lance Taylor wrote:
Edward Diener<eldlistmailingz@tropicsoft.com> writes:

I see the '-o file' command line option but a specific compilation may
involve many outputs so I do not see how a single '-o file' option can
be of any use.

The only time a specific compilation will have multiple outputs is the case of "gcc -c file1.c file2.c file3.c". It seems easy enough to avoid that case.

My immediate need is to place object files and final executable files
in separate directories with the final executable having a specific
name and not just 'a.out'.

gcc -c -o objdir/foo.o foo.c gcc -o execdir/foo foo.o

If that doesn't work, can you explain what you are trying to do and why
that fails?

That will work fine.


It does seem laborious to limit compilation to multiple steps and a single output for each step just so I can put output files where I want them and with the names which I want them to have. But if that is the way gcc was designed, that is the way I will use it.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]