diff mbox

examples: Use one top level makefile

Message ID da176bf6b7564721ce6bd18776523a8ad77f4884.1452392444.git.crobinso@redhat.com
State Accepted
Commit da176bf6b7564721ce6bd18776523a8ad77f4884
Headers show

Commit Message

Cole Robinson Jan. 10, 2016, 2:20 a.m. UTC
Using one Makefile per example subdirectory essentially serializes 'make'
calls. Convert to one example/Makefile that builds and distributes
all the subdir files. This reduces example/ rebuild time from about 5.8
seconds to 1.5 seconds on my machine.

One slight difference is that we no longer ship Makefile.am with the
examples in the rpm. This was virtually useless anyways since the Makefile
was very specific to libvirt infrastructure, so wasn't generically
reusable anyways.

Tested with 'make distcheck' and 'make rpm'
---
 Makefile.am                        | 13 +-----
 configure.ac                       | 16 +------
 examples/Makefile.am               | 89 ++++++++++++++++++++++++++++++++++++++
 examples/apparmor/Makefile.am      | 43 ------------------
 examples/dominfo/Makefile.am       | 25 -----------
 examples/dommigrate/Makefile.am    |  5 ---
 examples/domsuspend/Makefile.am    | 27 ------------
 examples/domsuspend/suspend.c      |  2 +
 examples/domtop/Makefile.am        | 29 -------------
 examples/hellolibvirt/Makefile.am  | 21 ---------
 examples/lxcconvert/Makefile.am    | 18 --------
 examples/object-events/Makefile.am | 24 ----------
 examples/openauth/Makefile.am      | 21 ---------
 examples/polkit/Makefile.am        | 17 --------
 examples/rename/Makefile.am        | 24 ----------
 examples/systemtap/Makefile.am     | 19 --------
 examples/xml/nwfilter/Makefile.am  | 54 -----------------------
 libvirt.spec.in                    |  6 +--
 18 files changed, 97 insertions(+), 356 deletions(-)
 create mode 100644 examples/Makefile.am
 delete mode 100644 examples/apparmor/Makefile.am
 delete mode 100644 examples/dominfo/Makefile.am
 delete mode 100644 examples/dommigrate/Makefile.am
 delete mode 100644 examples/domsuspend/Makefile.am
 delete mode 100644 examples/domtop/Makefile.am
 delete mode 100644 examples/hellolibvirt/Makefile.am
 delete mode 100644 examples/lxcconvert/Makefile.am
 delete mode 100644 examples/object-events/Makefile.am
 delete mode 100644 examples/openauth/Makefile.am
 delete mode 100644 examples/polkit/Makefile.am
 delete mode 100644 examples/rename/Makefile.am
 delete mode 100644 examples/systemtap/Makefile.am
 delete mode 100644 examples/xml/nwfilter/Makefile.am

-- 
2.5.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Cole Robinson Jan. 10, 2016, 7:22 p.m. UTC | #1
On 01/10/2016 05:37 AM, Martin Kletzander wrote:
> On Sat, Jan 09, 2016 at 09:20:44PM -0500, Cole Robinson wrote:

>> Using one Makefile per example subdirectory essentially serializes 'make'

>> calls. Convert to one example/Makefile that builds and distributes

>> all the subdir files. This reduces example/ rebuild time from about 5.8

>> seconds to 1.5 seconds on my machine.

>>

>> One slight difference is that we no longer ship Makefile.am with the

>> examples in the rpm. This was virtually useless anyways since the Makefile

>> was very specific to libvirt infrastructure, so wasn't generically

>> reusable anyways.

>>

>> Tested with 'make distcheck' and 'make rpm'

> 

> Looks good to me, ACK.

> 


Thanks, pushed.

> I've never realized that such separation spoils the parallel build.  But

> of course it does, since there is onely one process needed for each of

> those example directories.  I also thought it has the added benefit of

> Makefile per example soit can be shown, but that has no usage at all.

> 

> So this is nice, I would just want to know if we could also speed up the

> compilation by passing some hints to $(MAKE) so that it knows that using

> more than one process for that subdirectory would be wasting.

> 



Looks like there's a way to manually do it:

https://stackoverflow.com/questions/1681006/parallelization-of-recursive-jobs-in-gnu-make
https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

But the issue is you need to ensure that none of the subdirs have an
interdependency. In the examples/ case it would be fine, but it's not future
proof. The benefit of the non-recursive/non-subdirs usage is that the top
level Makefile knows all the dependencies of the subdirs, so it can figure out
the dependency graph for us and optimally parallelize. And also it saves the
pain of adding new Makefile.am for each new example, having to touch
configure.ac, etc.

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/Makefile.am b/Makefile.am
index 6f217bc..708d051 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,18 +20,10 @@  LCOV = lcov
 GENHTML = genhtml
 
 SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \
-  tests po examples/object-events examples/hellolibvirt \
-  examples/dominfo examples/domsuspend examples/apparmor \
-  examples/xml/nwfilter examples/openauth examples/systemtap \
-  tools/wireshark examples/dommigrate examples/polkit \
-  examples/lxcconvert examples/domtop examples/rename
+  tests po examples tools/wireshark
 
 ACLOCAL_AMFLAGS = -I m4
 
-XML_EXAMPLES = \
-  $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/examples/xml/, \
-					test/*.xml storage/*.xml)))
-
 EXTRA_DIST = \
   config-post.h \
   ChangeLog-old \
@@ -46,8 +38,7 @@  EXTRA_DIST = \
   autogen.sh \
   cfg.mk \
   run.in \
-  AUTHORS.in \
-  $(XML_EXAMPLES)
+  AUTHORS.in
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc
diff --git a/configure.ac b/configure.ac
index a566f5b..a46f9b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2810,21 +2810,9 @@  AC_CONFIG_FILES([\
         po/Makefile.in \
         include/libvirt/Makefile include/libvirt/libvirt-common.h \
         daemon/Makefile \
-        tools/Makefile \
+        examples/Makefile \
         tests/Makefile \
-        examples/apparmor/Makefile \
-        examples/object-events/Makefile \
-        examples/domsuspend/Makefile \
-        examples/dominfo/Makefile \
-        examples/dommigrate/Makefile \
-        examples/domtop/Makefile \
-        examples/openauth/Makefile \
-        examples/hellolibvirt/Makefile \
-        examples/rename/Makefile \
-        examples/systemtap/Makefile \
-        examples/xml/nwfilter/Makefile \
-        examples/lxcconvert/Makefile \
-        examples/polkit/Makefile \
+        tools/Makefile \
         tools/wireshark/Makefile \
         tools/wireshark/src/Makefile])
 AC_OUTPUT
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..50fc011
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,89 @@ 
+## Process this file with automake to produce Makefile.in
+
+## Copyright (C) 2005-2016 Red Hat, Inc.
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+FILTERS = $(wildcard xml/nwfilter/*.xml)
+
+EXTRA_DIST = \
+	apparmor/TEMPLATE.qemu \
+	apparmor/TEMPLATE.lxc \
+	apparmor/libvirt-qemu \
+	apparmor/libvirt-lxc \
+	apparmor/usr.lib.libvirt.virt-aa-helper \
+	apparmor/usr.sbin.libvirtd \
+	lxcconvert/virt-lxc-convert \
+	polkit/libvirt-acl.rules \
+	systemtap/events.stp \
+	systemtap/rpc-monitor.stp \
+	$(FILTERS) \
+	$(wildcard xml/storage/*.xml) \
+	$(wildcard xml/test/*.xml)
+
+
+INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir) \
+	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib
+LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) \
+	$(top_builddir)/src/libvirt.la $(top_builddir)/gnulib/lib/libgnu.la
+
+noinst_PROGRAMS=dominfo/info1 dommigrate/dommigrate domsuspend/suspend \
+	domtop/domtop hellolibvirt/hellolibvirt object-events/event-test \
+	openauth/openauth rename/rename
+
+dominfo_info1_SOURCES = dominfo/info1.c
+dommigrate_dommigrate_SOURCES = dommigrate/dommigrate.c
+domsuspend_suspend_SOURCES = domsuspend/suspend.c
+domtop_domtop_SOURCES = domtop/domtop.c
+hellolibvirt_hellolibvirt_SOURCES = hellolibvirt/hellolibvirt.c
+object_events_event_test_SOURCES = object-events/event-test.c
+openauth_openauth_SOURCES = openauth/openauth.c
+rename_rename_SOURCES = rename/rename.c
+
+if WITH_APPARMOR_PROFILES
+apparmordir = $(sysconfdir)/apparmor.d/
+apparmor_DATA = \
+	apparmor/usr.lib.libvirt.virt-aa-helper \
+	apparmor/usr.sbin.libvirtd \
+	$(NULL)
+
+abstractionsdir = $(apparmordir)/abstractions
+abstractions_DATA = \
+	apparmor/libvirt-qemu \
+	apparmor/libvirt-lxc \
+	$(NULL)
+
+templatesdir = $(apparmordir)/libvirt
+templates_DATA = \
+	apparmor/TEMPLATE.qemu \
+	apparmor/TEMPLATE.lxc \
+	$(NULL)
+endif WITH_APPARMOR_PROFILES
+
+if WITH_NWFILTER
+NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
+
+install-data-local:
+	$(MKDIR_P) "$(NWFILTER_DIR)"
+	for f in $(FILTERS); do \
+		$(INSTALL_DATA) $$f "$(NWFILTER_DIR)"; \
+	done
+
+uninstall-local::
+	for f in $(FILTERS); do \
+		rm -f "$(NWFILTER_DIR)/`basename $$f`"; \
+	done
+	-test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR)
+endif WITH_NWFILTER
diff --git a/examples/apparmor/Makefile.am b/examples/apparmor/Makefile.am
deleted file mode 100644
index 7a20e16..0000000
--- a/examples/apparmor/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@ 
-## Copyright (C) 2005-2011, 2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-EXTRA_DIST=				\
-	TEMPLATE.qemu			\
-	TEMPLATE.lxc			\
-	libvirt-qemu			\
-	libvirt-lxc 			\
-	usr.lib.libvirt.virt-aa-helper	\
-	usr.sbin.libvirtd
-
-if WITH_APPARMOR_PROFILES
-apparmordir = $(sysconfdir)/apparmor.d/
-apparmor_DATA = \
-	usr.lib.libvirt.virt-aa-helper \
-	usr.sbin.libvirtd \
-	$(NULL)
-
-abstractionsdir = $(apparmordir)/abstractions
-abstractions_DATA = \
-	libvirt-qemu \
-	libvirt-lxc \
-	$(NULL)
-
-templatesdir = $(apparmordir)/libvirt
-templates_DATA = \
-	TEMPLATE.qemu \
-	TEMPLATE.lxc \
-	$(NULL)
-endif WITH_APPARMOR_PROFILES
diff --git a/examples/dominfo/Makefile.am b/examples/dominfo/Makefile.am
deleted file mode 100644
index 4a30c77..0000000
--- a/examples/dominfo/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@ 
-## Copyright (C) 2005-2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADDS = $(STATIC_BINARIES) $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
-	$(COVERAGE_LDFLAGS)
-
-noinst_PROGRAMS=info1
-
-info1_SOURCES=info1.c
-info1_LDFLAGS=
-info1_LDADD= $(LDADDS)
diff --git a/examples/dommigrate/Makefile.am b/examples/dommigrate/Makefile.am
deleted file mode 100644
index db271bb..0000000
--- a/examples/dommigrate/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@ 
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)
-noinst_PROGRAMS = dommigrate
-dommigrate_CFLAGS = $(WARN_CFLAGS)
-dommigrate_SOURCES = dommigrate.c
-dommigrate_LDADD = $(top_builddir)/src/libvirt.la
diff --git a/examples/domsuspend/Makefile.am b/examples/domsuspend/Makefile.am
deleted file mode 100644
index b8e65f2..0000000
--- a/examples/domsuspend/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@ 
-## Process this file with automake to produce Makefile.in
-
-## Copyright (C) 2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADDS = $(STATIC_BINARIES) $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
-	$(COVERAGE_LDFLAGS)
-
-noinst_PROGRAMS=suspend
-
-suspend_SOURCES=suspend.c
-suspend_LDFLAGS=
-suspend_LDADD= $(LDADDS)
diff --git a/examples/domsuspend/suspend.c b/examples/domsuspend/suspend.c
index b1c49ec..11f7302 100644
--- a/examples/domsuspend/suspend.c
+++ b/examples/domsuspend/suspend.c
@@ -21,6 +21,8 @@ 
  * Author: Michal Privoznik <mprivozn@redhat.com>
  */
 
+#include <config.h>
+
 #include <errno.h>
 #include <getopt.h>
 #include <libvirt/libvirt.h>
diff --git a/examples/domtop/Makefile.am b/examples/domtop/Makefile.am
deleted file mode 100644
index dbebb46..0000000
--- a/examples/domtop/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@ 
-## Process this file with automake to produce Makefile.in
-
-## Copyright (C) 2014 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
-           -I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
-           -I$(top_srcdir)
-LDADDS = $(STATIC_BINARIES) $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
-         $(top_builddir)/gnulib/lib/libgnu.la $(COVERAGE_LDFLAGS)
-
-noinst_PROGRAMS=domtop
-
-domtop_SOURCES=domtop.c
-domtop_LDFLAGS=
-domtop_LDADD= $(LDADDS)
diff --git a/examples/hellolibvirt/Makefile.am b/examples/hellolibvirt/Makefile.am
deleted file mode 100644
index 55ea972..0000000
--- a/examples/hellolibvirt/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@ 
-## Copyright (C) 2005-2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)
-noinst_PROGRAMS = hellolibvirt
-hellolibvirt_CFLAGS = $(WARN_CFLAGS)
-hellolibvirt_SOURCES = hellolibvirt.c
-hellolibvirt_LDADD = $(top_builddir)/src/libvirt.la
diff --git a/examples/lxcconvert/Makefile.am b/examples/lxcconvert/Makefile.am
deleted file mode 100644
index 09cf5d9..0000000
--- a/examples/lxcconvert/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@ 
-## Copyright (C) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-EXTRA_DIST=				\
-	virt-lxc-convert
diff --git a/examples/object-events/Makefile.am b/examples/object-events/Makefile.am
deleted file mode 100644
index 86500a0..0000000
--- a/examples/object-events/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@ 
-## Copyright (C) 2005-2011, 2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
-	   -I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
-	   -I$(top_srcdir)
-noinst_PROGRAMS = event-test
-event_test_CFLAGS = $(WARN_CFLAGS)
-event_test_SOURCES = event-test.c
-event_test_LDADD = $(top_builddir)/src/libvirt.la \
-		 $(top_builddir)/gnulib/lib/libgnu.la
diff --git a/examples/openauth/Makefile.am b/examples/openauth/Makefile.am
deleted file mode 100644
index 7bb8604..0000000
--- a/examples/openauth/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@ 
-## Copyright (C) 2005-2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)
-noinst_PROGRAMS = openauth
-openauth_CFLAGS = $(WARN_CFLAGS)
-openauth_SOURCES = openauth.c
-openauth_LDADD = $(top_builddir)/src/libvirt.la
diff --git a/examples/polkit/Makefile.am b/examples/polkit/Makefile.am
deleted file mode 100644
index 4d213e8..0000000
--- a/examples/polkit/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@ 
-## Copyright (C) 2015 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-EXTRA_DIST = libvirt-acl.rules
diff --git a/examples/rename/Makefile.am b/examples/rename/Makefile.am
deleted file mode 100644
index 1b3484c..0000000
--- a/examples/rename/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@ 
-## Copyright (C) 2005-2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADDS = $(STATIC_BINARIES) $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
-	$(COVERAGE_LDFLAGS)
-
-noinst_PROGRAMS=rename
-
-rename_SOURCES=rename.c
-rename_LDADD= $(LDADDS)
diff --git a/examples/systemtap/Makefile.am b/examples/systemtap/Makefile.am
deleted file mode 100644
index 3938b9c..0000000
--- a/examples/systemtap/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@ 
-## Copyright (C) 2005-2011, 2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-EXTRA_DIST = \
-	events.stp \
-	rpc-monitor.stp
diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am
deleted file mode 100644
index ec1e7ee..0000000
--- a/examples/xml/nwfilter/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@ 
-## Copyright (C) 2005-2011, 2013 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-FILTERS = \
-	allow-arp.xml \
-	allow-dhcp-server.xml \
-	allow-dhcp.xml \
-	allow-incoming-ipv4.xml \
-	allow-ipv4.xml \
-	clean-traffic.xml \
-	no-arp-spoofing.xml \
-	no-arp-ip-spoofing.xml \
-	no-arp-mac-spoofing.xml \
-	no-ip-multicast.xml \
-	no-ip-spoofing.xml \
-	no-mac-broadcast.xml \
-	no-mac-spoofing.xml \
-	no-other-l2-traffic.xml \
-	no-other-rarp-traffic.xml \
-	qemu-announce-self.xml \
-	qemu-announce-self-rarp.xml
-
-EXTRA_DIST=$(FILTERS)
-
-confdir = $(sysconfdir)/libvirt
-
-NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
-
-if WITH_NWFILTER
-install-data-local:
-	$(MKDIR_P) "$(NWFILTER_DIR)"
-	for f in $(FILTERS); do \
-		$(INSTALL_DATA) $(srcdir)/$$f "$(NWFILTER_DIR)"; \
-	done
-
-uninstall-local::
-	for f in $(FILTERS); do \
-		rm -f "$(NWFILTER_DIR)/$$f"; \
-	done
-	-test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR)
-endif WITH_NWFILTER
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 3afef66..9962513 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1547,10 +1547,8 @@  rm -fr %{buildroot}
 # on RHEL 5, thus we need to expand it here.
 make install DESTDIR=%{?buildroot} SYSTEMD_UNIT_DIR=%{_unitdir}
 
-for i in object-events dominfo domsuspend hellolibvirt openauth xml/nwfilter systemtap dommigrate domtop rename
-do
-  (cd examples/$i ; make clean ; rm -rf .deps .libs Makefile Makefile.in)
-done
+make -C examples distclean
+
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
 rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la