Version 3.4.
[febootstrap.git] / Makefile.am
1 # febootstrap Makefile.am
2 # (C) Copyright 2009-2010 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 # Written by Richard W.M. Jones <rjones@redhat.com>
19
20 ACLOCAL_AMFLAGS = -I m4
21
22 SUBDIRS = lib helper
23
24 # Note these must be in build dependency order.
25 SOURCES = \
26         config.ml \
27         febootstrap_utils.mli \
28         febootstrap_utils.ml \
29         febootstrap_cmdline.mli \
30         febootstrap_cmdline.ml \
31         febootstrap_package_handlers.mli \
32         febootstrap_package_handlers.ml \
33         febootstrap_yum_rpm.ml \
34         febootstrap_debian.ml \
35         febootstrap_pacman.ml \
36         febootstrap.ml
37
38 CLEANFILES = *~ *.cmi *.cmo *.cmx *.o febootstrap
39
40 EXTRA_DIST = \
41         .gitignore \
42         .gitmodules \
43         autogen.sh \
44         febootstrap.8 \
45         febootstrap.pod \
46         html/pod.css \
47         m4/gnulib-cache.m4 \
48         $(SOURCES)
49
50 man_MANS = \
51         febootstrap.8
52
53 bin_SCRIPTS = febootstrap
54
55 SOURCES_ML = $(filter %.ml,$(SOURCES))
56 BOBJECTS = $(SOURCES_ML:.ml=.cmo)
57 XOBJECTS = $(SOURCES_ML:.ml=.cmx)
58
59 if !HAVE_OCAMLOPT
60 OBJECTS = $(BOBJECTS)
61 else
62 OBJECTS = $(XOBJECTS)
63 endif
64
65 OCAMLPACKAGES = -package unix,str
66 OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
67
68 febootstrap: $(OBJECTS)
69         $(OCAMLFIND) $(OCAMLBEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
70           $^ -o $@
71
72 .mli.cmi:
73         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
74 .ml.cmo:
75         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
76 .ml.cmx:
77         $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
78
79 depend: .depend
80
81 .depend: $(SOURCES)
82         rm -f $@ $@-t
83         $(OCAMLFIND) ocamldep $^ > $@-t
84         mv $@-t $@
85
86 include .depend
87
88 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
89
90 if HAVE_PERLDOC
91
92 febootstrap.8: febootstrap.pod
93         pod2man \
94           --section 8 \
95           -c "Virtualization Support" \
96           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
97           $< > $@
98
99 noinst_DATA = \
100         html/febootstrap.8.html
101
102 html/febootstrap.8.html: febootstrap.pod
103         mkdir -p html
104         pod2html \
105           --css 'pod.css' \
106           --htmldir html \
107           --outfile html/febootstrap.8.html \
108           febootstrap.pod
109
110 endif
111
112 # Maintainer website update.
113 HTMLFILES = \
114         html/febootstrap.8.html \
115         html/febootstrap-supermin-helper.8.html
116
117 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
118
119 website: $(HTMLFILES)
120         cp $(HTMLFILES) $(WEBSITEDIR)
121
122 CLEANFILES += $(HTMLFILES) pod2*.tmp