d898c99c4a3662b326fe64fdf2d77238fcb3de51
[libguestfs.git] / examples / Makefile.am
1 # libguestfs C examples
2 # Copyright (C) 2010-2011 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 EXTRA_DIST = \
19         LICENSE \
20         guestfs-examples.pod \
21         guestfs-recipes.pod \
22         guestfs-testing.pod
23
24 CLEANFILES = \
25         stamp-guestfs-examples.pod \
26         stamp-guestfs-recipes.pod \
27         stamp-guestfs-testing.pod
28
29 noinst_PROGRAMS = create_disk inspect_vm
30 if HAVE_HIVEX
31 noinst_PROGRAMS += virt-dhcp-address
32 endif
33
34 create_disk_SOURCES = create_disk.c
35 create_disk_CFLAGS = \
36         -DGUESTFS_WARN_DEPRECATED=1 \
37         -I$(top_srcdir)/src -I$(top_builddir)/src \
38         $(WARN_CFLAGS) $(WERROR_CFLAGS)
39 create_disk_LDADD = \
40         $(top_builddir)/src/libguestfs.la
41
42 inspect_vm_SOURCES = inspect_vm.c
43 inspect_vm_CFLAGS = \
44         -DGUESTFS_WARN_DEPRECATED=1 \
45         -I$(top_srcdir)/src -I$(top_builddir)/src \
46         $(WARN_CFLAGS) $(WERROR_CFLAGS)
47 inspect_vm_LDADD = \
48         $(top_builddir)/src/libguestfs.la
49
50 virt_dhcp_address_SOURCES = virt-dhcp-address.c
51 virt_dhcp_address_CFLAGS = \
52         -DGUESTFS_WARN_DEPRECATED=1 \
53         -I$(top_srcdir)/src -I$(top_builddir)/src \
54         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
55         $(HIVEX_CFLAGS)
56 virt_dhcp_address_LDADD = \
57         $(HIVEX_LIBS) \
58         $(top_builddir)/src/libguestfs.la
59
60 man_MANS = \
61         guestfs-examples.3 \
62         guestfs-recipes.1 \
63         guestfs-testing.1
64 noinst_DATA = \
65         $(top_builddir)/html/guestfs-examples.3.html \
66         $(top_builddir)/html/guestfs-recipes.1.html \
67         $(top_builddir)/html/guestfs-testing.1.html
68
69 guestfs-examples.3 $(top_builddir)/html/guestfs-examples.3.html: stamp-guestfs-examples.pod
70
71 stamp-guestfs-examples.pod: guestfs-examples.pod create_disk.c inspect_vm.c
72         $(top_builddir)/podwrapper.sh \
73           --section 3 \
74           --man guestfs-examples.3 \
75           --html $(top_builddir)/html/guestfs-examples.3.html \
76           --verbatim $(srcdir)/create_disk.c:@EXAMPLE1@ \
77           --verbatim $(srcdir)/inspect_vm.c:@EXAMPLE2@ \
78           $<
79         touch $@
80
81 guestfs-recipes.1 $(top_builddir)/html/guestfs-recipes.1.html: stamp-guestfs-recipes.pod
82
83 stamp-guestfs-recipes.pod: guestfs-recipes.pod
84         $(top_builddir)/podwrapper.sh \
85           --section 1 \
86           --man guestfs-recipes.1 \
87           --html $(top_builddir)/html/guestfs-recipes.1.html \
88           $<
89         touch $@
90
91 guestfs-testing.1 $(top_builddir)/html/guestfs-testing.1.html: stamp-guestfs-testing.pod
92
93 stamp-guestfs-testing.pod: guestfs-testing.pod
94         $(top_builddir)/podwrapper.sh \
95           --section 1 \
96           --man guestfs-testing.1 \
97           --html $(top_builddir)/html/guestfs-testing.1.html \
98           $<
99         touch $@