Date: Fri, 4 Apr 2003 02:03:35 +0200 From: Dimitry Andric <dim@xs4all.nl> To: Pawel Jakub Dawidek <nick@garage.freebsd.pl> Cc: freebsd-hackers@freebsd.org Subject: Re: Bug in make(1)? Message-ID: <18441906438.20030404020335@xs4all.nl> In-Reply-To: <20030403212300.GL54604@garage.freebsd.pl> References: <20030403212300.GL54604@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
------------11B8020AE9B9B59 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit 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). ------------11B8020AE9B9B59 Content-Type: application/octet-stream; name="sys.mk.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sys.mk.diff" LS0tIC91c3Ivc2hhcmUvbWsvc3lzLm1rLm9yZwlUaHUgQXByICAzIDAxOjA3OjU3IDIwMDMKKysr IC91c3Ivc2hhcmUvbWsvc3lzLm1rCUZyaSBBcHIgIDQgMDE6NDM6MTAgMjAwMwpAQCAtMTEzLDEw ICsxMTMsMTAgQEAKIAogIyBTSU5HTEUgU1VGRklYIFJVTEVTCiAuYzoKLQkke0NDfSAke0NGTEFH U30gJHtMREZMQUdTfSAtbyA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R1N9IC1jICR7LklNUFNSQ30gLW8gJHsu VEFSR0VUfQogCiAuUy5vOgotCSR7Q0N9ICR7Q0ZMQUdTfSAtYyAkey5JTVBTUkN9CisJJHtDQ30g JHtDRkxBR1N9IC1jICR7LklNUFNSQ30gLW8gJHsuVEFSR0VUfQogCiAucy5vOgotCSR7QVN9ICR7 QUZMQUdTfSAtbyAkey5UQVJHRVR9ICR7LklNUFNSQ30KKwkke0FTfSAke0FGTEFHU30gJHsuSU1Q U1JDfSAtbyAkey5UQVJHRVR9CiAKICMgWFhYIG5vdCAtaiBzYWZlCiAueS5vOgo= ------------11B8020AE9B9B59--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18441906438.20030404020335>