2 # Copyright (C) 2010-2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 generator_actions.mli \
23 generator_actions.ml \
24 generator_structs.mli \
25 generator_structs.ml \
26 generator_api_versions.mli \
27 generator_api_versions.ml \
28 generator_optgroups.ml \
29 generator_prepopts.mli \
30 generator_prepopts.ml \
34 generator_docstrings.ml \
39 generator_capitests.ml \
46 generator_haskell.ml \
50 generator_bindtests.ml \
51 generator_errnostring.ml \
54 SOURCES_ML = $(filter %.ml,$(SOURCES))
55 OBJECTS = $(SOURCES_ML:.ml=.cmo)
57 EXTRA_DIST = $(SOURCES) files-generated.txt
59 OCAMLCFLAGS = -warn-error CDEFLMPSUVYZX
60 OCAMLCLIBS = unix.cma str.cma
62 noinst_PROGRAM = generator
66 $(srcdir)/generator: $(OBJECTS)
67 $(OCAMLC) -I $(srcdir) -o $@ $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
70 $(OCAMLC) -I $(srcdir) $(OCAMLCFLAGS) -c $< -o $@
73 $(OCAMLC) -I $(srcdir) $(OCAMLCFLAGS) -c $< -o $@
79 $(OCAMLDEP) $^ | sed 's/ *$$//' > $@-t
86 # No OCaml compiler. Just replace the generator with a script that
87 # touches stamp-generator and prints a warning.
89 $(srcdir)/generator: $(SOURCES)
91 echo 'echo Warning: Install OCaml compiler in order to rebuild the generated files.' >> $@-t
92 echo 'touch generator/stamp-generator' >> $@-t
98 noinst_DATA = stamp-generator
101 # Git removes empty directories, so in cases where the
102 # generator is creating the sole file in a directory, we
103 # have to create the directory first.
104 stamp-generator: generator
105 mkdir -p $(top_srcdir)/perl/lib/Sys
106 mkdir -p $(top_srcdir)/ruby/ext/guestfs
107 mkdir -p $(top_srcdir)/java/com/redhat/et/libguestfs
108 mkdir -p $(top_srcdir)/csharp
109 cd $(top_srcdir) && generator/generator
111 CLEANFILES = $(noinst_DATA) $(noinst_PROGRAM) *.cmi *.cmo *~
113 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly