From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3893 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Build system adjustments for subarchs Date: Wed, 14 Aug 2013 00:02:26 -0400 Message-ID: <20130814040226.GL221@brightrain.aerifal.cx> References: <20130814010617.GA16011@brightrain.aerifal.cx> <20130814022558.GJ221@brightrain.aerifal.cx> <20130814034226.GK221@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 1376452958 23767 80.91.229.3 (14 Aug 2013 04:02:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Aug 2013 04:02:38 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3897-gllmg-musl=m.gmane.org@lists.openwall.com Wed Aug 14 06:02:41 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1V9SIC-00022I-Td for gllmg-musl@plane.gmane.org; Wed, 14 Aug 2013 06:02:40 +0200 Original-Received: (qmail 14120 invoked by uid 550); 14 Aug 2013 04:02:39 -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 14112 invoked from network); 14 Aug 2013 04:02:39 -0000 Content-Disposition: inline In-Reply-To: <20130814034226.GK221@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3893 Archived-At: On Tue, Aug 13, 2013 at 11:42:26PM -0400, Rich Felker wrote: > > Actually, this would work great if I could write an abstract rule that > > says roughly: for each .o target %.o, add dependencies on %.c and > > $(wildcard */%.s). This would make it so files with asm always get > > rebuilt if either the base C file or any of the asm versions, for any > > arch or subarch, has been modified. Obviously in some cases the > > rebuild would be spurious, but such files are sufficiently small that > > I don't care; the simplicity of a universal rule with no > > arch-dependent dependency data to maintain is much more valuable. > > > > Unfortunately, I don't know a way to do this with make, but I believe > > there should be a way... > > This seems to do it, though maybe there's a more elegant way: > > define archrule = > $(dir $(patsubst %/,%,$(dir $(s))))$(notdir $(s:.s=.o)): $(s) > endef > > $(foreach s,$(wildcard src/*/$(ARCH)*/*.s),$(eval $(call archrule,$(s)))) > > [...] > > I'm going to run some tests on arm, and it if works, I'll commit. I think it should be $(1) rather than $(s) in the archrule, but for some reason, the $(eval ...) is not doing _anything_ on make 3.81 on my Debian box. With my usual make 3.82, it works fine. This is not really a show-stopper, since no errors occur; it just means dependencies aren't getting honored on some versions of make that might still be out there in the wild. But I would very much appreciate some insight on why this is happening, from any GNU make experts... Rich