2 # Copyright (C) 2010 Red Hat Inc.
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.
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.
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.
22 generator_actions.mli \
23 generator_actions.ml \
24 generator_structs.mli \
25 generator_structs.ml \
26 generator_optgroups.ml \
27 generator_prepopts.mli \
28 generator_prepopts.ml \
31 generator_docstrings.ml \
36 generator_capitests.ml \
43 generator_haskell.ml \
46 generator_bindtests.ml \
49 SOURCES_ML = $(filter %.ml,$(SOURCES))
50 OBJECTS = $(SOURCES_ML:.ml=.cmo)
52 EXTRA_DIST = $(SOURCES)
54 OCAMLCFLAGS = -I +xml-light -I +../pkg-lib/xml-light -warn-error CDEFLMPSUVYZX
55 OCAMLCLIBS = xml-light.cma unix.cma str.cma
57 noinst_PROGRAM = generator
62 $(OCAMLC) -o generator $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
65 $(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
68 $(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
74 $(OCAMLDEP) $^ | sed 's/ *$$//' > $@-t
81 # No OCaml compiler. Just replace the generator with a script that
82 # touches stamp-generator and prints a warning.
86 echo 'echo Warning: Install OCaml compiler in order to rebuild the generated files.' >> $@-t
87 echo 'touch generator/stamp-generator' >> $@-t
93 noinst_DATA = stamp-generator
96 # Git removes empty directories, so in cases where the
97 # generator is creating the sole file in a directory, we
98 # have to create the directory first.
99 stamp-generator: generator
100 mkdir -p $(top_srcdir)/perl/lib/Sys
101 mkdir -p $(top_srcdir)/ruby/ext/guestfs
102 mkdir -p $(top_srcdir)/java/com/redhat/et/libguestfs
103 mkdir -p $(top_srcdir)/csharp
104 cd $(top_srcdir) && generator/generator
106 CLEANFILES = $(noinst_DATA) $(noinst_PROGRAM) *.cmi *.cmo *~
108 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly