Committing NON-WORKING cil tools directory. This code all needs
[ocaml-bitstring.git] / cil-tools / Makefile.in
1 # Bitmatch syntax extension.
2 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
3 #
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.
8 #
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.
13 #
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
17 #
18 # $Id: Makefile.in 81 2008-05-21 09:59:21Z richard.wm.jones $
19
20 PACKAGE         = @PACKAGE_NAME@
21 VERSION         = @PACKAGE_VERSION@
22
23 OCAMLFIND       = @OCAMLFIND@
24 OCAMLMKLIB      = @OCAMLMKLIB@
25 OCAMLDOC        = @OCAMLDOC@
26 INSTALL         = @INSTALL@
27
28 OCAMLCFLAGS     = -g
29 OCAMLCPACKAGES  = -package unix,str,extlib,cil -I ..
30 OCAMLCLIBS      = $(OCAMLCPACKAGES) -linkpkg ../bitmatch.cma
31 OCAMLOPTFLAGS   =
32 OCAMLOPTPACKAGES = $(OCAMLCPACKAGES)
33 OCAMLOPTLIBS    = $(OCAMLOPTPACKAGES) -linkpkg ../bitmatch.cmxa
34
35 OCAMLDOCFLAGS   = -html -sort
36
37 all:            bitmatch-import-c bitmatch-import-c.opt
38
39 bitmatch-import-c: bitmatch_import_c.cmo
40         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCLIBS) $< -o $@
41
42 bitmatch-import-c.opt: bitmatch_import_c.cmx
43         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) $< -o $@
44
45 test:
46
47 # Examples.
48
49 #DEBUG          =
50 DEBUG           = --debug
51 LINUX_HEADERS   = linux-2.6.25.4-headers
52 LINUX_INCLUDES  = -I $(LINUX_HEADERS)
53
54 examples: ext3.ml task_struct.ml
55
56 ext3.ml: ext3.c bitmatch-import-c
57         cd $(LINUX_HEADERS) && ln -sf asm-x86 asm
58         rm -f $@.new
59         ./bitmatch-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new
60         mv $@.new $@
61
62 task_struct.ml: task_struct.c bitmatch-import-c
63         cd $(LINUX_HEADERS) && ln -sf asm-x86 asm
64         rm -f $@.new
65         ./bitmatch-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new
66         mv $@.new $@
67
68 # Clean.
69
70 clean:
71         rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o
72         rm -f bitmatch-import-c bitmatch-import-c.opt
73
74 distclean: clean
75
76 # Install.
77
78 install:
79
80 # Standard rules.
81
82 .mli.cmi:
83         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
84 .ml.cmo:
85         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
86 .ml.cmx:
87         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
88
89 depend: .depend
90
91 .depend: bitmatch_import_c.ml
92         rm -f .depend
93         $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@
94
95 ifeq ($(wildcard .depend),.depend)
96 include .depend
97 endif
98
99 .PHONY: depend dist check-manifest dpkg doc \
100         print-examples print-tests examples test
101
102 .SUFFIXES:      .cmo .cmi .cmx .ml .mli .mll