examples: Rework C examples installation

Now that all C examples are neatly sorted into only three
categories, getting rid of our custom installation machinery
and replacing it with the standard autotools mechanism
finally becomes feasible.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2019-05-22 18:07:01 +02:00
parent 4ebefac793
commit d56fc3c158

View File

@ -18,6 +18,18 @@
FILTERS = $(wildcard $(srcdir)/xml/nwfilter/*.xml)
ADMIN_EXAMPLES = \
$(wildcard $(srcdir)/admin/*.c) \
$(NULL)
DOMAIN_EXAMPLES = \
$(wildcard $(srcdir)/domain/*.c) \
$(NULL)
MISC_EXAMPLES = \
$(wildcard $(srcdir)/misc/*.c) \
$(NULL)
POLKIT_EXAMPLES = \
$(wildcard $(srcdir)/polkit/*.rules) \
$(NULL)
@ -65,12 +77,7 @@ LDADD = \
$(top_builddir)/src/libvirt-admin.la \
$(NULL)
# List of example programs. We need to list them here instead of using
# $(noinst_PROGRAMS) directly because we want to have access to the
# unmodified list during (un)installation, but at the same time automake
# might tweak $(noinst_PROGRAMS) to eg. automatically add the .exe file
# extension when targeting Windows.
EXAMPLES = \
noinst_PROGRAMS = \
admin/client_close \
admin/client_info \
admin/client_limits \
@ -88,10 +95,6 @@ EXAMPLES = \
misc/openauth \
$(NULL)
noinst_PROGRAMS = \
$(EXAMPLES) \
$(NULL)
admin_client_close_SOURCES = admin/client_close.c
admin_client_info_SOURCES = admin/client_info.c
admin_client_limits_SOURCES = admin/client_limits.c
@ -117,6 +120,15 @@ endif WITH_NWFILTER
examplesdir = $(docdir)/examples
adminexamplesdir = $(examplesdir)/admin
adminexamples_DATA = $(ADMIN_EXAMPLES)
domainexamplesdir = $(examplesdir)/domain
domainexamples_DATA = $(DOMAIN_EXAMPLES)
miscexamplesdir = $(examplesdir)/misc
miscexamples_DATA = $(MISC_EXAMPLES)
polkitexamplesdir = $(examplesdir)/polkit
polkitexamples_DATA = $(POLKIT_EXAMPLES)
@ -131,15 +143,3 @@ systemtapexamples_DATA = $(SYSTEMTAP_EXAMPLES)
testxmlexamplesdir = $(examplesdir)/xml/test
testxmlexamples_DATA = $(TEST_XML_EXAMPLES)
install-data-local:
for p in $(EXAMPLES); do \
d=$$(dirname $$p); \
$(mkinstalldirs) $(DESTDIR)$(examplesdir)/$$d; \
$(INSTALL_DATA) $(srcdir)/$${p}.c $(DESTDIR)$(examplesdir)/$$d/; \
done
uninstall-local:
for p in $(EXAMPLES); do \
rm -f $(DESTDIR)$(examplesdir)/$${p}.c; \
done