From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuPJQ-0006Lj-Fm for qemu-devel@nongnu.org; Thu, 26 Jul 2012 10:45:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuPJP-0008Hb-9O for qemu-devel@nongnu.org; Thu, 26 Jul 2012 10:45:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuPJP-0008HQ-1P for qemu-devel@nongnu.org; Thu, 26 Jul 2012 10:45:11 -0400 Date: Thu, 26 Jul 2012 11:45:44 -0300 From: Luiz Capitulino Message-ID: <20120726114544.623924e2@doriath.home> In-Reply-To: <50113031.2070101@redhat.com> References: <1343235256-26310-1-git-send-email-lcapitulino@redhat.com> <1343235256-26310-10-git-send-email-lcapitulino@redhat.com> <87sjced9mn.fsf@blackfin.pond.sub.org> <50113031.2070101@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/11] qapi: add qapi-errors.py List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mdroth@linux.vnet.ibm.com, aliguori@us.ibm.com, Eric Blake , Markus Armbruster , qemu-devel@nongnu.org On Thu, 26 Jul 2012 13:55:29 +0200 Paolo Bonzini wrote: > Il 26/07/2012 13:50, Markus Armbruster ha scritto: > >> > +qapi-errors.h qapi-errors.c :\ > >> > +$(SRC_PATH)/qapi-schema-errors.json $(SRC_PATH)/scripts/qapi-errors.py > >> > + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-errors.py -o "." < $<, " GEN $@") > > I'm afraid this isn't quite what you want. It's shorthand for two > > separate rules with the same recipe[*]. Therefore, it's prone to run > > the recipe twice, with make blissfully unaware that each of the two runs > > clobbers the other file, too. Could conceivably lead to trouble with > > parallel execution. > > > > Paolo, Eric, maybe you can provide advice on how to best tell make that > > a recipe generates multiple files. > > Hmm, I would just do > > qapi-errors.h: qapi-errors.c > qapi-errors.c: $(SRC_PATH)/qapi-schema-errors.json $(SRC_PATH)/scripts/qapi-errors.py > $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-errors.py -o "." < $<, " GEN $@") I've done this for v3, thanks for the suggestion. > > I think that's what I usually saw for bison (which creates both .h and .c). > > A perhaps cleaner alternative is to add a stamp file, and make both files > depend on it. > > Paolo >