examples: Move $(WARN_CFLAGS) to $(AM_CFLAGS)
[libvirt/ericb.git] / examples / Makefile.am
blobf2fef7df59bd698a22aa95dd30a832a2cd02f3e9
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         $(NULL)
34 AM_CFLAGS = \
35         $(WARN_CFLAGS) \
36         $(NULL)
38 AM_LDFLAGS = \
39         $(STATIC_BINARIES) \
40         $(NULL)
42 LDADD = \
43         $(top_builddir)/src/libvirt.la \
44         $(top_builddir)/src/libvirt-admin.la \
45         $(NULL)
47 # List of example programs. We need to list them here instead of using
48 # $(noinst_PROGRAMS) directly because we want to have access to the
49 # unmodified list during (un)installation, but at the same time automake
50 # might tweak $(noinst_PROGRAMS) to eg. automatically add the .exe file
51 # extension when targeting Windows.
52 EXAMPLES = \
53         admin/client_close \
54         admin/client_info \
55         admin/client_limits \
56         admin/list_clients \
57         admin/list_servers \
58         admin/logging \
59         admin/threadpool_params \
60         dominfo/info1 \
61         dommigrate/dommigrate \
62         domsuspend/suspend \
63         domtop/domtop \
64         hellolibvirt/hellolibvirt \
65         object-events/event-test \
66         openauth/openauth \
67         rename/rename \
68         $(NULL)
70 noinst_PROGRAMS = \
71         $(EXAMPLES) \
72         $(NULL)
74 dominfo_info1_SOURCES = dominfo/info1.c
75 dommigrate_dommigrate_SOURCES = dommigrate/dommigrate.c
76 domsuspend_suspend_SOURCES = domsuspend/suspend.c
77 domtop_domtop_SOURCES = domtop/domtop.c
78 hellolibvirt_hellolibvirt_SOURCES = hellolibvirt/hellolibvirt.c
80 object_events_event_test_SOURCES = object-events/event-test.c
82 openauth_openauth_SOURCES = openauth/openauth.c
83 rename_rename_SOURCES = rename/rename.c
85 admin_list_servers_SOURCES = admin/list_servers.c
86 admin_list_clients_SOURCES = admin/list_clients.c
87 admin_threadpool_params_SOURCES = admin/threadpool_params.c
88 admin_client_limits_SOURCES = admin/client_limits.c
89 admin_client_info_SOURCES = admin/client_info.c
90 admin_client_close_SOURCES = admin/client_close.c
91 admin_logging_SOURCES = admin/logging.c
93 INSTALL_DATA_LOCAL =
94 UNINSTALL_LOCAL =
96 if WITH_NWFILTER
97 NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
99 install-nwfilter-local:
100         $(MKDIR_P) "$(NWFILTER_DIR)"
101         for f in $(FILTERS); do \
102                 $(INSTALL_DATA) $$f "$(NWFILTER_DIR)"; \
103         done
105 uninstall-nwfilter-local::
106         for f in $(FILTERS); do \
107                 rm -f "$(NWFILTER_DIR)/`basename $$f`"; \
108         done
109         -test -z "$(shell ls $(NWFILTER_DIR))" || rmdir $(NWFILTER_DIR)
111 INSTALL_DATA_LOCAL += install-nwfilter-local
112 UNINSTALL_LOCAL += uninstall-nwfilter-local
113 endif WITH_NWFILTER
115 examplesdir = $(docdir)/examples
117 install-data-local: $(INSTALL_DATA_LOCAL)
118         $(mkinstalldirs) $(DESTDIR)$(examplesdir)
119         for p in $(EXAMPLES); do \
120                 d=$$(dirname $$p); \
121                 $(mkinstalldirs) $(DESTDIR)$(examplesdir)/$$d; \
122                 $(INSTALL_DATA) $(srcdir)/$${p}.c $(DESTDIR)$(examplesdir)/$$d/; \
123         done
125 uninstall-local: $(UNINSTALL_LOCAL)
126         for p in $(EXAMPLES); do \
127                 rm -f $(DESTDIR)$(examplesdir)/$${p}.c; \
128         done