3dcbe1fd4431fb6ce2f289dd9dbdc0e9261850f0
[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.ml
36
37 CLEANFILES = *~ *.cmi *.cmo *.cmx *.o febootstrap
38
39 EXTRA_DIST = \
40         .gitignore \
41         .gitmodules \
42         autogen.sh \
43         febootstrap.8 \
44         febootstrap.pod \
45         m4/gnulib-cache.m4 \
46         $(SOURCES)
47
48 man_MANS = \
49         febootstrap.8
50
51 bin_SCRIPTS = febootstrap
52
53 SOURCES_ML = $(filter %.ml,$(SOURCES))
54 BOBJECTS = $(SOURCES_ML:.ml=.cmo)
55 XOBJECTS = $(SOURCES_ML:.ml=.cmx)
56
57 if !HAVE_OCAMLOPT
58 OBJECTS = $(BOBJECTS)
59 else
60 OBJECTS = $(XOBJECTS)
61 endif
62
63 OCAMLPACKAGES = -package unix,str
64 OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
65
66 febootstrap: $(OBJECTS)
67         $(OCAMLFIND) $(OCAMLBEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
68           $^ -o $@
69
70 .mli.cmi:
71         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
72 .ml.cmo:
73         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
74 .ml.cmx:
75         $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
76
77 depend: .depend
78
79 .depend: $(SOURCES)
80         rm -f $@ $@-t
81         $(OCAMLFIND) ocamldep $^ > $@-t
82         mv $@-t $@
83
84 include .depend
85
86 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
87
88 if HAVE_PERLDOC
89
90 febootstrap.8: febootstrap.pod
91         pod2man \
92           --section 8 \
93           -c "Virtualization Support" \
94           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
95           $< > $@
96 endif