From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuNL9-0000mg-Eo for qemu-devel@nongnu.org; Thu, 26 Jul 2012 08:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuNL5-0002lH-0F for qemu-devel@nongnu.org; Thu, 26 Jul 2012 08:38:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuNL4-0002l7-OB for qemu-devel@nongnu.org; Thu, 26 Jul 2012 08:38:46 -0400 Message-ID: <50113A50.4090902@redhat.com> Date: Thu, 26 Jul 2012 06:38:40 -0600 From: Eric Blake 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> <50113031.2070101@redhat.com> In-Reply-To: <50113031.2070101@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigC4E1D4C21F9163C3637CBF0E" 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: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, aliguori@us.ibm.com, Markus Armbruster , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC4E1D4C21F9163C3637CBF0E Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 07/26/2012 05:55 AM, 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= =2Epy >>>> + $(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 ru= ns >> 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 tha= t >> a recipe generates multiple files. >=20 > Hmm, I would just do >=20 > 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 "= =2E" < $<, " GEN $@") >=20 > I think that's what I usually saw for bison (which creates both .h and = =2Ec). Indeed, per https://www.gnu.org/software/automake/manual/automake.html#Multiple-Outpu= ts, that is an appropriate solution for a 2-file generation. It is only when you have more than two files where... >=20 > A perhaps cleaner alternative is to add a stamp file, and make both fil= es > depend on it. a stamp file makes more sense. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigC4E1D4C21F9163C3637CBF0E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQETpQAAoJEKeha0olJ0NqwS4H/3Lo6vxqZgh6tkZN9nEoDTK7 y4kOpyF9orwzCVMqvYizsLuwAuijVijJQHvMRIbhw/NKzAoTu9PfYsXf2vSHfuR1 3Sy44GM0qNChqYFfaHH0HrVliCHhRax5kK7Yf1R+FSAVRKQYe03oMapXgTPdwlUu k+8fB/dshNkMru10GL6nEC9ZL9sk742XbQxUiTG4w+fJg1AJ6gZP8zX9lYTAAM7d p01GFCDmGS0q8ELGdTfWvQMi9pbgzRKN4di9amatpvimG8ZuVjB7bUycS5UylUUG GcKFhkuufjVVVZ9bHegnmCE/vHy3yUjXSv+WIx1KHeDh5t0jBVv9JSsR+2b4S4g= =dWO/ -----END PGP SIGNATURE----- --------------enigC4E1D4C21F9163C3637CBF0E--