On 2003-04-03 at 23:23:00 Pawel Jakub Dawidek wrote: > IMHO make(1) should put .o files in current directory _and_ look for > them there when producing an executable file. Right?
I think this is more of a gcc/g++ problem/feature. :) The info page says: If `-o' is not specified, the default is to put an executable file in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its assembler file in `SOURCE.s', and all preprocessed C source on standard output. So at first glance I would say: "gcc -c some/weird/path/file.c" outputs the file "some/weird/path/file.o". But it doesn't, it puts the object file in the current directory... This is probably a feature, and if you change it, I guess a lot of stuff will break. :) Therefore, the simplest solution is to specify -o options everywhere. I've attached a patch for /usr/share/mk/sys.mk that does this, but please beware, it might break stuff which *expects* output files to always be put in the current directory. OTOH, make(1) itself seems to be consistent with relative pathnames; if you tell it a rule to create .b files from .a files, it will correctly try to use that rule to convert some/path/file.a into some/path/file.b (and NOT ./file.b).
sys.mk.diff
Description: Binary data
_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"