2 # Copyright (C) 2009 Red Hat Inc.
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.
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.
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.
18 ACLOCAL_AMFLAGS = -I m4
20 SUBDIRS = src daemon fish examples images
39 make-initramfs.sh update-initramfs.sh \
40 guestfs.pod guestfs-actions.pod guestfs-structs.pod \
41 guestfish.pod guestfish-actions.pod \
46 libguestfs.pc libguestfs.pc.in
48 # Build the root filesystem.
49 # Currently this is arch-dependent, so it seems like putting it in
50 # $(libdir) is best. When we build cross-architecture filesystems we
51 # should probably move them to $(datadir).
53 fsdir = $(libdir)/guestfs
55 INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img
56 VMLINUZ = vmlinuz.$(REPO).$(host_cpu)
58 fs_DATA = $(INITRAMFSIMG) $(VMLINUZ)
60 $(INITRAMFSIMG) $(VMLINUZ): initramfs/fakeroot.log
62 initramfs/fakeroot.log: make-initramfs.sh.in
63 -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
64 -mv $(VMLINUZ) $(VMLINUZ).bak
65 if ! bash $(builddir)/make-initramfs.sh; then rm -f $@; exit 1; fi
67 $(INITRAMFSIMG): initramfs/fakeroot.log daemon/guestfsd
69 bash $(builddir)/update-initramfs.sh
72 # Tests. These are auto-generated from the test descriptions.
74 check_PROGRAMS = tests
76 tests_SOURCES = tests.c
78 -I$(top_builddir)/src -Wall
79 tests_LDADD = $(top_builddir)/src/libguestfs.la
81 TESTS = $(check_PROGRAMS)
83 $(TESTS): $(INITRAMFS) $(VMLINUZ)
86 # guestfs-actions.pod and guestfs-structs are autogenerated. There is
87 # no include mechanism for POD, so we have to do it by hand.
89 man_MANS = guestfs.3 guestfish.1
91 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
93 -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
94 -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
98 -c "Virtualization Support" \
100 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
103 guestfish.1: guestfish.pod guestfish-actions.pod
105 -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
109 -c "Virtualization Support" \
111 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
114 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
116 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
118 -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
119 -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
123 --title "libguestfs API documentation" \
127 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
129 -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
133 --title "guestfish, libguestfs filesystem interactive shell" \
137 website: html/guestfs.3.html html/guestfish.1.html
138 cp $^ html/pod.css $(HOME)/d/redhat/et-website/libguestfs/
142 pkgconfigdir = $(libdir)/pkgconfig
143 pkgconfig_DATA = libguestfs.pc
145 # Test-boot the image.
148 qemu-system-$(host_cpu) \
150 -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
155 dd if=/dev/zero of=emptydisk bs=1024 count=1440
156 echo 0, | sfdisk -q -C 80 -H 2 -S 18 emptydisk > /dev/null
158 # This is a more realistic test boot command line which better
159 # reflects what the library does.
161 test-boot-realistic: emptydisk
162 qemu-system-$(host_cpu) \
164 -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
166 -append "console=ttyS0 guestfs=10.0.2.4:6666" \
169 -net channel,6666:unix:/tmp/sock,server,nowait \
175 CLEANFILES = $(fs_DATA) emptydisk pod2htm?.tmp *~ html/*~