Received: from eggs.gnu.org ([2001:4830:134:3::10]:46889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzpX9-0002lP-Da for qemu-devel@nongnu.org; Thu, 27 Oct 2016 14:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzpX4-0002Rv-CO for qemu-devel@nongnu.org; Thu, 27 Oct 2016 14:36:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzpX4-0002RP-4P for qemu-devel@nongnu.org; Thu, 27 Oct 2016 14:36:06 -0400 References: <20160922211116.32417-1-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <8fb06242-be00-bb34-34e6-d64d951b161c@redhat.com> Date: Thu, 27 Oct 2016 13:36:03 -0500 MIME-Version: 1.0 In-Reply-To: <20160922211116.32417-1-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ufN1ldrBHqIBMH5Af6QgDmTKbln4ToPGg" Subject: Re: [Qemu-devel] [PATCH v2] build-sys: generate tests/.gitignore List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ufN1ldrBHqIBMH5Af6QgDmTKbln4ToPGg From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Paolo Bonzini Message-ID: <8fb06242-be00-bb34-34e6-d64d951b161c@redhat.com> Subject: Re: [PATCH v2] build-sys: generate tests/.gitignore References: <20160922211116.32417-1-marcandre.lureau@redhat.com> In-Reply-To: <20160922211116.32417-1-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2016 04:11 PM, Marc-Andr=C3=A9 Lureau wrote: > It's too easy to forget about updating the .gitignore, so this is an > attempt at generating it instead. >=20 > This approach assumes that the files to clean are the one to put in > the .gitignore. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > v2: > - fix make check-clean > - improve adding $(QEMU_IOTESTS_HELPERS-y) in cleanfiles (it needs a p= atsubst because tests/ is present 2 times) > - use quiet-command > - fix cleanfiles +=3D >=20 > tests/Makefile.include | 26 +++++++++++++--- > tests/.gitignore | 82 ------------------------------------------= -------- > 2 files changed, 22 insertions(+), 86 deletions(-) > delete mode 100644 tests/.gitignore >=20 > diff --git a/tests/Makefile.include b/tests/Makefile.include > index 6052a38..cf81fd7 100644 > --- a/tests/Makefile.include > +++ b/tests/Makefile.include > @@ -782,8 +782,21 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): ch= eck-%.json: $(SRC_PATH)/%.json > @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)= /$*.err - > @diff -q $(SRC_PATH)/$*.exit $*.test.exit > =20 > -# Consolidated targets > +tests-cleanfiles =3D *.o > +tests-cleanfiles +=3D .gitignore > +tests-cleanfiles +=3D qht-bench$(EXESUF) > +tests-cleanfiles +=3D qapi-schema/*.test.* > +tests-cleanfiles +=3D test-qapi-event.[ch] > +tests-cleanfiles +=3D test-qapi-types.[ch] > +tests-cleanfiles +=3D test-qapi-visit.[ch] > +tests-cleanfiles +=3D test-qmp-introspect.[ch] > +tests-cleanfiles +=3D test-qmp-commands.h > +tests-cleanfiles +=3D test-qmp-marshal.c > +tests-cleanfiles +=3D $(subst tests/,,$(check-unit-y)) > +tests-cleanfiles +=3D $(subst tests/,,$(check-qtest-y)) > +tests-cleanfiles +=3D $(patsubst tests/%,%,$(QEMU_IOTESTS_HELPERS-y)) > =20 > +# Consolidated targets > .PHONY: check-qapi-schema check-qtest check-unit check check-clean > check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) > check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) > @@ -792,14 +805,19 @@ check-block: $(patsubst %,check-%, $(check-block-= y)) > check: check-qapi-schema check-unit check-qtest > check-clean: > $(MAKE) -C tests/tcg clean > - rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y) > - rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$= (target)-y)) $(check-qtest-generic-y)) > - > + (cd tests && rm -rf $(tests-cleanfiles)) Why the subshell? > clean: check-clean > =20 > # Build the help program automatically > =20 > all: $(QEMU_IOTESTS_HELPERS-y) > =20 > +ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMD= GOALS),,fail)) > +$(SRC_PATH)/tests/.gitignore: > + $(call quiet-command, echo "$(tests-cleanfiles)" | xargs -n1 | sort >= $@, \ > + " GEN $(@F)") Incorrect usage of $(call quiet-command), now that 0bdb12c7 has landed. > +Makefile: $(SRC_PATH)/tests/.gitignore > +endif > + > -include $(wildcard tests/*.d) > -include $(wildcard tests/libqos/*.d) Otherwise it appears to work, and looks like you've addressed many of my v1 findings. I still think that Paolo may be a better GNU make expert to give a review on this, so I've cc'd him. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ufN1ldrBHqIBMH5Af6QgDmTKbln4ToPGg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYEkkTAAoJEKeha0olJ0Nqr7MH/3ReW+D/lv+PJ/INtwzzDmvN 62oWYGZ7T4MvvDfwM7NyNvdlRGtOiudGJgJBGWwCJ0XCReInmUHatYPQgNjJeGKE 5q1lOog9zzmDqdmrPGdryv9DphLi58q/vFvKYOrvUFv6hU29Zh33ukjJ888s4nyR UO1myKB2fys++scmTlIph5yf9RDmARGtGID8/gZfVLv8WoRIq9BYiBv+sFyNcg4W 3I3wRfux5aKe8ewrjI0HSrBV7R6KbcC9shl+Mt0JDmr9quu99nRFoO8CCo9UXrA6 v1Zsz7uKVJtMZj/2i818VjnAAXJw2oNpJdqhfMTv+Hpam5nldU4/IfLiu7bcnHI= =Vm3I -----END PGP SIGNATURE----- --ufN1ldrBHqIBMH5Af6QgDmTKbln4ToPGg--