build with ocamlbuild by default
[deriving.git] / README
blob6a1c2c1a86053d61160bf4af4d22bc399bec51cb
2 SEE BELOW FOR UPDATE
3 --------------------------------------------------------------
5 Typing `make' in this directory should build both the preprocessor
6 (syntax/deriving) and the libraries (lib/deriving.cma,
7 lib/deriving.cmxa).
9 You can run the tests by changing to the test directory and building
10 and running the `tests' executable
12    $ cd tests
13    $ make
14    ...
15    $ ./tests
16    Tests succeeded!
18 There's very limited documentation at present, but you should be able
19 to get started by looking at the test files.
21 Any comments are very welcome.
23 Jeremy Yallop
24 jeremy.yallop@ed.ac.uk
26 --------------------------------------------------------------
27 UPDATE (20100901)
29 Original deriving at http://code.google.com/p/deriving
30 This code lives at http://repo.or.cz/w/deriving.git
32 Changes:
33 * fix compilation with ocaml 3.11 [#5]
34 * fix linking conflict with extlib [#1]
35 * fix pretty printing of constructors [#4]
36 * partially fix syntax conflict with operator (<) [#2]
37 * alternative compilation with ocamlbuild, producing pa_deriving.cma
38 * installation with ocamlfind
40 Build with ocamlbuild :
41     $ make obuild
43 Result (in directory _build) :
44     deriving.{cma,cmxa} - runtime library for deriving
45     pa_deriving.cma - syntax extension library (usage: camlp4o _build/pa_deriving.cma tests/issue2.ml)
46     deriving.{byte,native} - syntax extension standalone binary (usage: _build/deriving.native tests/issue2.ml)
48 Original build procedure works too, but you will not get pa_deriving.cma
50 Build tests :
51     $ ocamlbuild tests.native
53 Install with ocamlfind :
54     $ make install
56 Example usage with ocamlfind :
57     $ ocamlfind ocamlopt -o test -linkpkg -package deriving.syntax -syntax camlp4o tests/issue2.ml
59 Example usage in ocaml toplevel :
60     #use "topfind";;
61     #camlp4o;;
62     #require "deriving.syntax";;
63     type t = int list deriving (Show);;
64     Show.show<t>([1;2;3;4]);;
67 ygrek
68 ygrek@autistici.org