952d6026d5384236030266b7f3afe291b4ca4122
[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., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 EXTRA_DIST = \
19         LICENSE \
20         guestfs-examples.pod
21
22 CLEANFILES = stamp-guestfs-examples.pod
23
24 noinst_PROGRAMS = create_disk inspect_vm
25 if HAVE_HIVEX
26 noinst_PROGRAMS += virt-dhcp-address
27 endif
28
29 create_disk_SOURCES = create_disk.c
30 create_disk_CFLAGS = \
31         -DGUESTFS_WARN_DEPRECATED=1 \
32         -I$(top_srcdir)/src -I$(top_builddir)/src \
33         $(WARN_CFLAGS) $(WERROR_CFLAGS)
34 create_disk_LDADD = \
35         $(top_builddir)/src/libguestfs.la
36
37 inspect_vm_SOURCES = inspect_vm.c
38 inspect_vm_CFLAGS = \
39         -DGUESTFS_WARN_DEPRECATED=1 \
40         -I$(top_srcdir)/src -I$(top_builddir)/src \
41         $(WARN_CFLAGS) $(WERROR_CFLAGS)
42 inspect_vm_LDADD = \
43         $(top_builddir)/src/libguestfs.la
44
45 virt_dhcp_address_SOURCES = virt-dhcp-address.c
46 virt_dhcp_address_CFLAGS = \
47         -DGUESTFS_WARN_DEPRECATED=1 \
48         -I$(top_srcdir)/src -I$(top_builddir)/src \
49         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
50         $(HIVEX_CFLAGS)
51 virt_dhcp_address_LDADD = \
52         $(HIVEX_LIBS) \
53         $(top_builddir)/src/libguestfs.la
54
55 man_MANS = guestfs-examples.3
56 noinst_DATA = $(top_builddir)/html/guestfs-examples.3.html
57
58 guestfs-examples.3 $(top_builddir)/html/guestfs-examples.3.html: stamp-guestfs-examples.pod
59
60 stamp-guestfs-examples.pod: guestfs-examples.pod create_disk.c inspect_vm.c
61         $(top_srcdir)/podwrapper.sh \
62           --section 3 \
63           --man guestfs-examples.3 \
64           --html $(top_builddir)/html/guestfs-examples.3.html \
65           --verbatim create_disk.c:@EXAMPLE1@ \
66           --verbatim inspect_vm.c:@EXAMPLE2@ \
67           $<
68         touch $@