examples: Move $(STATIC_BINARIES) to $(AM_LDFLAGS)
[libvirt/ericb.git] / examples / Makefile.am
blob38dcb399c0d95b0a43e51e59b5cc53723a3649b0
1 ## Process this file with automake to produce Makefile.in
3 ## Copyright (C) 2005-2016 Red Hat, Inc.
4 ##
5 ## This library is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU Lesser General Public
7 ## License as published by the Free Software Foundation; either
8 ## version 2.1 of the License, or (at your option) any later version.
9 ##
10 ## This library is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 ## Lesser General Public License for more details.
15 ## You should have received a copy of the GNU Lesser General Public
16 ## License along with this library.  If not, see
17 ## <http://www.gnu.org/licenses/>.
19 FILTERS = $(wildcard $(srcdir)/xml/nwfilter/*.xml)
21 EXTRA_DIST = \
22         lxcconvert/virt-lxc-convert \
23         polkit/libvirt-acl.rules \
24         $(wildcard $(srcdir)/systemtap/*.stp) \
25         $(FILTERS) \
26         $(wildcard $(srcdir)/xml/storage/*.xml) \
27         $(wildcard $(srcdir)/xml/test/*.xml)
29 AM_CPPFLAGS = \
30         -I$(top_builddir)/include \
31         -I$(top_srcdir)/include \
32         $(WARN_CFLAGS) \
33         $(NULL)
35 AM_LDFLAGS = \
36         $(STATIC_BINARIES) \
37         $(NULL)
39 LDADD = \
40         $(top_builddir)/src/libvirt.la \
41         $(top_builddir)/src/libvirt-admin.la \
42         $(NULL)
44 # List of example programs. We need to list them here instead of using
45 # $(noinst_PROGRAMS) directly because we want to have access to the
46 # unmodified list during (un)installation, but at the same time automake
47 # might tweak $(noinst_PROGRAMS) to eg. automatically add the .exe file
48 # extension when targeting Windows.
49 EXAMPLES = \
50         admin/client_close \
51         admin/client_info \
52         admin/client_limits \
53         admin/list_clients \
54         admin/list_servers \
55         admin/logging \
56         admin/threadpool_params \
57         dominfo/info1 \
58         dommigrate/dommigrate \
59         domsuspend/suspend \
60         domtop/domtop \
61         hellolibvirt/hellolibvirt \
62         object-events/event-test \
63         openauth/openauth \
64         rename/rename \
65         $(NULL)
67 noinst_PROGRAMS = \
68         $(EXAMPLES) \
69         $(NULL)
71 dominfo_info1_SOURCES = dominfo/info1.c
72 dommigrate_dommigrate_SOURCES = dommigrate/dommigrate.c
73 domsuspend_suspend_SOURCES = domsuspend/suspend.c
74 domtop_domtop_SOURCES = domtop/domtop.c
75 hellolibvirt_hellolibvirt_SOURCES = hellolibvirt/hellolibvirt.c
77 object_events_event_test_SOURCES = object-events/event-test.c
79 openauth_openauth_SOURCES = openauth/openauth.c
80 rename_rename_SOURCES = rename/rename.c
82 admin_list_servers_SOURCES = admin/list_servers.c
83 admin_list_clients_SOURCES = admin/list_clients.c
84 admin_threadpool_params_SOURCES = admin/threadpool_params.c
85 admin_client_limits_SOURCES = admin/client_limits.c
86 admin_client_info_SOURCES = admin/client_info.c
87 admin_client_close_SOURCES = admin/client_close.c
88 admin_logging_SOURCES = admin/logging.c
90 INSTALL_DATA_LOCAL =
91 UNINSTALL_LOCAL =
93 if WITH_NWFILTER
94 NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
96 install-nwfilter-local:
97         $(MKDIR_P) "$(NWFILTER_DIR)"
98         for f in $(FILTERS); do \
99                 $(INSTALL_DATA) $$f "$(NWFILTER_DIR)"; \
100         done
102 uninstall-nwfilter-local::
103         for f in $(FILTERS); do \
104                 rm -f "$(NWFILTER_DIR)/`basename $$f`"; \
105         done
106         -test -z "$(shell ls $(NWFILTER_DIR))" || rmdir $(NWFILTER_DIR)
108 INSTALL_DATA_LOCAL += install-nwfilter-local
109 UNINSTALL_LOCAL += uninstall-nwfilter-local
110 endif WITH_NWFILTER
112 examplesdir = $(docdir)/examples
114 install-data-local: $(INSTALL_DATA_LOCAL)
115         $(mkinstalldirs) $(DESTDIR)$(examplesdir)
116         for p in $(EXAMPLES); do \
117                 d=$$(dirname $$p); \
118                 $(mkinstalldirs) $(DESTDIR)$(examplesdir)/$$d; \
119                 $(INSTALL_DATA) $(srcdir)/$${p}.c $(DESTDIR)$(examplesdir)/$$d/; \
120         done
122 uninstall-local: $(UNINSTALL_LOCAL)
123         for p in $(EXAMPLES); do \
124                 rm -f $(DESTDIR)$(examplesdir)/$${p}.c; \
125         done