From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8887 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, 17 Nov 2015 18:43:30 -0500 Message-ID: <20151117234330.GH3818@brightrain.aerifal.cx> References: <20151112211024.GC18372@port70.net> <20151112215232.GC3818@brightrain.aerifal.cx> <20151112234137.GD3818@brightrain.aerifal.cx> <20151117210021.GB3818@brightrain.aerifal.cx> <20151117220141.GD3818@brightrain.aerifal.cx> <20151117230606.GJ18372@port70.net> <20151117232711.GG3818@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 1447803828 16594 80.91.229.3 (17 Nov 2015 23:43:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 23:43:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8900-gllmg-musl=m.gmane.org@lists.openwall.com Wed Nov 18 00:43:48 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 1Zypud-0003WB-Sn for gllmg-musl@m.gmane.org; Wed, 18 Nov 2015 00:43:47 +0100 Original-Received: (qmail 21682 invoked by uid 550); 17 Nov 2015 23:43:44 -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 21632 invoked from network); 17 Nov 2015 23:43:43 -0000 Content-Disposition: inline In-Reply-To: <20151117232711.GG3818@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8887 Archived-At: On Tue, Nov 17, 2015 at 06:27:11PM -0500, Rich Felker wrote: > Assuming .o files in arch dirs are ok, does the following work > (non-VPATH)? > > %.o: $(srcdir)/%.sub > ... > %.o: $(srcdir)/%.s > ... > %.o: $(srcdir)/%.c > ... > > (with appropriate commands, of course). If so, I think I like it a > lot, because it factors the rules for file *types* separately from the > rules for which files to select (the "tricky" $(OBJS) setting). The > only big concern is whether this "tricky" setting is too costly in > runtime performance or complexity. Here's my idea for the 'tricky' setting of OBJS and it actually looks very simple and efficient: ARCH_OBJS = $(wildcard ...) BASE_OBJS = $(wildcard ...) OBJS = $(ARCH_OBJS) $(filter-out $(ARCH_OBJS:/$(ARCH)/=/),$(BASE_OBJS)) If the above all works I think we have a pretty good path forward. It does change where the .o files for arch-specific sources live (one level deeper in the tree) and requires these dirs to be created in the output tree, but I think this is actually an improvement since removing an arch source file will result in the base-level .o file being built (right now the stale .o file based on the arch asm sticks around). Presumably we can also just do: LOBJS = $(OBJS:.o=.lo) although it's my intent to remove LOBJS soon anyway and instead have pic/non-pic objs (and only use pic ones by default). How to name them will be a fun bikeshed... Rich