cc ignores the -o flag when -c is present

John juancho buchanan buchanan at cs.ubc.ca
Wed Oct 17 02:03:28 AEST 1990


We have a variety of programs which we maintain over a variety of platforms,
since there is no decent tool under unix for this we have found a workable
kludge is to maintain different Makefiles and different 'o' directories.
The  particular scheme that we have adopted requires that a line of the form

	cc -c foo.c -o o/ibm/foo.o 

deposit the file foo.o in the directory o/ibm, however it seems that if the
-c flag is present then the -o flag is ignored silently and the foo.o file
is placed in the current directory.  Upon checking their 'key concepts :-('
man page it is clear that the -o flag is only used for renaming the final
executable, i.e. this flag is interpreted by ld and by nothing else.  The
work around is that in our Makefile for ibm we have lines as follows.

	cc -c foo.c
	mv foo.o o/ibm/foo.o 

Is there another work around or is IBM going to screw this one up to.



More information about the Comp.unix.aix mailing list