-IPROG=install -m 755 -o root -g root
CC = gcc
CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
OCAMLC = ocamlc -g
LDFLAGS = -cclib -L./
-LIBEXEC = "/opt/xensource/libexec"
+DESTDIR ?= /
VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
OCAMLOPTFLAGS = -g -dtypes
OCAMLLIBDIR := $(shell ocamlc -where)
OCAMLDESTDIR ?= $(OCAMLLIBDIR)
-OBJS = sExpr sExprLexer sExprParser sExpr_TS
+OBJS = sExpr sExprLexer sExprParser sexpr
INTF = $(foreach obj, $(OBJS),$(obj).cmi)
LIBS = sexpr.cma sexpr.cmxa
PROGRAMS = sexprpp
-DOCDIR = /myrepos/xen-api-libs.hg/doc
-
all: $(INTF) $(LIBS)
bins: $(PROGRAMS)
sed 's/@VERSION@/$(VERSION)/g' < $< > $@
.PHONY: install
-install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
install: $(LIBS) META
- mkdir -p $(path)
- ocamlfind install -destdir $(path) -ldconf ignore sexpr META $(INTF) $(LIBS) *.a *.cmx
-
-.PHONY: bininstall
-bininstall: path = $(DESTDIR)$(LIBEXEC)
-bininstall: all
- mkdir -p $(path)
- $(IPROG) $(PROGRAMS) $(path)
+ ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore sexpr META $(INTF) $(LIBS) *.a *.cmx
.PHONY: uninstall
uninstall:
ocamlfind remove sexpr
-.PHONY: binuninstall
-binuninstall:
- rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)
-
-.PHONY: doc
-doc: $(INTF)
- python ../doc/doc.py $(DOCDIR) "sexpr" "package" "$(OBJS)" "." "stdext" ""
-
clean:
- rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot sExprLexer.ml{,i} sExprParser.ml{,i} $(LIBS) $(PROGRAMS)
+ 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
--- /dev/null
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *)
+open Threadext
+
+let lock = Mutex.create ()
+
+let of_string s =
+ Mutex.execute lock
+ (fun () -> SExprParser.expr SExprLexer.token (Lexing.from_string s))
+
+let string_of = SExpr.string_of
--- /dev/null
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+(** Thread-safe marshaller and unmarshaller for sexpr *)
+
+val of_string : string -> SExpr.t
+
+val string_of : SExpr.t -> string