Upstream Commit: 42932a5cacb6dc68edccb460c49f7c34f2dc5e05
Author: Guillaume Melquiond <guillaume.melquiond@inria.fr>
Description: Use ocamlc for doc/bnf and clean more files

diff --git a/Makefile.in b/Makefile.in
index 4b0c11f..3a4813e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1672,12 +1672,12 @@ BNF = qualid label constant operator term type formula theory theory2 \
 	why_file spec expr expr2 module whyml_file term_old_at
 BNFTEX = $(addprefix doc/, $(addsuffix _bnf.tex, $(BNF)))
 
-doc/%_bnf.tex: doc/%.bnf doc/bnf
-	doc/bnf $< > $@
+doc/%_bnf.tex: doc/%.bnf doc/bnf$(EXE)
+	doc/bnf$(EXE) $< > $@
 
-doc/bnf: doc/bnf.mll
+doc/bnf$(EXE): doc/bnf.mll
 	$(OCAMLLEX) $<
-	$(OCAMLOPT) -o $@ doc/bnf.ml
+	$(OCAMLC) -o $@ doc/bnf.ml
 
 DOC = api glossary ide intro exec macros manpages install \
       manual starting syntax syntaxref technical version whyml \
@@ -1688,6 +1688,9 @@ DOCTEX = $(addprefix doc/, $(addsuffix .tex, $(DOC)))
 doc/manual.pdf: $(BNFTEX) $(DOCTEX) doc/manual.bib share/provers-detection-data.conf
 	cd doc; $(RUBBER) --warn all --pdf manual.tex
 
+CLEANDIRS += doc
+GENERATED += doc/bnf.ml
+
 ifeq (@enable_html_doc@,yes)
 
 # the dependency on the pdf ensures the bbl was built
@@ -1706,7 +1709,8 @@ doc/html/index.html:
 endif
 
 clean::
-	cd doc; rm -rf html; $(RUBBER) --pdf --clean manual.tex
+	rm -rf doc/bnf$(EXE) $(BNFTEX) doc/html doc/manual.image.out; \
+	cd doc; $(RUBBER) --pdf --clean manual.tex
 
 else
 
@@ -2001,7 +2005,8 @@ configure: configure.in Version
 
 distclean: clean
 	rm -f config.status config.cache config.log .merlin \
-	    Makefile src/util/config.ml doc/version.tex
+	    Makefile src/util/config.ml doc/version.tex \
+	    src/jessie/Makefile src/config.sh lib/why3/META
 
 depend:
 	rm -f $^
