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
43 SUBDIRS += ocaml ocaml/examples
61 # Unconditional because nothing is built yet.
64 # Virt-inspector, tools and guestmount.
77 # po-docs must come after tools, inspector.
83 BUGS HACKING RELEASE-NOTES TODO \
84 libguestfs.pc libguestfs.pc.in \
97 # HTML versions of manual pages.
99 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
101 html/guestfs.3.html: src/guestfs.pod \
102 src/guestfs-actions.pod \
103 src/guestfs-availability.pod \
104 src/guestfs-structs.pod
107 -e '/@ACTIONS@/rsrc/guestfs-actions.pod' \
109 -e '/@AVAILABILITY@/rsrc/guestfs-availability.pod' \
110 -e 's/@AVAILABILITY@//' \
111 -e '/@STRUCTS@/rsrc/guestfs-structs.pod' \
116 --title "libguestfs API documentation" \
120 html/guestfish.1.html: fish/guestfish.pod fish/guestfish-actions.pod fish/guestfish-commands.pod
123 -e '/@ACTIONS@/rfish/guestfish-actions.pod' -e 's/@ACTIONS@//' \
124 -e '/@FISH_COMMANDS@/rfish/guestfish-commands.pod' -e 's/@FISH_COMMANDS@//' \
128 --title "guestfish, libguestfs filesystem interactive shell" \
133 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
136 sh make-recipes.sh recipes/*.sh > $@-t
140 html/guestfs.3.html \
141 html/guestfish.1.html \
142 html/guestmount.1.html \
143 html/virt-cat.1.html \
144 html/virt-df.1.html \
145 html/virt-edit.1.html \
146 html/virt-inspector.1.html \
147 html/virt-list-filesystems.1.html \
148 html/virt-list-partitions.1.html \
149 html/virt-ls.1.html \
150 html/virt-make-fs.1.html \
151 html/virt-rescue.1.html \
152 html/virt-resize.1.html \
153 html/virt-tar.1.html \
154 html/virt-win-reg.1.html \
156 html/pod.css html/recipes.css
158 TEXTFILES = BUGS HACKING README RELEASE-NOTES TODO
160 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
162 website: $(HTMLFILES) $(TEXTFILES)
163 cp $(HTMLFILES) $(WEBSITEDIR)
164 for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
165 cd $(WEBSITEDIR) && \
167 sed -e "s/SUBST_VERSION/$(VERSION)/" \
168 -e "s/SUBST_DATE/$$date/" \
169 < index.html.in > index.html
171 # When doing 'make dist' update a few files automatically.
173 $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
174 cp ChangeLog $(distdir)/ChangeLog
175 $(top_srcdir)/update-bugs > BUGS-t
177 cp BUGS $(distdir)/BUGS
179 # Update the list of translatable files in po/POTFILES.in.
182 find $(DIST_SUBDIRS) \
183 -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
184 grep -v '^perl/blib/' | \
185 grep -v '^capitests/' | \
186 grep -v '^daemon/lib/' | \
187 grep -v '^daemon/tests/' | \
188 grep -v '^examples/' | \
189 grep -v '^gnulib/' | \
190 grep -v '^perl/examples/' | \
191 grep -v '/guestfs_protocol.c' | \
192 grep -v '/rc_protocol.c' | \
193 grep -v 'appliance/debian/root' | \
194 grep -v '^po-docs/' | \
196 sed 's,^\./,,' > po/POTFILES.in
200 pkgconfigdir = $(libdir)/pkgconfig
201 pkgconfig_DATA = libguestfs.pc
205 CLEANFILES = $(fs_DATA) \
209 guestfs.3 guestfish.1
214 # If you don't want to run all of the tests ('make check') then this
215 # will just run libguestfs-test-tool for a quick check. Note this
216 # is NOT a substitute for proper testing!
219 test-tool/run-test-tool-locally
221 # Mostly static binary distribution.
223 # Some binaries are relinked partially statically. You can make these
224 # binaries "more static" by making sure that as many foo-static
225 # packages are installed as possible.
227 # We remove the supermin appliance and adjust some directories to make
228 # them non-Fedora-specific.
230 BINTMPDIR = /tmp/libguestfs-bin
235 $(MAKE) DESTDIR=$(BINTMPDIR) install
236 rm -r $(BINTMPDIR)$(libdir)/guestfs/supermin.d
237 rm $(BINTMPDIR)$(libdir)/guestfs/kmod.whitelist
238 mv $(BINTMPDIR)$(prefix)/lib64/* $(BINTMPDIR)$(libdir)
239 mv $(BINTMPDIR)/usr/lib64/* $(BINTMPDIR)$(libdir)
240 -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
241 $(MAKE) -C fish guestfish.static
242 cp fish/guestfish.static $(BINTMPDIR)$(bindir)/guestfish
243 $(MAKE) -C fuse guestmount.static
244 cp fuse/guestmount.static $(BINTMPDIR)$(bindir)/guestmount
245 $(MAKE) -C test-tool libguestfs-test-tool.static
246 cp test-tool/libguestfs-test-tool.static $(BINTMPDIR)$(bindir)/libguestfs-test-tool
247 (cd $(BINTMPDIR) && tar cf - .) | \
248 gzip -c -9 > libguestfs-$(VERSION)-$(host_cpu).tar.gz