Commit 865e16c6 authored by Kim Nguyễn's avatar Kim Nguyễn

Add support for merlin:

 * add a makefile rule 'make .merlin' to generate a merlin project file
 * call ocaml with the -bin-annot if supported
 * add the *.cmt* files to .gitignore and to the makefile clean rule.
parent b9ad3043
......@@ -5,6 +5,9 @@ cduce
*.cdo
*.cma
*.cmi
*.cmt
*.cmti
.merlin
*.cmx
*.cmxa
*.a
......
......@@ -76,6 +76,10 @@ ifneq ($(strip $(DEBUG)),)
SYNTAX += -symbol cduce_debug=\"$(DEBUG)\"
endif
ifeq ($(BIN_ANNOT), true)
OPT += -passopt -bin-annot
endif
OCAMLFIND = ocamlfind
CAMLC = $(OCAMLFIND) $(CAMLC_P) $(OPT) -package "$(PACKAGES)"
CAMLOPT = $(OCAMLFIND) $(CAMLOPT_P) $(OPT) -package "$(PACKAGES)"
......@@ -316,12 +320,12 @@ compute_depend: $(DEPEND_OCAMLDEP)
clean:
for i in $(CLEAN_DIRS); do \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *~); \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *.cmt *.cmti *~); \
done
rm -f misc/q_symbol.cmo.stamp
test -n "$(OCAMLIFACE)" && (cd $(OCAMLIFACE); $(MAKE) clean) || true
rm -f `find . -name "*~"`
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~ META
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.cmt *.cmti *.o *~ META
rm -f cduce$(EXE) ocamlprof.dump
rm -f dtd2cduce$(EXE) webiface$(EXE) evaluator$(EXE)
rm -Rf prepro package
......@@ -374,6 +378,18 @@ include depend
cduceres.o: win32/cduce.rc win32/cduce_logo-bw.ico
(cd win32; windres -i cduce.rc -o cduceres.o; mv cduceres.o ..)
.merlin:
rm -f .merlin
for m in S B; do \
for i in $(DIRS); do \
echo "$$m $$i" >> .merlin; \
done; \
done; \
for p in $(PACKAGES); do \
echo "PKG $$p" >> .merlin; \
done
# Documentation
doc: cduce web/site.cdo
......
......@@ -287,6 +287,18 @@ let has_forpack =
else
(print "not available\n"; false)
let has_bin_annot =
print "testing for -bin-annot option: ";
let comm =
match Sys.os_type with
| "Win32" -> "ocamlc -bin-annot"
| _ -> "ocamlc -bin-annot 2> /dev/null" in
if Sys.command comm = 0 then
(print "available\n"; true)
else
(print "not available\n"; false)
let has_natdynlink =
print "testing for native dynlink: ";
if Sys.command "ocamlopt -o foo dynlink.cmxa && rm -f foo" = 0 then
......@@ -328,4 +340,5 @@ let () =
fprintf out "PROFILE=false\n";
fprintf out "FORPACK=%b\n" has_forpack;
fprintf out "NATDYNLINK=%b\n" has_natdynlink;
fprintf out "BIN_ANNOT=%b\n" has_bin_annot;
close_out out
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