From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuMfO-0004qn-K0 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 07:55:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuMfI-0005dP-NI for qemu-devel@nongnu.org; Thu, 26 Jul 2012 07:55:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuMfI-0005dB-8g for qemu-devel@nongnu.org; Thu, 26 Jul 2012 07:55:36 -0400 Message-ID: <50113031.2070101@redhat.com> Date: Thu, 26 Jul 2012 13:55:29 +0200 From: Paolo Bonzini MIME-Version: 1.0 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> In-Reply-To: <87sjced9mn.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15 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: Markus Armbruster Cc: mdroth@linux.vnet.ibm.com, aliguori@us.ibm.com, Eric Blake , qemu-devel@nongnu.org, Luiz Capitulino 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 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