2 # Copyright (C) 2009-2010 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
46 SUBDIRS += ocaml ocaml/examples
49 SUBDIRS += python python/examples
52 SUBDIRS += ruby ruby/examples
64 # Unconditional because nothing is built yet.
67 # Perl tools and guestmount.
76 # po-docs must come after tools, inspector.
82 BUGS HACKING RELEASE-NOTES ROADMAP TODO \
83 libguestfs.pc libguestfs.pc.in \
95 libtool-kill-dependency_libs.sh \
97 bugs-in-changelog.sh \
101 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
104 sh make-recipes.sh recipes/*.sh > $@-t
108 html/guestfs.3.html \
109 html/guestfs-examples.3.html \
110 html/guestfs-ocaml.3.html \
111 html/guestfs-python.3.html \
112 html/guestfs-ruby.3.html \
113 html/guestfish.1.html \
114 html/guestmount.1.html \
115 html/virt-cat.1.html \
116 html/virt-df.1.html \
117 html/virt-edit.1.html \
118 html/virt-filesystems.1.html \
119 html/virt-inspector.1.html \
120 html/virt-list-filesystems.1.html \
121 html/virt-list-partitions.1.html \
122 html/virt-ls.1.html \
123 html/virt-make-fs.1.html \
124 html/virt-rescue.1.html \
125 html/virt-resize.1.html \
126 html/virt-tar.1.html \
127 html/virt-win-reg.1.html \
129 html/pod.css html/recipes.css
131 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
133 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
135 website: $(HTMLFILES) $(TEXTFILES)
136 cp $(HTMLFILES) $(WEBSITEDIR)
137 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
138 cd $(WEBSITEDIR) && \
140 sed -e "s/SUBST_VERSION/$(VERSION)/" \
141 -e "s/SUBST_DATE/$$date/" \
142 < index.html.in > index.html
144 # When doing 'make dist' update a few files automatically.
146 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
147 cp ChangeLog $(distdir)/ChangeLog
148 $(top_srcdir)/update-bugs.sh > BUGS-t
150 cp BUGS $(distdir)/BUGS
151 git log --pretty="format:%an" | sort -u | \
153 grep -v "Richard Jones" \
156 cp AUTHORS $(distdir)/AUTHORS
158 # Update the list of translatable files in po/POTFILES.in.
161 find $(DIST_SUBDIRS) \
162 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
163 grep -v '^perl/blib/' | \
164 grep -v '^capitests/' | \
165 grep -v '^daemon/lib/' | \
166 grep -v '^daemon/tests/' | \
167 grep -v '^examples/' | \
168 grep -v '^gnulib/' | \
169 grep -v '^perl/examples/' | \
170 grep -v '/guestfs_protocol.c' | \
171 grep -v '/rc_protocol.c' | \
172 grep -v 'appliance/debian/root' | \
173 grep -v '^po-docs/' | \
175 sed 's,^\./,,' > po/POTFILES.in
179 pkgconfigdir = $(libdir)/pkgconfig
180 pkgconfig_DATA = libguestfs.pc
188 # If you don't want to run all of the tests ('make check') then this
189 # will just run libguestfs-test-tool for a quick check. Note this
190 # is NOT a substitute for proper testing!
193 test-tool/run-test-tool-locally
195 # Make binary distribution.
197 BINTMPDIR = /tmp/libguestfs-bin
202 $(MAKE) DESTDIR=$(BINTMPDIR) install
203 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
204 (cd $(BINTMPDIR) && tar cf - .) | \
205 gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz