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 # Basic source for the library.
23 SUBDIRS = gnulib/lib tests/data tests/guests generator src examples po
33 SUBDIRS += gnulib/tests tests/c-api tests/qemu
34 SUBDIRS += tests/protocol tests/lvm tests/luks tests/md
35 SUBDIRS += tests/regressions
36 SUBDIRS += tests/extra
38 # libguestfs-test-tool
45 SUBDIRS += align cat df edit inspector rescue
49 SUBDIRS += perl perl/examples
52 SUBDIRS += ocaml ocaml/examples
55 SUBDIRS += python python/examples
58 SUBDIRS += ruby ruby/examples
61 SUBDIRS += java java/examples
70 SUBDIRS += erlang erlang/examples
73 # Unconditional because nothing is built yet.
76 # virt-resize (new version) and virt-sparsify are written in OCaml.
78 SUBDIRS += resize sparsify
91 # virt-tools in shell. This uses guestmount and virt-inspector.
96 # po-docs must come after tools, inspector.
103 BUGS HACKING RELEASE-NOTES ROADMAP TODO \
105 bugs-in-changelog.sh \
108 contrib/autobuild/autobuild.sh \
109 contrib/guestfsd-in-wine.sh \
110 contrib/intro/libguestfs-intro.html \
111 contrib/intro/overview.svg \
112 contrib/intro/talk.txt \
113 contrib/intro/tools.svg \
115 contrib/visualize-alignment/.gitignore \
116 contrib/visualize-alignment/guestfish-add-mount.qtr \
117 contrib/visualize-alignment/guestfish-lv-ext4-4k.qtr \
118 contrib/visualize-alignment/guestfish-lv-ext4-4k-write-hello.qtr \
119 contrib/visualize-alignment/guestfish-N-fs-10M-aligned-part-disk.qtr \
120 contrib/visualize-alignment/guestfish-N-fs-10M.qtr \
121 contrib/visualize-alignment/guestfish-write-hello.qtr \
122 contrib/visualize-alignment/qemu-0.13-trace-block-device-access.patch \
123 contrib/visualize-alignment/README \
124 contrib/visualize-alignment/tracetops.ml \
131 debian/guestfish.dirs \
132 debian/guestfish.install \
133 debian/guestfsd.dirs \
134 debian/guestfsd.install \
135 debian/guestmount.dirs \
136 debian/guestmount.install \
137 debian/libguestfs-dev.dirs \
138 debian/libguestfs-dev.install \
139 debian/libguestfs-doc.docs \
140 debian/libguestfs-perl.examples \
141 debian/libguestfs-perl.install \
142 debian/libguestfs-tools.dirs \
143 debian/libguestfs-tools.install \
144 debian/libguestfs0.dirs \
145 debian/libguestfs0.install \
146 debian/patches/series \
147 debian/python-guestfs.install \
150 debian/shlibs.local \
153 libguestfs.pc libguestfs.pc.in \
154 libtool-kill-dependency_libs.sh \
155 logo/fish.svg logo/fish.png \
161 html/guestfs.3.html \
162 html/guestfs-examples.3.html \
163 html/guestfs-erlang.3.html \
164 html/guestfs-java.3.html \
165 html/guestfs-ocaml.3.html \
166 html/guestfs-perl.3.html \
167 html/guestfs-python.3.html \
168 html/guestfs-recipes.1.html \
169 html/guestfs-ruby.3.html \
170 html/guestfs-testing.1.html \
171 html/guestfish.1.html \
172 html/guestmount.1.html \
173 html/virt-alignment-scan.1.html \
174 html/virt-cat.1.html \
175 html/virt-copy-in.1.html \
176 html/virt-copy-out.1.html \
177 html/virt-df.1.html \
178 html/virt-edit.1.html \
179 html/virt-filesystems.1.html \
180 html/virt-inspector.1.html \
181 html/virt-list-filesystems.1.html \
182 html/virt-list-partitions.1.html \
183 html/virt-ls.1.html \
184 html/virt-make-fs.1.html \
185 html/virt-rescue.1.html \
186 html/virt-resize.1.html \
187 html/virt-sparsify.1.html \
188 html/virt-sysprep.1.html \
189 html/virt-tar.1.html \
190 html/virt-tar-in.1.html \
191 html/virt-tar-out.1.html \
192 html/virt-win-reg.1.html
194 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
196 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
198 website: $(HTMLFILES) $(TEXTFILES)
199 cp $(HTMLFILES) $(WEBSITEDIR)
200 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
201 cd $(WEBSITEDIR) && \
203 sed -e "s/SUBST_VERSION/$(VERSION)/" \
204 -e "s/SUBST_DATE/$$date/" \
205 < index.html.in > index.html
207 # When doing 'make dist' update a few files automatically.
209 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
210 cp ChangeLog $(distdir)/ChangeLog
211 $(top_srcdir)/update-bugs.sh > BUGS-t
213 cp BUGS $(distdir)/BUGS
214 git log --pretty="format:%an" | sort -u | \
216 grep -v "Richard Jones" \
219 cp AUTHORS $(distdir)/AUTHORS
221 # Update the list of translatable files in po/POTFILES.in.
224 find $(DIST_SUBDIRS) \
225 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
226 grep -v '^perl/blib/' | \
227 grep -v '^tests/' | \
228 grep -v '^daemon/lib/' | \
229 grep -v '^daemon/tests/' | \
230 grep -v '^examples/' | \
231 grep -v '^gnulib/' | \
232 grep -v '^perl/examples/' | \
233 grep -v '/guestfs_protocol.c' | \
234 grep -v '/rc_protocol.c' | \
235 grep -v 'appliance/debian/root' | \
236 grep -v '^po-docs/' | \
237 grep -v '^images/' | \
239 sed 's,^\./,,' > po/POTFILES.in
243 pkgconfigdir = $(libdir)/pkgconfig
244 pkgconfig_DATA = libguestfs.pc
252 # If you don't want to run all of the tests ('make check') then this
253 # will just run libguestfs-test-tool for a quick check. Note this
254 # is NOT a substitute for proper testing!
257 ./run test-tool/libguestfs-test-tool $(QUICKCHECK_TEST_TOOL_ARGS)
259 # Run extra-tests in tests/extra/ subdirectory.
262 make -C tests/extra $@
264 # Make binary distribution.
266 BINTMPDIR = /tmp/libguestfs-bin
271 $(MAKE) DESTDIR=$(BINTMPDIR) install
272 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
273 (cd $(BINTMPDIR) && tar cf - .) | \
274 gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz