Implement RString and RStringList return types.
[libguestfs.git] / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009 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 ACLOCAL_AMFLAGS = -I m4
19
20 SUBDIRS = src daemon fish examples
21
22 EXTRA_DIST = \
23         make-initramfs.sh update-initramfs.sh \
24         guestfs.pod guestfs-actions.pod \
25         libguestfs.spec \
26         HACKING
27
28 # Build the root filesystem.
29 # Currently this is arch-dependent, so it seems like putting it in
30 # $(libdir) is best.  When we build cross-architecture filesystems we
31 # should probably move them to $(datadir).
32
33 fsdir = $(libdir)/guestfs
34
35 INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img
36 VMLINUZ = vmlinuz.$(REPO).$(host_cpu)
37
38 fs_DATA =  $(INITRAMFSIMG) $(VMLINUZ)
39
40 $(INITRAMFSIMG) $(VMLINUZ): initramfs/fakeroot.log
41
42 initramfs/fakeroot.log: make-initramfs.sh.in
43         -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
44         -mv $(VMLINUZ) $(VMLINUZ).bak
45         if ! bash $(builddir)/make-initramfs.sh; then rm -f $@; exit 1; fi
46
47 $(INITRAMFSIMG): initramfs/fakeroot.log daemon/guestfsd
48         rm -f $@
49         bash $(builddir)/update-initramfs.sh
50         touch $@
51
52 # Make clean.
53
54 CLEANFILES = $(fs_DATA) emptydisk
55
56 clean-local:
57         rm -rf initramfs
58
59 # Manual page.
60 # guestfs-actions.pod is autogenerated.  There is no include mechanism
61 # for POD, so we have to do it by hand.
62
63 man_MANS = guestfs.3
64
65 guestfs.3: guestfs.pod guestfs-actions.pod
66         sed -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' < $< | \
67         $(POD2MAN) \
68           --section 3 \
69           -c "Virtualization Support" \
70           --name "guestfs" \
71           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
72           > $@
73
74 # Test-boot the image.
75
76 test-boot: emptydisk
77         qemu-system-$(host_cpu) \
78           -m 384 \
79           -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
80           -hda emptydisk
81
82 emptydisk:
83         rm -f emptydisk
84         dd if=/dev/zero of=emptydisk bs=1024 count=1440
85         echo 0, | sfdisk -q -C 80 -H 2 -S 18 emptydisk > /dev/null
86
87 # This is a more realistic test boot command line which better
88 # reflects what the library does.
89
90 test-boot-realistic: emptydisk
91         qemu-system-$(host_cpu) \
92           -m 384 \
93           -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
94           -hda emptydisk \
95           -append "console=ttyS0 guestfs=10.0.2.4:6666" \
96           -nographic \
97           -serial stdio \
98           -net channel,6666:unix:/tmp/sock,server,nowait \
99           -net user,vlan=0 \
100           -net nic,vlan=0