2 # Copyright (C) 2009-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.
24 CLEANFILES = *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so
25 CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so
28 -I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \
30 $(WARN_CFLAGS) $(WERROR_CFLAGS)
34 noinst_DATA = mlhivex.cma mlhivex.cmxa META
36 OBJS = hivex_c.o hivex.cmo
37 XOBJS = $(OBJS:.cmo=.cmx)
40 $(OCAMLMKLIB) -o mlhivex $^ -L$(top_builddir)/lib/.libs -lhivex
42 mlhivex.cmxa: $(XOBJS)
43 $(OCAMLMKLIB) -o mlhivex $^ -L$(top_builddir)/lib/.libs -lhivex
46 $(CC) $(AM_CPPFLAGS) $(CFLAGS) -fPIC -Wall -c $<
49 LD_LIBRARY_PATH=$(top_builddir)/lib/.libs \
52 TESTS = t/hivex_005_load
53 noinst_DATA += $(TESTS)
55 t/hivex_005_load: t/hivex_005_load.cmx mlhivex.cmxa
57 $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/lib/.libs -I . -package unix -linkpkg mlhivex.cmxa $< -o $@
59 # Need to rebuild the tests from source if the main library has
60 # changed at all, otherwise we get inconsistent assumptions.
61 t/%.cmx: t/%.ml mlhivex.cmxa
62 $(OCAMLFIND) ocamlopt -package unix -linkpkg -c $< -o $@
65 $(OCAMLFIND) ocamlc -package unix -c $< -o $@
67 $(OCAMLFIND) ocamlc -package unix -c $< -o $@
69 $(OCAMLFIND) ocamlopt -package unix -c $< -o $@
73 .depend: $(wildcard *.mli) $(wildcard *.ml)
75 $(OCAMLFIND) ocamldep $^ | sed 's/ *$$//' | sort > $@-t
80 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
82 # Do the installation by hand, because we want to run ocamlfind.
84 mkdir -p $(DESTDIR)$(OCAMLLIB)
85 mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
86 $(OCAMLFIND) install \
87 -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
89 META *.so *.a *.cma *.cmx *.cmxa *.cmi *.mli
91 CLEANFILES += $(noinst_DATA)
95 # Tell version 3.79 and up of GNU make to not build goals in this
96 # directory in parallel. (See RHBZ#502309).