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 regressions test-tool
39 SUBDIRS += cat df inspector rescue
43 SUBDIRS += perl perl/examples
46 SUBDIRS += ocaml ocaml/examples
49 SUBDIRS += python python/examples
52 SUBDIRS += ruby ruby/examples
64 # Unconditional because nothing is built yet.
67 # virt-resize 2.0 is written in OCaml.
74 # Perl tools and guestmount.
83 # po-docs must come after tools, inspector.
91 BUGS HACKING RELEASE-NOTES ROADMAP TODO \
92 libguestfs.pc libguestfs.pc.in \
104 libtool-kill-dependency_libs.sh \
106 bugs-in-changelog.sh \
108 logo/fish.svg logo/fish.png
111 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
114 sh make-recipes.sh recipes/*.sh > $@-t
118 html/guestfs.3.html \
119 html/guestfs-examples.3.html \
120 html/guestfs-ocaml.3.html \
121 html/guestfs-perl.3.html \
122 html/guestfs-python.3.html \
123 html/guestfs-ruby.3.html \
124 html/guestfish.1.html \
125 html/guestmount.1.html \
126 html/virt-cat.1.html \
127 html/virt-copy-in.1.html \
128 html/virt-copy-out.1.html \
129 html/virt-df.1.html \
130 html/virt-edit.1.html \
131 html/virt-filesystems.1.html \
132 html/virt-inspector.1.html \
133 html/virt-list-filesystems.1.html \
134 html/virt-list-partitions.1.html \
135 html/virt-ls.1.html \
136 html/virt-make-fs.1.html \
137 html/virt-rescue.1.html \
138 html/virt-resize.1.html \
139 html/virt-tar.1.html \
140 html/virt-tar-in.1.html \
141 html/virt-tar-out.1.html \
142 html/virt-win-reg.1.html \
144 html/pod.css html/recipes.css
146 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
148 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
150 website: $(HTMLFILES) $(TEXTFILES)
151 cp $(HTMLFILES) $(WEBSITEDIR)
152 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
153 cd $(WEBSITEDIR) && \
155 sed -e "s/SUBST_VERSION/$(VERSION)/" \
156 -e "s/SUBST_DATE/$$date/" \
157 < index.html.in > index.html
159 # When doing 'make dist' update a few files automatically.
161 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
162 cp ChangeLog $(distdir)/ChangeLog
163 $(top_srcdir)/update-bugs.sh > BUGS-t
165 cp BUGS $(distdir)/BUGS
166 git log --pretty="format:%an" | sort -u | \
168 grep -v "Richard Jones" \
171 cp AUTHORS $(distdir)/AUTHORS
173 # Update the list of translatable files in po/POTFILES.in.
176 find $(DIST_SUBDIRS) \
177 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
178 grep -v '^perl/blib/' | \
179 grep -v '^capitests/' | \
180 grep -v '^daemon/lib/' | \
181 grep -v '^daemon/tests/' | \
182 grep -v '^examples/' | \
183 grep -v '^gnulib/' | \
184 grep -v '^perl/examples/' | \
185 grep -v '/guestfs_protocol.c' | \
186 grep -v '/rc_protocol.c' | \
187 grep -v 'appliance/debian/root' | \
188 grep -v '^po-docs/' | \
190 sed 's,^\./,,' > po/POTFILES.in
194 pkgconfigdir = $(libdir)/pkgconfig
195 pkgconfig_DATA = libguestfs.pc
203 # If you don't want to run all of the tests ('make check') then this
204 # will just run libguestfs-test-tool for a quick check. Note this
205 # is NOT a substitute for proper testing!
208 test-tool/run-test-tool-locally
210 # Make binary distribution.
212 BINTMPDIR = /tmp/libguestfs-bin
217 $(MAKE) DESTDIR=$(BINTMPDIR) install
218 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
219 (cd $(BINTMPDIR) && tar cf - .) | \
220 gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz