]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
[ocamldoc] Build-in Ocamldoc support
authorRob Hoes <rob.hoes@citrix.com>
Wed, 28 Oct 2009 17:06:00 +0000 (17:06 +0000)
committerRob Hoes <rob.hoes@citrix.com>
Wed, 28 Oct 2009 17:06:00 +0000 (17:06 +0000)
Typing 'make doc' will generate documentation for the libraries in xen-api-libs. The documentation is integrated in the xen-api documentation (the custom ocamldoc generator in xen-api.hg is used). This only works when xen-api.hg is present in myrepos and 'make doc' has been executed in it.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
28 files changed:
Makefile
camldm/Makefile
cdrom/Makefile
close-and-exec/Makefile
doc/doc.py
eventchn/Makefile
http-svr/Makefile
log/Makefile
mmap/Makefile
pciutil/Makefile
rpc-light/Makefile
rss/Makefile
sexpr/Makefile
stdext/Makefile
stdext/encodings.ml
stdext/encodings.mli
stdext/fring.ml
stdext/fring.mli
stdext/ring.ml
stdext/stringext.mli
stdext/unixext.ml
stunnel/Makefile
uuid/Makefile
xb/Makefile
xc/Makefile
xml-light2/Makefile
xs/Makefile
xsrpc/Makefile

index c61ebab1f21dd97e8b02afba6210e5cb674dc4b3..0c0a45a2bc778ef7c33c0332ea7feacc1419b5b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,28 @@ api-libs: $(OUTPUT_API_PKG) $(MY_SOURCES)/MANIFEST
 .PHONY: xapi-libs
 xapi-libs: $(OUTPUT_XAPI_PKG) $(MY_SOURCES)/MANIFEST
        @ :
+       
+.PHONY: doc
+doc:
+       $(MAKE) -C stdext doc
+       $(MAKE) -C sexpr doc
+       $(MAKE) -C uuid doc
+       $(MAKE) -C log doc
+       $(MAKE) -C xb doc
+       $(MAKE) -C xc doc
+       $(MAKE) -C xs doc
+       $(MAKE) -C xml-light2 doc
+       $(MAKE) -C rpc-light doc
+       $(MAKE) -C http-svr doc
+       $(MAKE) -C camldm doc
+       $(MAKE) -C cdrom doc
+       $(MAKE) -C close-and-exec doc
+       $(MAKE) -C eventchn doc
+       $(MAKE) -C pciutil doc
+       $(MAKE) -C rss doc
+       $(MAKE) -C stunnel doc
+       $(MAKE) -C xsrpc doc
+       $(MAKE) -C mmap doc
 
 .PHONY: clean
 clean:
@@ -158,6 +180,7 @@ clean:
        make -C http-svr clean
        make -C close-and-exec clean
        make -C sexpr clean
+       make -C doc clean
        rm -f $(OUTPUT_API_PKG)
 
 cleanxen:
index 762e414917d2fed5639bafcfe9c657cc0eee5219..808d7cc647fe8f06d6c585c589d334ee56ae7ee4 100644 (file)
@@ -18,6 +18,8 @@ OBJS = camldm
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = camldm.cma camldm.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -60,5 +62,9 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove camldm
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "camldm" "library" "$(OBJS)" "." "" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 17f4cfe581d9d0b8dbe485d5729c0bdde674b55f..ae7e8de3d7525f6cd379a3242657cadef5d87092 100644 (file)
@@ -17,6 +17,8 @@ OBJS = cdrom
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = cdrom.cma cdrom.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -59,6 +61,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove cdrom
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "cdrom" "library" "$(OBJS)" "." "" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index 9c982a2c237894503bb6b1abbb437d678a85afc5..447b40fcbf26b09f225c5cdd1cee0c8658693487 100644 (file)
@@ -21,6 +21,8 @@ LIBS = closeandexec.cmxa closeandexec.cma
 
 PROGRAMS = closeandexec
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS)
 
 bins: $(PROGRAMS)
@@ -68,5 +70,9 @@ uninstall:
 binuninstall:
        rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "close-and-exec" "library" "$(OBJS)" "." "stdext" ""
+       
 clean:
-       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
\ No newline at end of file
+       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index d123c1d2594be1f92b1dee7bc9e3adfc8a6b6838..527b825886d08abbee0e56ba9605012cc1881731 100644 (file)
@@ -21,31 +21,28 @@ xenapi_docdir = '/myrepos/xen-api.hg/ocaml/doc'
 
 docdir = sys.argv[1]
 name = sys.argv[2]
-ctype = sys.argv[3]
+if sys.argv[3] == "library": is_library = True
+else: is_library = False
 modules = set(sys.argv[4].split())
 includes = sys.argv[5].split()
-packs = sys.argv[6].replace(',',' ').split()
-libs = sys.argv[7].split()
-if len(sys.argv) >= 9:
-       pp = '-pp ' + sys.argv[8]
-else:
-       pp = ''
-
-libs = list(set(libs)) # remove duplicates
-packs = list(set(packs))       # remove duplicates
+packs = sys.argv[6]
+libs = sys.argv[7]
 
 dest = docdir + '/content/' + name
 try:
        os.makedirs(dest)
 except:
        pass
+       
+packs = packs.replace(',', ' ')
+packs = packs.split()
 
 if len(packs) > 0:
-       packages = "-package " + ','.join(packs)
+       packages = "-package " + str(','.join(packs))
 else:
        packages = ""
 
-doc_command = 'ocamlfind ocamldoc -v ' + packages + ' -I +threads -sort -g /myrepos/xen-api.hg/ocaml/doc/odoc_json.cma -d ' + dest + ' ' + pp
+doc_command = 'ocamlfind ocamldoc -v ' + packages + ' -I +threads -sort -g /myrepos/xen-api.hg/ocaml/doc/odoc_json.cma -d ' + dest + ' '
 
 files = []
 for m in modules:
@@ -64,13 +61,14 @@ for i in includes:
 
 os.system(doc_command + ' ' + string.join(includesx) + ' ' + string.join(files))
 
-# add dependencies to index files
+# add library dependencies to index files
 
 f = file(dest + '/index.json', 'a')
-packs_s = map(lambda s: '"' + s.split('/')[-1] + '"', packs)
-libs_s = map(lambda s: '"' + s.split('/')[-1] + '"', libs)
-s = 'deps_' + name.replace("-", "") + ' = {"packs": [' + ', '.join(packs_s) + '], '
-s += '"libs": [' + ', '.join(libs_s) + ']}'
+libs = libs.split()
+libs.extend(packs)
+libs = map(lambda s: '"' + s.split('/')[-1] + '"', libs)
+libs = list(set(libs)) # remove duplicates
+s = 'deps_' + name.replace("-", "") + ' = [' + ', '.join(libs) + '];'
 f.write(s)
 f.close()
 
@@ -79,31 +77,25 @@ f.close()
 def update_components(compdir):
        executables = []
        libraries = []
-       packages = []
-       
+
        try:
                f = file(compdir + '/components.js', 'r')
                exec(f.readline())
                exec(f.readline())
-               exec(f.readline())
                f.close()
        except:
                pass
 
-       if ctype == "library":
+       if is_library:
                libraries.append(name)
                libraries = list(set(libraries))
-       elif ctype == "package":
-               packages.append(name)
-               packages = list(set(packages))
        else:
                executables.append(name)
                executables = list(set(executables))
 
        f = file(compdir + '/components.js', 'w')
        f.write('executables = ' + str(executables) + '\n')
-       f.write('libraries = ' + str(libraries) + '\n')
-       f.write('packages = ' + str(packages))
+       f.write('libraries = ' + str(libraries))
        f.close()
 
 update_components(docdir)
index 59002a9d54552d75d027d7979f4c50867f3bdb59..dbe96d0eda1119af22665cdfad513030d339cd88 100644 (file)
@@ -17,6 +17,8 @@ OBJS = eventchn
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = eventchn.cma eventchn.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -59,6 +61,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove eventchn
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "eventchn" "library" "$(OBJS)" "." "" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index d30f3f39906fafc736393806f0000e7801d66aeb..0b2f214f6f643ea21284a4bceb39ac4819b56867 100644 (file)
@@ -17,6 +17,8 @@ OBJS = server_io buf_io http http_svr
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = http_svr.cma http_svr.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS)
 
 bins: $(PROGRAMS)
@@ -52,5 +54,9 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove http-svr
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "http-svr" "library" "$(OBJS)" "." "log,stdext" ""
+       
 clean:
-       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
\ No newline at end of file
+       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 28d9fb6f69388e2edd9a5f86de7756e7c582f74a..22570d9f7cd95be413906f9d4e99b06f20f7ac88 100644 (file)
@@ -19,6 +19,8 @@ OBJS = syslog log logs debug
 INTF = log.cmi logs.cmi syslog.cmi debug.cmi
 LIBS = log.cma log.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -66,5 +68,9 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove log
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "log" "library" "$(OBJS)" "." "stdext" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 960ef1986bc92bb4249eaa93b72e6e4d52070624..2bc1d7e26d9d21f942d18ff980572550b9549dd1 100644 (file)
@@ -17,6 +17,8 @@ OBJS = mmap
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = mmap.cma mmap.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -59,6 +61,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove mmap
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "mmap" "library" "$(OBJS)" "." "" ""
+
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index 3adf0cbe60da71cba71d34b59aa9f3d37cbfb130..7813e8e1455a79d5bff01b978ae769fb6ff920f5 100644 (file)
@@ -19,6 +19,8 @@ OBJS = pciutil
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = pciutil.cma pciutil.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 PROGRAMS = pciutil
 
 all: $(INTF) $(LIBS)
@@ -68,5 +70,9 @@ uninstall:
 binuninstall:
        rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "pciutil" "library" "$(OBJS)" "." "stdext" ""
+       
 clean:
-       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
\ No newline at end of file
+       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 32d7019b68810d31dd0794797b1a36256fb6d281..5dc5e3bb7cc6f217ff757b09368cfe72393e178f 100644 (file)
@@ -5,6 +5,8 @@ PACKS = xmlm
 
 ICAMLP4=-I $(shell ocamlfind query camlp4) -I $(shell ocamlfind query type-conv)
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 .PHONY: all clean
 all: pa_rpc.cma xmlrpc.cmi xmlrpc.cma xmlrpc.cmxa jsonrpc.cmi jsonrpc.cmxa jsonrpc.cma
 
@@ -69,5 +71,9 @@ uninstall:
        ocamlfind remove jsonrpc
        ocamlfind remove rpc-light
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "rpc-light" "library" "jsonrpc pa_rpc rpc xmlrpc" "." "xmlm" ""
+       
 clean:
-       rm -f *.cmo *.cmx *.cma *.cmxa *.annot *.o *.cmi *.a
\ No newline at end of file
+       rm -f *.cmo *.cmx *.cma *.cmxa *.annot *.o *.cmi *.a
index 7458e0712f7a55d78c7a70c96e790788b1a36b1e..d389816ae29593a152fead68a375318e0ec6a09b 100644 (file)
@@ -17,6 +17,8 @@ OBJS = rss
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = rss.cma rss.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -52,5 +54,9 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove rss
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "rss" "library" "$(OBJS)" "." "xml-light2" ""
+       
 clean:
-       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
\ No newline at end of file
+       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 44a0e24d5c3f8aa5b0bfcf8ebdfc6fa7a3389939..3af4d086b93307feac5ffcfc182fa1e5f345fbd2 100644 (file)
@@ -23,6 +23,8 @@ LIBS = sexpr.cma sexpr.cmxa
 
 PROGRAMS = sexprpp
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS)
 
 bins: $(PROGRAMS)
@@ -82,5 +84,9 @@ uninstall:
 binuninstall:
        rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "sexpr" "library" "$(OBJS)" "." "stdext" ""
+       
 clean:
-       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot sExprLexer.ml{,i} sExprParser.ml{,i} $(LIBS) $(PROGRAMS)
\ No newline at end of file
+       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot sExprLexer.ml{,i} sExprParser.ml{,i} $(LIBS) $(PROGRAMS)
index d66774b558107f4af34c58405c883b10f88131b7..01b19d758d99ecd2f061ac061e33e7820ad983c4 100644 (file)
@@ -27,6 +27,8 @@ LIBS = stdext.cma stdext.cmxa
 
 PROGRAMS = base64pp
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+       
 all: $(INTF) $(LIBS)
 
 bins: $(PROGRAMS)
@@ -113,6 +115,10 @@ uninstall:
 binuninstall:
        rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "stdext" "library" "$(STDEXT_OBJS)" "." "threads,uuid,unix" ""
+
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
@@ -121,4 +127,4 @@ clean:
 unixext.cmi: filenameext.cmi
 gzip.cmi: forkhelpers.cmi
 sha1sum.cmi: forkhelpers.cmi
-tar.cmi: bigbuffer.cmi
\ No newline at end of file
+tar.cmi: bigbuffer.cmi
index 2439b1dc003fa422a392c11bc977da737c381d35..15c35136b0e882e675a252f9a463f37b99fb0c0e 100644 (file)
@@ -36,24 +36,13 @@ module UCS = struct
        let min_value = 0x000000l
        let max_value = 0x1fffffl
 
-       (** Returns true if and only if the given value corresponds to a UCS *)
-       (** non-character. Such non-characters are forbidden for use in open *)
-       (** interchange of Unicode text data, and include the following:     *)
-       (**   1. values from 0xFDD0 to 0xFDEF; and                           *)
-       (**   2. values 0xnFFFE and 0xnFFFF, where (0x0 <= n <= 0x10).       *)
-       (** See the Unicode 5.0 Standard, section 16.7 for further details.  *)
        let is_non_character value = false
                || (0xfdd0l <= value && value <= 0xfdefl) (* case 1 *)
                || (Int32.logand 0xfffel value = 0xfffel) (* case 2 *)
 
-       (** Returns true if and only if the given value lies outside the *)
-       (** entire UCS range.                                            *)
        let is_out_of_range value =
                value < min_value || value > max_value
        
-       (** Returns true if and only if the given value corresponds to a UCS *)
-       (** surrogate code point, only for use in UTF-16 encoded strings.    *)
-       (** See the Unicode 5.0 Standard, section 16.6 for further details.  *)
        let is_surrogate value =
                (0xd800l <= value && value <= 0xdfffl)
 
@@ -61,9 +50,6 @@ end
 
 module XML = struct
 
-       (** Returns true if and only if the given value corresponds to *)
-       (** a forbidden control character as defined in section 2.2 of *)
-       (** the XML specification, version 1.0.                        *)
        let is_forbidden_control_character value = value < 0x20l
                && value <> 0x09l
                && value <> 0x0al
@@ -75,15 +61,12 @@ end
 
 module type UCS_VALIDATOR = sig
 
-       (** Validates UCS character values. *)
        val validate : int32 -> unit
 
 end
 
 module UTF8_UCS_validator : UCS_VALIDATOR = struct
 
-       (** Accepts all values within the UCS character value range *)
-       (** except those which are invalid for all UTF-8 documents. *)
        let validate value =
                if UCS.is_out_of_range  value then raise UCS_value_out_of_range;
                if UCS.is_non_character value then raise UCS_value_prohibited_in_UTF8;
@@ -93,8 +76,6 @@ end
 
 module XML_UTF8_UCS_validator : UCS_VALIDATOR = struct
 
-       (** Accepts all values within the UCS character value range except *)
-       (** those which are invalid for all UTF-8-encoded XML documents.   *)
        let validate value =
                UTF8_UCS_validator.validate value;
                if XML.is_forbidden_control_character value
@@ -105,28 +86,14 @@ end
 (* ==== Character Codecs ==== *)
 
 module type CHARACTER_DECODER = sig
-
-       (** Decodes a single character embedded within a string. Given a string  *)
-       (** and an index into that string, returns a tuple (value, width) where: *)
-       (**   value = the value of the character at the given index; and         *)
-       (**   width = the width of the character at the given index, in bytes.   *)
-       (** Raises an appropriate error if the character is invalid.             *)
        val decode_character : string -> int -> int32 * int
-
 end
 
 module type CHARACTER_ENCODER = sig
-
-       (** Encodes a single character value, returning a string containing   *)
-       (** the character. Raises an error if the character value is invalid. *)
        val encode_character : int32 -> string
-
 end
 
 module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) = struct
-
-       (** Given a valid UCS value, returns the canonical *)
-       (** number of bytes required to encode the value.  *)
        let width_required_for_ucs_value value =
                if value < 0x000080l (* 1 <<  7 *) then 1 else
                if value < 0x000800l (* 1 << 11 *) then 2 else
@@ -134,9 +101,6 @@ module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) = struct
 
        (* === Decoding === *)
 
-       (** Decodes a header byte, returning a tuple (v, w) where:  *)
-       (** v = the (partial) value contained within the byte; and  *)
-       (** w = the total width of the encoded character, in bytes. *)
        let decode_header_byte byte =
                if byte land 0b10000000 = 0b00000000 then (byte               , 1) else
                if byte land 0b11100000 = 0b11000000 then (byte land 0b0011111, 2) else
@@ -144,13 +108,10 @@ module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) = struct
                if byte land 0b11111000 = 0b11110000 then (byte land 0b0000111, 4) else
                raise UTF8_header_byte_invalid
 
-       (** Decodes a continuation byte, returning the  *)
-       (** 6-bit-wide value contained within the byte. *)
        let decode_continuation_byte byte =
                if byte land 0b11000000 = 0b10000000 then byte land 0b00111111 else
                raise UTF8_continuation_byte_invalid
 
-       (** @see CHARACTER_DECODER.decode_character *)
        let decode_character string index =
                let value, width = decode_header_byte (Char.code string.[index]) in
                let value = if width = 1 then (Int32.of_int value)
@@ -169,9 +130,6 @@ module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) = struct
 
        (* === Encoding === *)
 
-       (** Encodes a header byte for the given parameters, where:       *)
-       (** width = the total width of the encoded character, in bytes;  *)
-       (** value = the most significant bits of the original UCS value. *)
        let encode_header_byte width value =
                match width with
                        | 1 -> value
@@ -180,14 +138,9 @@ module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) = struct
                        | 4 -> value ||| 0b11110000l
                        | _ -> raise UCS_value_out_of_range
 
-       (** Encodes a continuation byte from the given UCS    *)
-       (** remainder value, returning a tuple (b, r), where: *)
-       (** b = the continuation byte;                        *)
-       (** r = a new UCS remainder value.                    *)
        let encode_continuation_byte value =
                ((value &&& 0b00111111l) ||| 0b10000000l, value >>> 6)
 
-       (** @see CHARACTER_ENCODER.encode_character *)
        let encode_character value =
                UCS_validator.validate value;
                let width = width_required_for_ucs_value value in
@@ -223,7 +176,6 @@ exception Validation_error of int * exn
 
 module String_validator (Decoder : CHARACTER_DECODER) : STRING_VALIDATOR = struct
 
-       (** @see STRING_VALIDATOR.validate *)
        let validate string =
                let index = ref 0 and length = String.length string in
                begin try
@@ -236,11 +188,9 @@ module String_validator (Decoder : CHARACTER_DECODER) : STRING_VALIDATOR = struc
                        | error -> raise (Validation_error (!index, error))
                end; assert (!index = length)
 
-       (** @see STRING_VALIDATOR.is_valid *)
        let is_valid string =
                try validate string; true with _ -> false
 
-       (** @see STRING_VALIDATOR.longest_valid_prefix *)
        let longest_valid_prefix string =
                try validate string; string
                with Validation_error (index, reason) -> String.sub string 0 index
index 51ca34abc065db5927ab18954b449266260137bf..b028f014f827a7051c54bcaf94a0e7d407c29422 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *)
+(** Encoding helper modules *)
+(** {2 Exceptions} *)
+
 exception UCS_value_out_of_range
 exception UCS_value_prohibited_in_UTF8
 exception UCS_value_prohibited_in_XML
@@ -19,21 +23,59 @@ exception UTF8_continuation_byte_invalid
 exception UTF8_encoding_not_canonical
 exception String_incomplete
 
-(** Provides functionality for validating and processing  *)
-(** strings according to a particular character encoding. *)
-module type STRING_VALIDATOR = sig
+(** {2 UCS Validators} *)
 
-       (** Returns true if and only if the given string is validly-encoded. *)
-       val is_valid : string -> bool
+(** Validates UCS character values. *)
+module type UCS_VALIDATOR = sig
+       val validate : int32 -> unit
+end
 
-       (** Raises an encoding error if the given string is not validly-encoded. *)
-       val validate: string -> unit
+(** Accepts all values within the UCS character value range
+ *  except those which are invalid for all UTF-8 documents. *)
+module UTF8_UCS_validator : UCS_VALIDATOR
 
-       (** Returns the longest validly-encoded prefix of the given string. *)
-       val longest_valid_prefix : string -> string
+(** Accepts all values within the UCS character value range except
+ *  those which are invalid for all UTF-8-encoded XML documents.   *)
+module XML_UTF8_UCS_validator : UCS_VALIDATOR
+
+module UCS : sig
+       val min_value : int32
+       val max_value : int32
+
+       (** Returns true if and only if the given value corresponds to a UCS *)
+       (** non-character. Such non-characters are forbidden for use in open *)
+       (** interchange of Unicode text data, and include the following:     *)
+       (**   1. values from 0xFDD0 to 0xFDEF; and                           *)
+       (**   2. values 0xnFFFE and 0xnFFFF, where (0x0 <= n <= 0x10).       *)
+       (** See the Unicode 5.0 Standard, section 16.7 for further details.  *)
+       val is_non_character : int32 -> bool
+
+       (** Returns true if and only if the given value lies outside the *)
+       (** entire UCS range.                                            *)
+       val is_out_of_range : int32 -> bool
+       
+       (** Returns true if and only if the given value corresponds to a UCS *)
+       (** surrogate code point, only for use in UTF-16 encoded strings.    *)
+       (** See the Unicode 5.0 Standard, section 16.6 for further details.  *)
+       val is_surrogate : int32 -> bool
+end
+
+val (+++) : int32 -> int32 -> int32
+val (---) : int32 -> int32 -> int32
+val (&&&) : int32 -> int32 -> int32
+val (|||) : int32 -> int32 -> int32
+val (<<<) : int32 -> int -> int32
+val (>>>) : int32 -> int -> int32
 
+module XML : sig
+       (** Returns true if and only if the given value corresponds to *)
+       (** a forbidden control character as defined in section 2.2 of *)
+       (** the XML specification, version 1.0.                        *)
+       val is_forbidden_control_character : int32 -> bool
 end
 
+(** {2 Character Codecs} *)
+
 module type CHARACTER_ENCODER = sig
 
        (** Encodes a single character value, returning a string containing   *)
@@ -51,50 +93,13 @@ module type CHARACTER_DECODER = sig
        val decode_character : string -> int -> int32 * int
 end
 
-module String_validator (Decoder : CHARACTER_DECODER) : STRING_VALIDATOR
-
-(** Represents a validation error as a tuple (i,e), where: *)
-(**   i = the index of the first non-compliant character;  *)
-(**   e = the reason for non-compliance.                   *)
-exception Validation_error of int * exn
-
-(** Provides functions for validating and processing   *)
-(** strings according to the UTF-8 character encoding. *)
-(**                                                    *)
-(** Validly-encoded strings must satisfy RFC 3629.     *)
-(**                                                    *)
-(** For further information, see:                      *)
-(** http://www.rfc.net/rfc3629.html                    *)
-module UTF8 : STRING_VALIDATOR
-
-(** Provides functions for validating and processing   *)
-(** strings according to the UTF-8 character encoding, *)
-(** with certain additional restrictions on UCS values *)
-(** imposed by the XML specification.                  *)
-(**                                                    *)
-(** Validly-encoded strings must satisfy both RFC 3629 *)
-(** and section 2.2 of the XML specification.          *)
-(**                                                    *)
-(** For further information, see:                      *)
-(** http://www.rfc.net/rfc3629.html                    *)
-(** http://www.w3.org/TR/REC-xml/#charsets             *)
-module UTF8_XML : STRING_VALIDATOR
-
-(**  === UCS Validators === *)
-
-module type UCS_VALIDATOR = sig
-       (** Validates UCS character values. *)
-       val validate : int32 -> unit
-end
-
-module UTF8_UCS_validator : UCS_VALIDATOR
-module XML_UTF8_UCS_validator : UCS_VALIDATOR
-
 module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) : sig
        (** Given a valid UCS value, returns the canonical *)
        (** number of bytes required to encode the value.  *)
        val width_required_for_ucs_value : int32 -> int
 
+       (** {3 Decoding} *)
+
        (** Decodes a header byte, returning a tuple (v, w) where:  *)
        (** v = the (partial) value contained within the byte; and  *)
        (** w = the total width of the encoded character, in bytes. *)
@@ -103,10 +108,16 @@ module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) : sig
        (** Decodes a continuation byte, returning the  *)
        (** 6-bit-wide value contained within the byte. *)
        val decode_continuation_byte : int -> int
-
-       (** @see CHARACTER_DECODER.decode_character *)
+       
+       (** Decodes a single character embedded within a string. Given a string  *)
+       (** and an index into that string, returns a tuple (value, width) where: *)
+       (**   value = the value of the character at the given index; and         *)
+       (**   width = the width of the character at the given index, in bytes.   *)
+       (** Raises an appropriate error if the character is invalid.             *)
        val decode_character : string -> int -> int32 * int
        
+       (** {3 Encoding} *)
+       
        (** Encodes a header byte for the given parameters, where:       *)
        (** width = the total width of the encoded character, in bytes;  *)
        (** value = the most significant bits of the original UCS value. *)
@@ -118,7 +129,8 @@ module UTF8_CODEC (UCS_validator : UCS_VALIDATOR) : sig
        (** r = a new UCS remainder value.                    *)
        val encode_continuation_byte : int32 -> int32 * int32
 
-       (** @see CHARACTER_ENCODER.encode_character *)
+       (** Encodes a single character value, returning a string containing   *)
+       (** the character. Raises an error if the character value is invalid. *)
        val encode_character : int32 -> string
 end
 
@@ -144,35 +156,48 @@ module XML_UTF8_codec : sig
        val encode_character : int32 -> string
 end
 
-module UCS : sig
-       val min_value : int32
-       val max_value : int32
+(** {2 String Validators} *)
 
-       (** Returns true if and only if the given value corresponds to a UCS *)
-       (** non-character. Such non-characters are forbidden for use in open *)
-       (** interchange of Unicode text data, and include the following:     *)
-       (**   1. values from 0xFDD0 to 0xFDEF; and                           *)
-       (**   2. values 0xnFFFE and 0xnFFFF, where (0x0 <= n <= 0x10).       *)
-       (** See the Unicode 5.0 Standard, section 16.7 for further details.  *)
-       val is_non_character : int32 -> bool
+(** Provides functionality for validating and processing
+ *  strings according to a particular character encoding. *)
+module type STRING_VALIDATOR = sig
+
+       (** Returns true if and only if the given string is validly-encoded. *)
+       val is_valid : string -> bool
+
+       (** Raises an encoding error if the given string is not validly-encoded. *)
+       val validate: string -> unit
+
+       (** Returns the longest validly-encoded prefix of the given string. *)
+       val longest_valid_prefix : string -> string
 
-       (** Returns true if and only if the given value lies outside the *)
-       (** entire UCS range.                                            *)
-       val is_out_of_range : int32 -> bool
-       
-       (** Returns true if and only if the given value corresponds to a UCS *)
-       (** surrogate code point, only for use in UTF-16 encoded strings.    *)
-       (** See the Unicode 5.0 Standard, section 16.6 for further details.  *)
-       val is_surrogate : int32 -> bool
 end
 
-val (+++) : int32 -> int32 -> int32
-val (---) : int32 -> int32 -> int32
-val (&&&) : int32 -> int32 -> int32
-val (|||) : int32 -> int32 -> int32
-val (<<<) : int32 -> int -> int32
-val (>>>) : int32 -> int -> int32
+module String_validator (Decoder : CHARACTER_DECODER) : STRING_VALIDATOR
 
-module XML : sig val is_forbidden_control_character : int32 -> bool end
+(** Represents a validation error as a tuple [(i,e)], where:
+ *    [i] = the index of the first non-compliant character;
+ *    [e] = the reason for non-compliance.                   *)
+exception Validation_error of int * exn
 
+(** Provides functions for validating and processing
+ *  strings according to the UTF-8 character encoding.
+ *
+ *  Validly-encoded strings must satisfy RFC 3629.
+ *
+ *  For further information, see:
+ *  http://www.rfc.net/rfc3629.html                    *)
+module UTF8 : STRING_VALIDATOR
 
+(** Provides functions for validating and processing
+ *  strings according to the UTF-8 character encoding,
+ *  with certain additional restrictions on UCS values
+ *  imposed by the XML specification.
+ *
+ *  Validly-encoded strings must satisfy both RFC 3629
+ *  and section 2.2 of the XML specification.
+ *
+ *  For further information, see:
+ *  http://www.rfc.net/rfc3629.html
+ *  http://www.w3.org/TR/REC-xml/#charsets *)
+module UTF8_XML : STRING_VALIDATOR
index ad941c79c30d90df11998a02d4f8d7593f47f882..4b64ebf3de66c55a27a8ac40ad94915de171a602 100644 (file)
@@ -14,7 +14,6 @@
 
 type t = { size: int; mutable current: int; data: (float,Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t ; }
 
-(** create a ring structure with @size record. records inited to @initval *)
 let make size init =
        let ring = 
                { size = size; current = size - 1; data = Bigarray.Array1.create Bigarray.float32 Bigarray.c_layout size; }
@@ -24,17 +23,14 @@ let make size init =
        done;
        ring
 
-(** length of the ring *)
 let length ring = ring.size
 
-(** push into the ring one element *)
 let push ring e =
        ring.current <- ring.current + 1;
        if ring.current = ring.size then
                ring.current <- 0;
        Bigarray.Array1.set ring.data ring.current e
 
-(** get the @ith old element from the ring *)
 let peek ring i =
        if i >= ring.size then
                raise (Invalid_argument "peek: index");
@@ -43,10 +39,8 @@ let peek ring i =
                if offset >= 0 then offset else ring.size + offset in
        Bigarray.Array1.get ring.data index
 
-(** get the top element of the ring *)
 let top ring = Bigarray.Array1.get ring.data ring.current
 
-(** iterate over nb element of the ring, starting from the top *)
 let iter_nb ring f nb =
        if nb > ring.size then
                raise (Invalid_argument "iter_nb: nb");
@@ -56,7 +50,7 @@ let iter_nb ring f nb =
                f (peek ring i)
        done
 
-(** iter directly on all element without using the index *)
+(* iter directly on all element without using the index *)
 let iter f a = 
        for i=0 to Bigarray.Array1.dim a - 1 do
                f (Bigarray.Array1.get a i)
@@ -65,10 +59,8 @@ let iter f a =
 let raw_iter ring f =
        iter f ring.data
 
-(** iterate over all element of the ring, starting from the top *)
 let iter ring f = iter_nb ring f (ring.size)
 
-(** get array of latest #nb value *)
 let get_nb ring nb =
        if nb > ring.size then
                raise (Invalid_argument "get_nb: nb");
@@ -81,3 +73,4 @@ let get_nb ring nb =
        a
 
 let get ring = get_nb ring (ring.size)
+
index d0af667e65d3c09d5a16cb43029019cc9766ddd5..38a60d1a99019e60a56d3329264a68073c51f000 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *)
+(** Ring structures *)
 type t = {
   size : int;
   mutable current : int;
   data : (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t;
 }
+
+(** create a ring structure with [size] record; records initialised to [init] *)
 val make : int -> float -> t
+
+(** length of the ring *)
 val length : t -> int
+
+(** push into the ring one element *)
 val push : t -> float -> unit
+
+(** get the i{^th} old element from the ring *)
 val peek : t -> int -> float
+
+(** get the top element of the ring *)
 val top : t -> float
+
+(** iterate over nb element of the ring, starting from the top *)
 val iter_nb : t -> (float -> 'a) -> int -> unit
+
 val raw_iter : t -> (float -> 'a) -> unit
+
+(** iterate over all elements of the ring, starting from the top *)
 val iter : t -> (float -> 'a) -> unit
+
+(** get array of latest [nb] value *)
 val get_nb : t -> int -> float array
+
 val get : t -> float array
index 06acc0e043aba4750684674bea8ce5f501cc525c..3fb032c56a901ea4099a28b7297ca6dd159c8ee4 100644 (file)
@@ -14,7 +14,7 @@
 
 type 'a t = { size: int; mutable current: int; data: 'a array; }
 
-(** create a ring structure with @size record. records inited to @initval *)
+(** create a ring structure with size record. records inited to initval *)
 let make size initval =
        { size = size; current = size - 1; data = Array.create size initval; }
 
@@ -28,7 +28,7 @@ let push ring e =
                ring.current <- 0;
        ring.data.(ring.current) <- e
 
-(** get the @ith old element from the ring *)
+(** get the ith old element from the ring *)
 let peek ring i =
        if i >= ring.size then
                raise (Invalid_argument "peek: index");
@@ -57,7 +57,7 @@ let raw_iter ring f =
 (** iterate over all element of the ring, starting from the top *)
 let iter ring f = iter_nb ring f (ring.size)
 
-(** get array of latest #nb value *)
+(** get array of latest nb value *)
 let get_nb ring nb =
        if nb > ring.size then
                raise (Invalid_argument "get_nb: nb");
index 17c3a50fbf554b9d1bd6fdecc03c5f0044d7cdef..3cbe245b27ab8402b2b7d786b4ff02a0a4353efb 100644 (file)
@@ -14,6 +14,7 @@
 module String :
   sig
     external length : string -> int = "%string_length"
+    (** blabla *)
     external get : string -> int -> char = "%string_safe_get"
     external set : string -> int -> char -> unit = "%string_safe_set"
     external create : int -> string = "caml_create_string"
@@ -108,7 +109,7 @@ module String :
 (** find all occurences of needle in haystack and return all their respective index *)
     val find_all : string -> string -> int list
 
-    (** replace all @f substring in @s by @t *)
+    (** replace all [f] substring in [s] by [t] *)
     val replace : string -> string -> string -> string
 
     (** filter chars from a string *)
index 18c198fe5758118c7e33bdb9ce39e9678f1a69f7..23f3f728013a2d0124fb3708be75f97e9f10f84d 100644 (file)
@@ -188,7 +188,7 @@ let copy_file ?limit ifd ofd =
                let num64 = Int64.of_int num in
 
                limit := Opt.map (fun x -> Int64.sub x num64) !limit;
-               Unix.write ofd buffer 0 num;
+               ignore_int (Unix.write ofd buffer 0 num);
                total_bytes := Int64.add !total_bytes num64;
                finished := num = 0 || !limit = Some 0L;
        done;
index f160f1b1c71bf80eab48fb8f4e52f3f3576c6b0e..8e5b465ce62a2f6126318918ea78101dc2140efb 100644 (file)
@@ -17,6 +17,8 @@ OBJS = stunnel stunnel_cache
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = stunnel.cma stunnel.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -52,5 +54,9 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove stunnel
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "stunnel" "library" "$(OBJS)" "." "stdext,log" ""
+       
 clean:
-       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
\ No newline at end of file
+       rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 0f4e749a3d76976a10730de205f5c908b9b2c776..443a5a240de8f68aa4ebd8ea82c222829191f7ab 100644 (file)
@@ -17,6 +17,8 @@ OBJS = uuid
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
 LIBS = uuid.cma uuid.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -52,6 +54,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove uuid
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "uuid" "library" "$(OBJS)" "." "" ""
+
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index 16d5236bca2d0e41092d6fb1bda5cb728d5f2a1f..b34f6f14f543d7dfe9d4a413c792fb2d1b066ca3 100644 (file)
@@ -20,6 +20,8 @@ OBJS = op partial packet xs_ring xb
 INTF = op.cmi packet.cmi xb.cmi
 LIBS = xb.cma xb.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(PREINTF) $(PRELIBS) $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -65,6 +67,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove xb
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "xb" "library" "$(OBJS)" "." "mmap" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index 2d4301cfeba1882b8fa8908b23203ccd220b6c41..4ef96d6a8b17fbd994d7c7d3d3ce9f132555a975 100644 (file)
@@ -17,6 +17,8 @@ OBJS = xc
 INTF = xc.cmi
 LIBS = xc.cma xc.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -59,6 +61,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove xc
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "xc" "library" "$(OBJS)" "." "mmap,uuid" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS) $(INTF)
 
index daa7267fa1cf18a6378177ea2bf99dbcd14c4d9f..b61638c80a3aa80e8db30cb8e3c95d6f11ed4714 100644 (file)
@@ -26,6 +26,8 @@ INTF = xml.cmi
 LIBS = xml-light2.cma xml-light2.cmxa
 PROGRAMS = xmlpp
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS)
 
 bins: $(PROGRAMS)
@@ -73,6 +75,10 @@ uninstall:
 binuninstall:
        rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "xml-light2" "library" "$(OBJS)" "." "stdext,xmlm" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index a5efd14393de54aaefa12ef7ab4042661bfbb79e..34ba49b1f0a4582b8c6be7a0c15a3f0094daf94f 100644 (file)
@@ -20,6 +20,8 @@ OBJS = queueop xsraw xst xs
 INTF = xsraw.cmi xst.cmi xs.cmi
 LIBS = xs.cma xs.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(PREINTF) $(PRELIBS) $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -55,6 +57,10 @@ install: $(LIBS) META
 uninstall:
        ocamlfind remove xs
 
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "xs" "library" "$(OBJS)" "." "xb" ""
+
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
 
index cf0173f91bd6c633b9e5e04bbb4da7093366a486..0437fb2623daed18f6d47db54f0ea4624bf7b2b1 100644 (file)
@@ -17,6 +17,8 @@ OBJS = xsrpc
 INTF = xsrpc.cmi
 LIBS = xsrpc.cma xsrpc.cmxa
 
+DOCDIR = /myrepos/xen-api-libs.hg/doc
+
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
@@ -51,7 +53,11 @@ install: $(LIBS) META
 .PHONY: uninstall
 uninstall:
        ocamlfind remove xsrpc
-
+       
+.PHONY: doc
+doc: $(INTF)
+       python ../doc/doc.py $(DOCDIR) "xsrpc" "library" "$(OBJS)" "." "xb,xs" ""
+       
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot META $(LIBS) $(PROGRAMS)