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_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 \
49 generator_bindtests.ml \
50 generator_errnostring.ml \
53 SOURCES_ML = $(filter %.ml,$(SOURCES))
54 OBJECTS = $(SOURCES_ML:.ml=.cmo)
56 EXTRA_DIST = $(SOURCES) files-generated.txt
58 OCAMLCFLAGS = -warn-error CDEFLMPSUVYZX
59 OCAMLCLIBS = unix.cma str.cma
61 noinst_PROGRAM = generator
66 $(OCAMLC) -o generator $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
69 $(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
72 $(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
78 $(OCAMLDEP) $^ | sed 's/ *$$//' > $@-t
85 # No OCaml compiler. Just replace the generator with a script that
86 # touches stamp-generator and prints a warning.
90 echo 'echo Warning: Install OCaml compiler in order to rebuild the generated files.' >> $@-t
91 echo 'touch generator/stamp-generator' >> $@-t
97 noinst_DATA = stamp-generator
100 # Git removes empty directories, so in cases where the
101 # generator is creating the sole file in a directory, we
102 # have to create the directory first.
103 stamp-generator: generator
104 mkdir -p $(top_srcdir)/perl/lib/Sys
105 mkdir -p $(top_srcdir)/ruby/ext/guestfs
106 mkdir -p $(top_srcdir)/java/com/redhat/et/libguestfs
107 mkdir -p $(top_srcdir)/csharp
108 cd $(top_srcdir) && generator/generator
110 CLEANFILES = $(noinst_DATA) $(noinst_PROGRAM) *.cmi *.cmo *~
112 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly