Commit 6ad0f76c authored by Julien Lopez's avatar Julien Lopez
Browse files

[MINOR] Old comments removed; Makefile output nicer for ocaml interface

parent 796f7ee6
......@@ -3,6 +3,12 @@
# of an OCaml source tree.
include ../Makefile.conf
ifneq ($(VERBOSE), true)
HIDE=@
else
HIDE=
endif
all: caml_cduce.cmo caml_cduce.cmx
STDLIB=$(shell ocamlc -where)
......@@ -17,23 +23,23 @@ else
endif
ocaml_files:
mkdir ocaml_files
$(HIDE)test -e ocaml_files || mkdir ocaml_files
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) ocaml_files/
cp location.ml ocaml_files/location.ml
cp ocaml_files/asttypes.mli ocaml_files/asttypes.ml
sed s=STDLIB=$(STDLIB)= config.ml > ocaml_files/config.ml
grep cmi_magic $(OCAML_SRC)/utils/config.mlp | head -1 >> ocaml_files/config.ml
$(HIDE)cp location.ml ocaml_files/location.ml
$(HIDE)cp ocaml_files/asttypes.mli ocaml_files/asttypes.ml
$(HIDE)sed s=STDLIB=$(STDLIB)= config.ml > ocaml_files/config.ml
$(HIDE)grep cmi_magic $(OCAML_SRC)/utils/config.mlp | head -1 >> ocaml_files/config.ml
caml_cduce.cmo: ocaml_files
@echo "Build $@"
(cd ocaml_files; \
$(HIDE)(cd ocaml_files; \
ocamlc $(FORPACKOPT1) -c $(COMPILE_FILES);\
ocamlc $(FORPACKOPT2) -pack -o $@ $(OBJECTS); \
cp caml_cduce.cmo caml_cduce.cmi ..)
caml_cduce.cmx: ocaml_files
@echo "Build $@"
(cd ocaml_files; ocamlopt $(FORPACKOPT1) -c $(COMPILE_FILES);\
$(HIDE)(cd ocaml_files; ocamlopt $(FORPACKOPT1) -c $(COMPILE_FILES);\
ocamlopt $(FORPACKOPT2) -pack -o $@ $(XOBJECTS); \
cp caml_cduce.cmx caml_cduce.o caml_cduce.cmi ..)
......
......@@ -167,12 +167,9 @@ let rec unfold_constr env p args =
slot.def <-
(match decl.type_kind, decl.type_manifest with
| Type_variant (cstrs), _ ->
let cstrs =
(* TODO: Check this solution *)
List.map (function (cst,f,Some o)
-> (cst,List.map (unfold env) f,Some (unfold env o))
| (cst,f,None) -> (cst,List.map (unfold env) f,None)) cstrs in
(*OLD: (fun (cst,f) -> (cst,List.map (unfold env) f)) cstrs in *)
let cstrs = List.map (function
(cst,f,Some o) -> (cst,List.map (unfold env) f,Some (unfold env o))
| (cst,f,None) -> (cst,List.map (unfold env) f,None)) cstrs in
Variant (prefix, cstrs, true)
| Type_record (f,_), _ ->
let f = List.map (fun (l,_,t) -> (l,unfold env t)) f in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment