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 inspector
46 SUBDIRS += ocaml ocaml/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 TODO \
83 libguestfs.pc libguestfs.pc.in \
97 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
100 sh make-recipes.sh recipes/*.sh > $@-t
104 html/guestfs.3.html \
105 html/guestfs-examples.3.html \
106 html/guestfs-ocaml.3.html \
107 html/guestfish.1.html \
108 html/guestmount.1.html \
109 html/virt-cat.1.html \
110 html/virt-df.1.html \
111 html/virt-edit.1.html \
112 html/virt-filesystems.1.html \
113 html/virt-inspector.1.html \
114 html/virt-list-filesystems.1.html \
115 html/virt-list-partitions.1.html \
116 html/virt-ls.1.html \
117 html/virt-make-fs.1.html \
118 html/virt-rescue.1.html \
119 html/virt-resize.1.html \
120 html/virt-tar.1.html \
121 html/virt-win-reg.1.html \
123 html/pod.css html/recipes.css
125 TEXTFILES = BUGS HACKING README RELEASE-NOTES TODO
127 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
129 website: $(HTMLFILES) $(TEXTFILES)
130 cp $(HTMLFILES) $(WEBSITEDIR)
131 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
132 cd $(WEBSITEDIR) && \
134 sed -e "s/SUBST_VERSION/$(VERSION)/" \
135 -e "s/SUBST_DATE/$$date/" \
136 < index.html.in > index.html
138 # When doing 'make dist' update a few files automatically.
140 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
141 cp ChangeLog $(distdir)/ChangeLog
142 $(top_srcdir)/update-bugs.sh > BUGS-t
144 cp BUGS $(distdir)/BUGS
145 git log --pretty="format:%an" | sort -u | \
147 grep -v "Richard Jones" \
150 cp AUTHORS $(distdir)/AUTHORS
152 # Update the list of translatable files in po/POTFILES.in.
155 find $(DIST_SUBDIRS) \
156 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
157 grep -v '^perl/blib/' | \
158 grep -v '^capitests/' | \
159 grep -v '^daemon/lib/' | \
160 grep -v '^daemon/tests/' | \
161 grep -v '^examples/' | \
162 grep -v '^gnulib/' | \
163 grep -v '^perl/examples/' | \
164 grep -v '/guestfs_protocol.c' | \
165 grep -v '/rc_protocol.c' | \
166 grep -v 'appliance/debian/root' | \
167 grep -v '^po-docs/' | \
169 sed 's,^\./,,' > po/POTFILES.in
173 pkgconfigdir = $(libdir)/pkgconfig
174 pkgconfig_DATA = libguestfs.pc
178 CLEANFILES = $(fs_DATA) \
182 guestfs.3 guestfish.1
187 # If you don't want to run all of the tests ('make check') then this
188 # will just run libguestfs-test-tool for a quick check. Note this
189 # is NOT a substitute for proper testing!
192 test-tool/run-test-tool-locally
194 # Mostly static binary distribution.
196 # Some binaries are relinked partially statically. You can make these
197 # binaries "more static" by making sure that as many foo-static
198 # packages are installed as possible.
200 # We remove the supermin appliance and adjust some directories to make
201 # them non-Fedora-specific.
203 BINTMPDIR = /tmp/libguestfs-bin
208 $(MAKE) DESTDIR=$(BINTMPDIR) install
209 rm -r $(BINTMPDIR)$(libdir)/guestfs/supermin.d
210 rm $(BINTMPDIR)$(libdir)/guestfs/kmod.whitelist
211 mv $(BINTMPDIR)$(prefix)/lib64/* $(BINTMPDIR)$(libdir)
212 mv $(BINTMPDIR)/usr/lib64/* $(BINTMPDIR)$(libdir)
213 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
214 $(MAKE) -C fish guestfish.static
215 cp fish/guestfish.static $(BINTMPDIR)$(bindir)/guestfish
216 $(MAKE) -C fuse guestmount.static
217 cp fuse/guestmount.static $(BINTMPDIR)$(bindir)/guestmount
218 $(MAKE) -C test-tool libguestfs-test-tool.static
219 cp test-tool/libguestfs-test-tool.static $(BINTMPDIR)$(bindir)/libguestfs-test-tool
220 $(MAKE) -C cat virt-cat.static virt-filesystems.static virt-ls.static
221 cp cat/virt-cat.static $(BINTMPDIR)$(bindir)/virt-cat
222 cp cat/virt-filesystems.static $(BINTMPDIR)$(bindir)/virt-filesystems
223 cp cat/virt-ls.static $(BINTMPDIR)$(bindir)/virt-ls
224 $(MAKE) -C inspector virt-inspector.static
225 cp inspector/virt-inspector.static $(BINTMPDIR)$(bindir)/virt-inspector
226 (cd $(BINTMPDIR) && tar cf - .) | \
227 gzip -c -9 > libguestfs-$(VERSION)-$(host_cpu).tar.gz