Directory of object files
Shawn
NRLax27@aol.com
Mon Dec 6 09:41:00 GMT 1999
"Kai Yue" <kai@cm-24-142-61-57.cableco-op.ispchannel.com> wrote in message
news:38389EA5.3A48F3A1@cm-24-142-61-57.cableco-op.ispchannel.com ...
>
> Hi,
>
> When I run "gcc", it would put the object file in the directory where
> it is
> called rather than the directory where the source file is. I have tried
>
> gcc versions 2.7.2.3 and egcs-2.91.66 on two different machines and both
> have
> the same behavior. I am using linux and make version 3.7.6.1
>
> I am wondering if there is a way of changing this, i.e., forcing gcc
> to
> place the object file in the directory of the source file.
>
> Your help would be greatly appreciated.
>
> Kai
>
Kai,
Just use the -o command line option for gcc. If your source files are
in the ./src directory, and you also wanted to put your object files there
use:
gcc ./src/myfile.c -Wall -c -o ./src/myfile.o
-Shawn
More information about the Gcc-help
mailing list