From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28314 invoked by alias); 15 Apr 2005 00:30:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28297 invoked from network); 15 Apr 2005 00:30:23 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 15 Apr 2005 00:30:23 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DMEj1-0007j1-0h; Thu, 14 Apr 2005 20:30:23 -0400 Date: Fri, 15 Apr 2005 00:30:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: respect -k or its absence when building sim subdirs Message-ID: <20050415003022.GA29453@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: <20050414192501.GB19262@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00153.txt.bz2 On Thu, Apr 14, 2005 at 07:20:06PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > On Wed, Apr 13, 2005 at 12:32:23PM -0500, Jim Blandy wrote: > > > > > > Overkill, probably. I just hate this kind of stuff. > > > > > > 2005-04-13 Jim Blandy > > > > > > Fix -k handling when looping over subdirectories. > > > * for-subdirs.sh: New script. > > > * Makefile.in (all clean mostlyclean distclean maintainer-clean > > > realclean install): Use it to loop over subdirectories. > > > > Wow... this really is overkill, and I'm not sure that the quoting does > > what you want it to. Can't you do this in make more straightforwardly? > > I know you can in GNU make, anyway. > > Can you suggest a strategy? Whatever you do, you have to replicate it > in each of those targets. If it's not pretty trivial, I don't want to > write it out every time; it belongs in a "function", which, in this > world, is a script. > > After I posted, I realized the quoting could be simplified to: > > clean mostlyclean: > @rootme=`pwd` ; export rootme ; \ > ! $(SHELL) $(srcdir)/for-subdirs.sh \ > ! "$(MAKEFLAGS)" '$(MAKE) $(FLAGS_TO_PASS) $@' $(SUBDIRS) > > > Where else were you worried about the quoting? Single or double quotation marks in the arguments. Particularly plausible in $(FLAGS_TO_PASS). Make variable substitution is really pretty dumb. I'm not sure it's a real problem. All you want is, iff MAKEFLAGS does not contain -k, to exit if any submake fails. I don't know what Make bits are and are not portable very well. You can do this in shell; something like: if ! $(MAKE) -C subdir; then if ! echo "$(MAKEFLAGS)" | grep '^[^ ]*k' > /dev/null; then exit 1 fi fi And that whole inner goo can become $(MAKE_K_CHECK). -- Daniel Jacobowitz CodeSourcery, LLC