2 # Copyright (C) 2011-2012 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.
18 OCAMLPACKAGES = -package unix,camlp4.lib
21 -g -warn-error CDEFLMPSUVYZX \
23 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
25 # In alphabetical order.
28 wrappi_accumulator.mli \
29 wrappi_accumulator.ml \
30 wrappi_boilerplate.mli \
31 wrappi_boilerplate.ml \
50 # The difference between LIB_OBJECTS and OBJECTS is just that
51 # functions and types in LIB_OBJECTS can be used in pa_wrap and in the
52 # code generated from the API objects (../APIs/*.api). LIB_OBJECTS
53 # are built into generator_lib.cma which is linked to pa_wrap, and to
54 # the APIs, and into the generator.
56 # In dependency order.
61 wrappi_accumulator.cmo
65 wrappi_boilerplate.cmo \
73 noinst_SCRIPTS = generator_lib.cma pa_wrap.cmo generator
75 generator_lib.cma: $(LIB_OBJECTS)
76 $(OCAMLFIND) ocamlc -a $^ -o $@
78 pa_wrap.cmo: pa_wrap.ml generator_lib.cma
79 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
80 -linkpkg generator_lib.cma \
84 generator: generator_lib.cma $(OBJECTS) ../APIs/apis.cma
85 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
86 -linkpkg generator_lib.cma ../APIs/apis.cma $(OBJECTS) \
89 ../APIs/apis.cma: generator_lib.cma pa_wrap.cmo
90 $(MAKE) -C ../APIs apis.cma
93 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
95 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
97 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
100 noinst_DATA = stamp-generator
102 stamp-generator: generator
103 cd $(top_srcdir) && generator/generator
109 $(OCAMLFIND) ocamldep $^ | \
110 $(SED) -e 's/ *$$//' | \
111 $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
117 CLEANFILES = *.cmi *.cmo *.cmx *.cma *.cmxa *~ generator
119 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly