From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8842 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: Wed, 11 Nov 2015 19:01:30 -0500 Message-ID: <20151112000130.GA3818@brightrain.aerifal.cx> References: <20151107130537.GC8500@port70.net> <20151108004323.GE3818@brightrain.aerifal.cx> <20151108021630.GG8500@port70.net> <20151108022920.GL3818@brightrain.aerifal.cx> <20151111230848.GZ3818@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 1447286506 24864 80.91.229.3 (12 Nov 2015 00:01:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2015 00:01:46 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8855-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 12 01:01:45 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 1ZwfKj-0001VQ-I9 for gllmg-musl@m.gmane.org; Thu, 12 Nov 2015 01:01:45 +0100 Original-Received: (qmail 13756 invoked by uid 550); 12 Nov 2015 00:01:43 -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 13738 invoked from network); 12 Nov 2015 00:01:42 -0000 Content-Disposition: inline In-Reply-To: <20151111230848.GZ3818@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:8842 Archived-At: On Wed, Nov 11, 2015 at 06:08:48PM -0500, Rich Felker wrote: > > -%.o: $(ARCH)$(ASMSUBARCH)/%.sub > > +$(OBJS_SUB): %.o: > > $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $(dir $<)$(shell cat $<) > > > > -%.o: $(ARCH)/%.s > > +$(OBJS_S): %.o: > > $(AS_CMD) $(CFLAGS_ALL_STATIC) > > > > -%.o: %.c $(GENH) $(IMPH) > > +$(OBJS_C): %.o: $(srcdir)/%.c $(GENH) $(IMPH) > > $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< > > > > -%.lo: $(ARCH)$(ASMSUBARCH)/%.sub > > +$(LOBJS_SUB): %.lo: > > $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $(dir $<)$(shell cat $<) > > > > -%.lo: $(ARCH)/%.s > > +$(LOBJS_S): %.lo: > > $(AS_CMD) $(CFLAGS_ALL_SHARED) > > > > -%.lo: %.c $(GENH) $(IMPH) > > +$(LOBJS_C): %.lo: $(srcdir)/%.c $(GENH) $(IMPH) > > $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $< > > I don't understand these rules with two :'s. I assume it's some trick > I don't yet know. But in the case of the %.s ones, the new rules have > no %.s in them... this looks wrong, no? I found the documentation here: https://www.gnu.org/software/make/manual/html_node/Static-Pattern.html I also checked that the feature has been around at least back to GNU Make 3.81. Anyway, it looks potentially very nice/useful, but with the above apparent-error, I'm not sure how you express the rules we need. Note that we do need to do something new about the .sub files, so I'm not opposed to making some structural changes to the source tree to go along with build system overhaul. I'd just like to keep the layout reasonable and the semantics fully represented by source tree layout rather than by makefile logic. Rich