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., 675 Mass Ave, Cambridge, MA 02139, USA.
18 include $(top_srcdir)/subdir-rules.mk
20 ACLOCAL_AMFLAGS = -I m4
22 # Basic source for the library.
23 SUBDIRS = gnulib/lib images generator src examples po
32 # Tests and the test-tool.
33 SUBDIRS += gnulib/tests capitests caution regressions test-tool
39 SUBDIRS += cat df edit inspector rescue
43 SUBDIRS += perl perl/examples
46 SUBDIRS += ocaml ocaml/examples
49 SUBDIRS += python python/examples
52 SUBDIRS += ruby ruby/examples
55 SUBDIRS += java java/examples
64 # Unconditional because nothing is built yet.
67 # virt-resize 2.0 is written in OCaml.
84 # po-docs must come after tools, inspector.
91 BUGS HACKING RELEASE-NOTES ROADMAP TODO \
93 bugs-in-changelog.sh \
103 debian/guestfish.dirs \
104 debian/guestfish.install \
105 debian/guestfsd.dirs \
106 debian/guestfsd.install \
107 debian/guestmount.dirs \
108 debian/guestmount.install \
109 debian/libguestfs-dev.dirs \
110 debian/libguestfs-dev.install \
111 debian/libguestfs-doc.docs \
112 debian/libguestfs-perl.examples \
113 debian/libguestfs-perl.install \
114 debian/libguestfs-tools.dirs \
115 debian/libguestfs-tools.install \
116 debian/libguestfs0.dirs \
117 debian/libguestfs0.install \
118 debian/patches/series \
119 debian/python-guestfs.install \
122 debian/shlibs.local \
125 libguestfs.pc libguestfs.pc.in \
126 libtool-kill-dependency_libs.sh \
127 logo/fish.svg logo/fish.png \
133 html/guestfs.3.html \
134 html/guestfs-examples.3.html \
135 html/guestfs-java.3.html \
136 html/guestfs-ocaml.3.html \
137 html/guestfs-perl.3.html \
138 html/guestfs-python.3.html \
139 html/guestfs-recipes.1.html \
140 html/guestfs-ruby.3.html \
141 html/guestfish.1.html \
142 html/guestmount.1.html \
143 html/virt-cat.1.html \
144 html/virt-copy-in.1.html \
145 html/virt-copy-out.1.html \
146 html/virt-df.1.html \
147 html/virt-edit.1.html \
148 html/virt-filesystems.1.html \
149 html/virt-inspector.1.html \
150 html/virt-list-filesystems.1.html \
151 html/virt-list-partitions.1.html \
152 html/virt-ls.1.html \
153 html/virt-make-fs.1.html \
154 html/virt-rescue.1.html \
155 html/virt-resize.1.html \
156 html/virt-tar.1.html \
157 html/virt-tar-in.1.html \
158 html/virt-tar-out.1.html \
159 html/virt-win-reg.1.html
161 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
163 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
165 website: $(HTMLFILES) $(TEXTFILES)
166 cp $(HTMLFILES) $(WEBSITEDIR)
167 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
168 cd $(WEBSITEDIR) && \
170 sed -e "s/SUBST_VERSION/$(VERSION)/" \
171 -e "s/SUBST_DATE/$$date/" \
172 < index.html.in > index.html
174 # When doing 'make dist' update a few files automatically.
176 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
177 cp ChangeLog $(distdir)/ChangeLog
178 $(top_srcdir)/update-bugs.sh > BUGS-t
180 cp BUGS $(distdir)/BUGS
181 git log --pretty="format:%an" | sort -u | \
183 grep -v "Richard Jones" \
186 cp AUTHORS $(distdir)/AUTHORS
188 # Update the list of translatable files in po/POTFILES.in.
191 find $(DIST_SUBDIRS) \
192 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
193 grep -v '^perl/blib/' | \
194 grep -v '^capitests/' | \
195 grep -v '^daemon/lib/' | \
196 grep -v '^daemon/tests/' | \
197 grep -v '^examples/' | \
198 grep -v '^gnulib/' | \
199 grep -v '^perl/examples/' | \
200 grep -v '/guestfs_protocol.c' | \
201 grep -v '/rc_protocol.c' | \
202 grep -v 'appliance/debian/root' | \
203 grep -v '^po-docs/' | \
205 sed 's,^\./,,' > po/POTFILES.in
209 pkgconfigdir = $(libdir)/pkgconfig
210 pkgconfig_DATA = libguestfs.pc
218 # If you don't want to run all of the tests ('make check') then this
219 # will just run libguestfs-test-tool for a quick check. Note this
220 # is NOT a substitute for proper testing!
223 ./run test-tool/libguestfs-test-tool $(QUICKCHECK_TEST_TOOL_ARGS)
225 # Make binary distribution.
227 BINTMPDIR = /tmp/libguestfs-bin
232 $(MAKE) DESTDIR=$(BINTMPDIR) install
233 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
234 (cd $(BINTMPDIR) && tar cf - .) | \
235 gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz