From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8970 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Support for out-of-tree build Date: Tue, 8 Dec 2015 19:39:14 -0500 Message-ID: <20151209003914.GA238@brightrain.aerifal.cx> References: <20151118214452.GQ3818@brightrain.aerifal.cx> <20151120222000.GA3818@brightrain.aerifal.cx> <20151130013555.GT3818@brightrain.aerifal.cx> <20151130211432.GV3818@brightrain.aerifal.cx> <20151130221412.GW3818@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1449621576 23173 80.91.229.3 (9 Dec 2015 00:39:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Dec 2015 00:39:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8983-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 09 01:39:35 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1a6Sn8-0003uR-Cl for gllmg-musl@m.gmane.org; Wed, 09 Dec 2015 01:39:35 +0100 Original-Received: (qmail 1965 invoked by uid 550); 9 Dec 2015 00:39:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1947 invoked from network); 9 Dec 2015 00:39:29 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8970 Archived-At: Sorry it took me a while to get to this (and other pending musl stuff). Here's my review: On Tue, Dec 01, 2015 at 02:14:29AM +0000, Petr Hosek wrote: > On Mon, Nov 30, 2015 at 2:14 PM Rich Felker wrote: > > > > I'm trying it again now, and I'm still getting an error trying to > > > build in a fresh out-of-tree dir: > > > > > > make: *** No rule to make target `obj/crt/i386/', needed by > > `obj/crt/crt1.o'. Stop. > > > > I've removed the trailing slashes as discussed on IRC and this should work > now. I get: make: *** No rule to make target `obj/include/bits', needed by `obj/include/bits/alltypes.h'. Stop. I think this is because $(dir...) intentionally leaves the trailing slash, so you have to remove it to get the desired behavior. First I tried: OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(OBJS) $(GENH) $(GENH_INT))) $(addprefix obj/, crt crt/$(ARCH) include)) but this does not seem to be sufficient, because of: $(OBJS) $(LOBJS): | $(sort $(dir $(OBJS))) Adding patsubst there would work too, but I wonder if it even makes sense to have fine-grained dir dependencies, rather than just making all the targets in this section of the makefile depend on $(OBJ_DIRS). Thoughts? > > Manually creating the directory makes the build succeed. I also get, > > when re-running configure: > > > > creating config.mak... ln: ./Makefile: File exists > > done > > > > Not an error, but confusing and not what I would expect. > > > > I've added a check to configure script. ../configure: Makefile already exists in the working directory This isn't what I would expect either. Normally you want to be able to re-run configure with different options. There's probably a little bit of subtlety here because we would like to avoid overwriting an actual file (if somebody copied and edited a makefile here) but happily replace a symlink. Aside from these issues it seems to be okay/working for me. I'd appreciate comments from anyone else who's tried it. Rich