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 appliance fish po examples images
46 guestfs.pod guestfs-actions.pod guestfs-structs.pod \
47 guestfish.pod guestfish-actions.pod \
51 libguestfs.pc libguestfs.pc.in \
62 contrib/febootstrap/install.title \
63 contrib/febootstrap/install.html \
64 contrib/febootstrap/install.sh \
67 # Tests. These are auto-generated from the test descriptions
70 check_PROGRAMS = tests test-command
72 tests_SOURCES = tests.c
74 -I$(top_builddir)/src -Wall
75 tests_LDADD = $(top_builddir)/src/libguestfs.la
77 TESTS = tests test-bootbootboot.sh
79 SKIP_TEST_COMMAND=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
80 SKIP_TEST_COMMAND_LINES=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
81 SKIP_TEST_ZEROFREE=$(shell test -x initramfs/usr/sbin/zerofree || echo 1) \
84 # Run the tests under valgrind.
87 $(MAKE) check VG="valgrind --quiet --leak-check=full"
89 # This binary must be statically linked. It is used for testing
90 # the "guestfs_command" and "guestfs_command_lines" functions.
92 test_command_SOURCES = test-command.c
93 test_command_LDFLAGS = -all-static
96 # guestfs-actions.pod and guestfs-structs are autogenerated. There is
97 # no include mechanism for POD, so we have to do it by hand.
99 man_MANS = guestfs.3 guestfish.1
101 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
103 -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
104 -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
108 -c "Virtualization Support" \
110 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
113 guestfish.1: guestfish.pod guestfish-actions.pod
115 -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
119 -c "Virtualization Support" \
121 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
124 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
126 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
128 -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
129 -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
133 --title "libguestfs API documentation" \
137 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
139 -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
143 --title "guestfish, libguestfs filesystem interactive shell" \
148 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
150 sh make-recipes.sh recipes/*.sh > $@-t
153 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
154 html/virt-inspector.1.html \
156 html/pod.css html/recipes.css
158 TEXTFILES = README TODO HACKING
160 WEBSITEDIR = $(HOME)/d/redhat/et-website/libguestfs
162 website: $(HTMLFILES) $(TEXTFILES)
163 cp $(HTMLFILES) $(WEBSITEDIR)
164 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
166 # Generate the ChangeLog automatically from the gitlog.
169 ./gitlog-to-changelog > ChangeLog
170 cp ChangeLog $(distdir)/ChangeLog
174 pkgconfigdir = $(libdir)/pkgconfig
175 pkgconfig_DATA = libguestfs.pc
179 CLEANFILES = $(fs_DATA) emptydisk pod2htm?.tmp