cc -o -c

Jack F. Vogel jackv at turnkey.tcc.com
Sat Jun 1 00:49:29 AEST 1991


In article <AUVNELE.91May30171500 at auvc7.tamu.edu> auvnele at auvc7.tamu.edu (Eric L. Nelson) writes:
>I'm working on a large software program where sources are in one
>directory and objects go into another. I cannot get:
>
> cc -c -o../dir/foo.o foo.c 
>
>to put foo.o in ../dir. It insists on putting it in the same dir as
>foo.c. 

The problem, I believe, is that the '-c' flag overrides the '-o' and it
naturally puts the object in the current directory. What you want to do
can be accomplished in another way, run your builds in the target compilation
directory and then specify the path to the source. Either keep the makefile
in the target directory or symlink it there. This is what we do in our
build systems all the time.

Disclaimer: I don't speak for my employer.

-- 
Jack F. Vogel			jackv at locus.com
AIX370 Technical Support	       - or -
Locus Computing Corp.		jackv at turnkey.TCC.COM



More information about the Comp.unix.aix mailing list