1 # Bitmatch syntax extension.
2 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
9 # This library 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 GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 # $Id: Makefile.in 81 2008-05-21 09:59:21Z richard.wm.jones $
20 PACKAGE = @PACKAGE_NAME@
21 VERSION = @PACKAGE_VERSION@
23 OCAMLFIND = @OCAMLFIND@
24 OCAMLMKLIB = @OCAMLMKLIB@
29 OCAMLCPACKAGES = -package unix,str,extlib,cil -I ..
30 OCAMLCLIBS = $(OCAMLCPACKAGES) -linkpkg ../bitmatch.cma
32 OCAMLOPTPACKAGES = $(OCAMLCPACKAGES)
33 OCAMLOPTLIBS = $(OCAMLOPTPACKAGES) -linkpkg ../bitmatch.cmxa
35 OCAMLDOCFLAGS = -html -sort
37 all: bitmatch-import-c bitmatch-import-c.opt
39 bitmatch-import-c: bitmatch_import_c.cmo
40 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCLIBS) $< -o $@
42 bitmatch-import-c.opt: bitmatch_import_c.cmx
43 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) $< -o $@
51 LINUX_HEADERS = linux-2.6.25.4-headers
52 LINUX_INCLUDES = -I $(LINUX_HEADERS)
54 examples: ext3.ml task_struct.ml
56 ext3.ml: ext3.c bitmatch-import-c
57 cd $(LINUX_HEADERS) && ln -sf asm-x86 asm
59 ./bitmatch-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new
62 task_struct.ml: task_struct.c bitmatch-import-c
63 cd $(LINUX_HEADERS) && ln -sf asm-x86 asm
65 ./bitmatch-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new
71 rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o
72 rm -f bitmatch-import-c bitmatch-import-c.opt
83 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
85 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
87 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
91 .depend: bitmatch_import_c.ml
93 $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@
95 ifeq ($(wildcard .depend),.depend)
99 .PHONY: depend dist check-manifest dpkg doc \
100 print-examples print-tests examples test
102 .SUFFIXES: .cmo .cmi .cmx .ml .mli .mll