resize: Don't build this directory in parallel.
[libguestfs.git] / resize / Makefile.am
1 # libguestfs virt-resize 2.0 tools
2 # Copyright (C) 2011 Red Hat Inc.
3 #
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.
8 #
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.
13 #
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.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 EXTRA_DIST = \
21         $(SOURCES) \
22         run-resize-locally \
23         virt-resize.pod \
24         test-virt-resize.sh
25
26 CLEANFILES = *~ *.cmi *.cmo *.cmx *.cmxa *.o virt-resize test.img
27
28 if HAVE_OCAML
29 if HAVE_OCAML_PCRE
30
31 # Alphabetical order.
32 SOURCES = \
33         progress.ml \
34         resize.ml \
35         utils.ml
36
37 # Note this list must be in dependency order.
38 OBJECTS = \
39         utils.cmx \
40         progress.cmx \
41         resize.cmx
42
43 bin_SCRIPTS = virt-resize
44
45 OCAMLPACKAGES = -package pcre -I ../ocaml
46 OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
47 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
48
49 virt-resize: $(OBJECTS)
50         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) mlguestfs.cmxa -linkpkg $^ -o $@
51
52 .mli.cmi:
53         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
54 .ml.cmo:
55         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
56 .ml.cmx:
57         $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
58
59 # Manual pages and HTML files for the website.
60
61 man_MANS = virt-resize.1
62
63 noinst_DATA = $(top_builddir)/html/virt-resize.1.html
64
65 virt-resize.1 $(top_builddir)/html/virt-resize.1.html: stamp-virt-resize.pod
66
67 stamp-virt-resize.pod: virt-resize.pod
68         $(top_srcdir)/podwrapper.sh \
69           --man virt-resize.1 \
70           --html $(top_builddir)/html/virt-resize.1.html \
71           $<
72         touch $@
73
74 # Tests.
75
76 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
77
78 TESTS_ENVIRONMENT = \
79         MALLOC_PERTURB_=$(random_val) \
80         LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
81         LIBGUESTFS_PATH=$(top_builddir)/appliance
82
83 TESTS = test-virt-resize.sh
84
85 # Dependencies.
86 depend: .depend
87
88 .depend: $(wildcard *.mli) $(wildcard *.ml)
89         rm -f $@ $@-t
90         $(OCAMLFIND) ocamldep $(OCAMLPACKAGES) $^ | \
91           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
92           sort > $@-t
93         mv $@-t $@
94
95 include .depend
96
97 .PHONY: depend docs
98
99 endif
100 endif
101
102 # Parallel builds don't obey dependencies for some reason we
103 # don't understand.
104 .NOTPARALLEL: