boot: Stop hard-coding the bridge name.
[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_reboot.mli \
36         mclu_status.mli \
37         mclu_viewer.mli \
38         parallel.mli \
39         template.mli \
40         utils.mli
41
42 # These must appear in dependency order.
43 SOURCES_ML = \
44         config.ml \
45         utils.ml \
46         parallel.ml \
47         template.ml \
48         mclu_conf.ml \
49         mclu_list.ml \
50         mclu_status.ml \
51         mclu_onoff.ml \
52         mclu_destroy.ml \
53         mclu_reboot.ml \
54         mclu_console.ml \
55         mclu_viewer.ml \
56         mclu_boot.ml \
57         mclu.ml
58
59 OCAMLPACKAGES = -package unix,pcre,libvirt
60 OCAMLFLAGS = -g -warn-error CDEFLMPSUVYZX-3
61
62 BOBJECTS = $(SOURCES_ML:.ml=.cmo)
63 XOBJECTS = $(BOBJECTS:.cmo=.cmx)
64 if !HAVE_OCAMLOPT
65 OBJECTS  = $(BOBJECTS)
66 BEST     = ocamlc
67 else
68 OBJECTS  = $(XOBJECTS)
69 BEST     = ocamlopt
70 endif
71
72 bin_PROGRAMS = mclu
73 mclu_SOURCES = exit.c
74 mclu_CPPFLAGS = -I$(OCAMLLIB)
75 mclu_DEPENDENCIES = $(OBJECTS)
76 mclu_LINK = \
77         ./link.sh \
78           $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \
79           $(OBJECTS) -o $@
80
81 .mli.cmi:
82         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
83 .ml.cmo:
84         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
85 if HAVE_OCAMLOPT
86 .ml.cmx:
87         $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
88 endif
89
90 # Dependencies.
91 depend: .depend
92
93 .depend: $(SOURCES_MLI) $(SOURCES_ML)
94         rm -f $@ $@-t
95         $(OCAMLFIND) ocamldep -I $(abs_srcdir) -I . $^ | \
96           $(SED) 's/ *$$//' | \
97           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
98           $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
99           sort > $@-t
100         mv $@-t $@
101
102 -include .depend
103
104 DISTCLEANFILES = .depend
105 .PHONY: depend
106
107 # Configuration file.
108 sysconf_DATA = mclu.conf
109
110 # Documentation.
111 man_MANS = mclu.1
112
113 mclu.1: mclu.pod
114         $(POD2MAN) \
115             -c "Virtualization Support" \
116             --release "$(PACKAGE)-$(VERSION)" \
117             $< > $@-t
118         mv $@-t $@