2 # Copyright (C) 2009-2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 include $(top_srcdir)/subdir-rules.mk
20 ACLOCAL_AMFLAGS = -I m4
22 # Gnulib - must be built and tested before the library.
23 SUBDIRS = gnulib/lib gnulib/tests
25 # Basic source for the library.
26 SUBDIRS += tests/data generator src examples po
35 # Tests - order is important.
37 SUBDIRS += tests/guests
38 SUBDIRS += tests/c-api
39 SUBDIRS += tests/protocol
43 SUBDIRS += tests/regressions
45 # Extra tests don't run by default. You have to do 'make extra-tests'.
46 SUBDIRS += tests/extra
48 # libguestfs-test-tool
55 SUBDIRS += align cat df edit inspector rescue
59 SUBDIRS += perl perl/examples
62 SUBDIRS += ocaml ocaml/examples
65 SUBDIRS += python python/examples
68 SUBDIRS += ruby ruby/examples
71 SUBDIRS += java java/examples
80 SUBDIRS += erlang erlang/examples
83 # Unconditional because nothing is built yet.
86 # virt-resize (new version) and virt-sparsify are written in OCaml.
88 SUBDIRS += resize sparsify
101 # virt-tools in shell. This uses guestmount and virt-inspector.
106 # po-docs must come after tools, inspector.
113 BUGS HACKING RELEASE-NOTES ROADMAP TODO \
115 bugs-in-changelog.sh \
118 contrib/autobuild/autobuild.sh \
119 contrib/guestfsd-in-wine.sh \
120 contrib/intro/libguestfs-intro.html \
121 contrib/intro/overview.svg \
122 contrib/intro/talk.txt \
123 contrib/intro/tools.svg \
125 contrib/visualize-alignment/.gitignore \
126 contrib/visualize-alignment/guestfish-add-mount.qtr \
127 contrib/visualize-alignment/guestfish-lv-ext4-4k.qtr \
128 contrib/visualize-alignment/guestfish-lv-ext4-4k-write-hello.qtr \
129 contrib/visualize-alignment/guestfish-N-fs-10M-aligned-part-disk.qtr \
130 contrib/visualize-alignment/guestfish-N-fs-10M.qtr \
131 contrib/visualize-alignment/guestfish-write-hello.qtr \
132 contrib/visualize-alignment/qemu-0.13-trace-block-device-access.patch \
133 contrib/visualize-alignment/README \
134 contrib/visualize-alignment/tracetops.ml \
141 debian/guestfish.dirs \
142 debian/guestfish.install \
143 debian/guestfsd.dirs \
144 debian/guestfsd.install \
145 debian/guestmount.dirs \
146 debian/guestmount.install \
147 debian/libguestfs-dev.dirs \
148 debian/libguestfs-dev.install \
149 debian/libguestfs-doc.docs \
150 debian/libguestfs-perl.examples \
151 debian/libguestfs-perl.install \
152 debian/libguestfs-tools.dirs \
153 debian/libguestfs-tools.install \
154 debian/libguestfs0.dirs \
155 debian/libguestfs0.install \
156 debian/patches/series \
157 debian/python-guestfs.install \
160 debian/shlibs.local \
163 libguestfs.pc libguestfs.pc.in \
164 libtool-kill-dependency_libs.sh \
165 logo/fish.svg logo/fish.png \
171 html/guestfs.3.html \
172 html/guestfs-examples.3.html \
173 html/guestfs-erlang.3.html \
174 html/guestfs-java.3.html \
175 html/guestfs-ocaml.3.html \
176 html/guestfs-perl.3.html \
177 html/guestfs-python.3.html \
178 html/guestfs-recipes.1.html \
179 html/guestfs-ruby.3.html \
180 html/guestfs-testing.1.html \
181 html/guestfish.1.html \
182 html/guestmount.1.html \
183 html/virt-alignment-scan.1.html \
184 html/virt-cat.1.html \
185 html/virt-copy-in.1.html \
186 html/virt-copy-out.1.html \
187 html/virt-df.1.html \
188 html/virt-edit.1.html \
189 html/virt-filesystems.1.html \
190 html/virt-inspector.1.html \
191 html/virt-list-filesystems.1.html \
192 html/virt-list-partitions.1.html \
193 html/virt-ls.1.html \
194 html/virt-make-fs.1.html \
195 html/virt-rescue.1.html \
196 html/virt-resize.1.html \
197 html/virt-sparsify.1.html \
198 html/virt-sysprep.1.html \
199 html/virt-tar.1.html \
200 html/virt-tar-in.1.html \
201 html/virt-tar-out.1.html \
202 html/virt-win-reg.1.html
204 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
206 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
208 website: $(HTMLFILES) $(TEXTFILES)
209 cp $(HTMLFILES) $(WEBSITEDIR)
210 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
211 cd $(WEBSITEDIR) && \
213 sed -e "s/SUBST_VERSION/$(VERSION)/" \
214 -e "s/SUBST_DATE/$$date/" \
215 < index.html.in > index.html
217 # When doing 'make dist' update a few files automatically.
219 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
220 cp ChangeLog $(distdir)/ChangeLog
221 $(top_srcdir)/update-bugs.sh > BUGS-t
223 cp BUGS $(distdir)/BUGS
224 git log --pretty="format:%an <%ae>" | sort -u | uniq -w 10 | \
226 grep -v "Richard Jones" \
229 cp AUTHORS $(distdir)/AUTHORS
231 # Update the list of translatable files in po/POTFILES.in.
234 find $(DIST_SUBDIRS) \
235 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
236 grep -v '^perl/blib/' | \
237 grep -v '^tests/' | \
238 grep -v '^daemon/lib/' | \
239 grep -v '^daemon/tests/' | \
240 grep -v '^examples/' | \
241 grep -v '^gnulib/' | \
242 grep -v '^perl/examples/' | \
243 grep -v '/guestfs_protocol.c' | \
244 grep -v '/rc_protocol.c' | \
245 grep -v 'appliance/debian/root' | \
246 grep -v '^po-docs/' | \
247 grep -v '^images/' | \
249 sed 's,^\./,,' > po/POTFILES.in
253 pkgconfigdir = $(libdir)/pkgconfig
254 pkgconfig_DATA = libguestfs.pc
262 # If you don't want to run all of the tests ('make check') then this
263 # will just run libguestfs-test-tool for a quick check. Note this
264 # is NOT a substitute for proper testing!
267 ./run test-tool/libguestfs-test-tool $(QUICKCHECK_TEST_TOOL_ARGS)
269 # Run extra-tests in tests/extra/ subdirectory.
272 make -C tests/extra $@
274 # Make binary distribution.
276 BINTMPDIR = /tmp/libguestfs-bin
281 $(MAKE) DESTDIR=$(BINTMPDIR) install
282 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
283 (cd $(BINTMPDIR) && tar cf - .) | \
284 gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz