Implement 'mclu destroy' command.
[mclu.git] / Makefile.am
1 # mclu: Mini Cloud
2 # Copyright (C) 2014-2015 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 CLEANFILES = *~ *.cmi *.cmo *.cmx
19
20 ACLOCAL_AMFLAGS = -I m4
21
22 EXTRA_DIST = \
23         $(SOURCES_MLI) \
24         $(SOURCES_ML) \
25         templates/rawhide.sh
26
27 # In alphabetical order.
28 SOURCES_MLI = \
29         mclu_boot.mli \
30         mclu_conf.mli \
31         mclu_console.mli \
32         mclu_destroy.mli \
33         mclu_list.mli \
34         mclu_onoff.mli \
35         mclu_status.mli \
36         parallel.mli \
37         template.mli \
38         utils.mli
39
40 # These must appear in dependency order.
41 SOURCES_ML = \
42         config.ml \
43         utils.ml \
44         parallel.ml \
45         template.ml \
46         mclu_conf.ml \
47         mclu_list.ml \
48         mclu_status.ml \
49         mclu_onoff.ml \
50         mclu_boot.ml \
51         mclu_destroy.ml \
52         mclu_console.ml \
53         mclu.ml
54
55 OCAMLPACKAGES = -package unix,pcre,libvirt
56 OCAMLFLAGS = -g -warn-error CDEFLMPSUVYZX-3
57
58 BOBJECTS = $(SOURCES_ML:.ml=.cmo)
59 XOBJECTS = $(BOBJECTS:.cmo=.cmx)
60 if !HAVE_OCAMLOPT
61 OBJECTS  = $(BOBJECTS)
62 BEST     = ocamlc
63 else
64 OBJECTS  = $(XOBJECTS)
65 BEST     = ocamlopt
66 endif
67
68 bin_PROGRAMS = mclu
69 # Since there are no real C sources (at least, not yet) we have a
70 # token C file that is empty, just to keep automake happy.  The real
71 # sources are *.ml files.
72 mclu_SOURCES = empty.c
73 mclu_DEPENDENCIES = $(OBJECTS)
74 mclu_LINK = \
75         ./link.sh \
76           $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \
77           $(OBJECTS) -o $@
78
79 .mli.cmi:
80         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
81 .ml.cmo:
82         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
83 if HAVE_OCAMLOPT
84 .ml.cmx:
85         $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
86 endif
87
88 # Dependencies.
89 depend: .depend
90
91 .depend: $(SOURCES_MLI) $(SOURCES_ML)
92         rm -f $@ $@-t
93         $(OCAMLFIND) ocamldep -I $(abs_srcdir) -I . $^ | \
94           $(SED) 's/ *$$//' | \
95           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
96           $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
97           sort > $@-t
98         mv $@-t $@
99
100 -include .depend
101
102 DISTCLEANFILES = .depend
103 .PHONY: depend
104
105 # Configuration file.
106 sysconf_DATA = mclu.conf
107
108 # Documentation.
109 man_MANS = mclu.1
110
111 mclu.1: mclu.pod
112         $(POD2MAN) \
113             -c "Virtualization Support" \
114             --release "$(PACKAGE)-$(VERSION)" \
115             $< > $@-t
116         mv $@-t $@