Move febootstrap into src/ subdirectory.
[febootstrap.git] / src / Makefile.am
1 # febootstrap Makefile.am
2 # (C) Copyright 2009-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 # Written by Richard W.M. Jones <rjones@redhat.com>
19
20 # Note these must be in build dependency order.
21 SOURCES = \
22         config.ml \
23         febootstrap_cmdline.mli \
24         febootstrap_cmdline.ml \
25         febootstrap_utils.mli \
26         febootstrap_utils.ml \
27         febootstrap_package_handlers.mli \
28         febootstrap_package_handlers.ml \
29         febootstrap_yum_rpm.ml \
30         febootstrap_debian.ml \
31         febootstrap_pacman.ml \
32         febootstrap.ml
33
34 CLEANFILES = *~ *.cmi *.cmo *.cmx *.o febootstrap
35
36 EXTRA_DIST = \
37         febootstrap.8 \
38         febootstrap.pod \
39         $(SOURCES)
40
41 man_MANS = \
42         febootstrap.8
43
44 bin_SCRIPTS = febootstrap
45
46 SOURCES_ML = $(filter %.ml,$(SOURCES))
47 BOBJECTS = $(SOURCES_ML:.ml=.cmo)
48 XOBJECTS = $(SOURCES_ML:.ml=.cmx)
49
50 if !HAVE_OCAMLOPT
51 OBJECTS = $(BOBJECTS)
52 BEST    = c
53 else
54 OBJECTS = $(XOBJECTS)
55 BEST    = opt
56 endif
57
58 OCAMLPACKAGES = -package unix,str
59 OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
60
61 febootstrap: $(OBJECTS)
62         $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
63           $^ -o $@
64
65 .mli.cmi:
66         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
67 .ml.cmo:
68         $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
69 .ml.cmx:
70         $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
71
72 depend: .depend
73
74 .depend: $(SOURCES)
75         rm -f $@ $@-t
76         $(OCAMLFIND) ocamldep $^ > $@-t
77         mv $@-t $@
78
79 include .depend
80
81 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
82
83 if HAVE_PERLDOC
84
85 febootstrap.8: febootstrap.pod
86         pod2man \
87           --section 8 \
88           -c "Virtualization Support" \
89           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
90           $< > $@
91
92 noinst_DATA = \
93         ../html/febootstrap.8.html
94
95 ../html/febootstrap.8.html: febootstrap.pod
96         mkdir -p ../html
97         pod2html \
98           --css 'pod.css' \
99           --htmldir ../html \
100           --outfile ../html/febootstrap.8.html \
101           febootstrap.pod
102
103 endif