1 # libguestfs virt-resize 2.0 tools
2 # Copyright (C) 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
25 CLEANFILES = *~ *.cmi *.cmo *.cmx *.cmxa *.o virt-resize test.img
37 # Note this list must be in dependency order.
43 bin_SCRIPTS = virt-resize
45 # -I $(top_builddir)/src/.libs is a hack which forces corresponding -L
46 # option to be passed to gcc, so we don't try linking against an
47 # installed copy of libguestfs.
48 OCAMLPACKAGES = -package pcre -I $(top_builddir)/src/.libs -I ../ocaml
50 OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
51 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
53 virt-resize: $(OBJECTS)
54 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) mlguestfs.cmxa -linkpkg $^ -o $@
57 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
59 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
61 $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
63 # Manual pages and HTML files for the website.
65 man_MANS = virt-resize.1
67 noinst_DATA = $(top_builddir)/html/virt-resize.1.html
69 virt-resize.1 $(top_builddir)/html/virt-resize.1.html: stamp-virt-resize.pod
71 stamp-virt-resize.pod: virt-resize.pod
72 $(top_builddir)/podwrapper.sh \
74 --html $(top_builddir)/html/virt-resize.1.html \
78 CLEANFILES += stamp-virt-resize.pod
82 check_SCRIPTS = utils_tests
84 utils_tests: utils.cmx utils_tests.cmx
85 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
86 mlguestfs.cmxa -linkpkg $^ -cclib -lncurses -o $@
88 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
91 MALLOC_PERTURB_=$(random_val) \
92 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
93 LIBGUESTFS_PATH=$(top_builddir)/appliance \
94 TMPDIR=$(top_builddir)
96 TESTS = test-virt-resize.sh utils_tests
101 .depend: $(wildcard *.mli) $(wildcard *.ml)
103 $(OCAMLFIND) ocamldep -I ../ocaml $^ | \
104 $(SED) 's/ *$$//' | \
105 $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
116 # Parallel builds don't obey dependencies for some reason we