X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=cil-tools%2FMakefile.in;h=c439eccfb3ff2aae8f6692f576243434c1104308;hb=HEAD;hp=4acf3913efae64457a619886713ee94484de0fe0;hpb=c4206b0394401252481d028c25b0b877edce2128;p=ocaml-bitstring.git diff --git a/cil-tools/Makefile.in b/cil-tools/Makefile.in index 4acf391..c439ecc 100644 --- a/cil-tools/Makefile.in +++ b/cil-tools/Makefile.in @@ -1,4 +1,4 @@ -# Bitmatch syntax extension. +# Bitstring CIL tools for processing C code. # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones # # This library is free software; you can redistribute it and/or @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -# $Id: Makefile.in 81 2008-05-21 09:59:21Z richard.wm.jones $ +# $Id$ PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ @@ -25,51 +25,78 @@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLDOC = @OCAMLDOC@ INSTALL = @INSTALL@ +enable_coverage = @enable_coverage@ + OCAMLCFLAGS = -g -OCAMLCPACKAGES = -package unix,str,extlib,cil -I .. -OCAMLCLIBS = $(OCAMLCPACKAGES) -linkpkg ../bitmatch.cma +OCAMLCPACKAGES = -package dynlink,unix,str,extlib,cil -I +camlp4 -I .. +OCAMLCLIBS = $(OCAMLCPACKAGES) camlp4lib.cma -linkpkg ../bitstring.cma ../bitstring_persistent.cma OCAMLOPTFLAGS = OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) -OCAMLOPTLIBS = $(OCAMLOPTPACKAGES) -linkpkg ../bitmatch.cmxa +OCAMLOPTLIBS = $(OCAMLOPTPACKAGES) camlp4lib.cmxa -linkpkg ../bitstring.cmxa ../bitstring_persistent.cmxa + +ifneq ($(enable_coverage),no) +OCAMLCLIBS := -I +bisect bisect.cma $(OCAMLCLIBS) +OCAMLOPTLIBS := -I +bisect bisect.cmxa $(OCAMLOPTLIBS) +endif + +PP = -pp "camlp4o -I .. bitstring.cma bitstring_persistent.cma pa_bitstring.cmo" OCAMLDOCFLAGS = -html -sort -all: bitmatch-import-c bitmatch-import-c.opt +all: bitstring-import-c bitstring-import-c.opt -bitmatch-import-c: bitmatch_import_c.cmo +bitstring-import-c: bitstring_import_c.cmo $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCLIBS) $< -o $@ -bitmatch-import-c.opt: bitmatch_import_c.cmx +bitstring-import-c.opt: bitstring_import_c.cmx $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) $< -o $@ test: # Examples. +# +# To compile task_struct you'll need to grab a copy of the Linux +# kernel original header files and set the directory below. #DEBUG = DEBUG = --debug -LINUX_HEADERS = linux-2.6.25.4-headers +LINUX_HEADERS = linux-2.6.25.7-headers LINUX_INCLUDES = -I $(LINUX_HEADERS) -examples: ext3.ml task_struct.ml +#EXAMPLES = ext3 task_struct +EXAMPLES = ext3 -ext3.ml: ext3.c bitmatch-import-c - cd $(LINUX_HEADERS) && ln -sf asm-x86 asm +examples: $(EXAMPLES) + +ext3: ext3.cmo + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCLIBS) $< -o $@ + +ext3.cmo: ext3.ml ext3.bmpp + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $(PP) -c $< -o $@ + +ext3.bmpp: ext3.c bitstring-import-c rm -f $@.new - ./bitmatch-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new + ./bitstring-import-c $(DEBUG) $< > $@.new mv $@.new $@ -task_struct.ml: task_struct.c bitmatch-import-c +task_struct: task_struct.cmo + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCLIBS) $< -o $@ + +task_struct.cmo: task_struct.ml task_struct.bmpp + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $(PP) -c $< -o $@ + +task_struct.bmpp: task_struct.c bitstring-import-c cd $(LINUX_HEADERS) && ln -sf asm-x86 asm rm -f $@.new - ./bitmatch-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new + ./bitstring-import-c $(DEBUG) $(LINUX_INCLUDES) $< > $@.new mv $@.new $@ # Clean. clean: - rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o - rm -f bitmatch-import-c bitmatch-import-c.opt + rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o *.bmpp + rm -f bitstring-import-c bitstring-import-c.opt + rm -f ext3 task_struct distclean: clean @@ -88,7 +115,7 @@ install: depend: .depend -.depend: bitmatch_import_c.ml +.depend: bitstring_import_c.ml rm -f .depend $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@