Conditional compilation in OCaml

Thanks to Mauricio Fernandez on the IRC, got my with/without pgocaml setup working:

dataframe.cmo: %.cmo: %.ml
        ocamlfind ocamlc -pp "camlp4o Camlp4MacroParser.cmo -DONT_USE_POSTGRES" -c $< -o $@

-- lest uncommenting things, I simply define an unexisting symbol instead of the necessary. Then, in dataframe.ml:

let get ?fromfile () =
match fromfile with
| Some file -> load file
| None -> IFDEF USE_POSTGRES THEN percells_dataframe () ELSE failwith "no fatabase for you" END
Comments