summaryrefslogtreecommitdiff
path: root/tools/coq_makefile.ml
diff options
context:
space:
mode:
Diffstat (limited to 'tools/coq_makefile.ml')
-rw-r--r--tools/coq_makefile.ml23
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml
index 0931fd55..d3374675 100644
--- a/tools/coq_makefile.ml
+++ b/tools/coq_makefile.ml
@@ -299,7 +299,7 @@ let install (vfiles,(mlifiles,ml4files,mlfiles,mllibfiles,mlpackfiles),_,sds) in
printf "find %s/%s -maxdepth 0 -and -empty -exec rmdir -p \\{\\} \\;\\n' >> \"$@\"\n" dir kind
in
printf "uninstall_me.sh: %s\n" !makefile_name;
- print "\techo '#!/bin/sh' > $@ \n";
+ print "\techo '#!/bin/sh' > $@\n";
if (not_empty cmxsfiles) then uninstall_by_root where_what_cmxs;
uninstall_by_root where_what_oth;
if not_empty vfiles then uninstall_one_kind "html" doc_dir;
@@ -386,12 +386,12 @@ let implicit () =
print "$(MLLIBFILES:.mllib=.cma): %.cma: | %.mllib\n\t$(CAMLLINK) $(ZDEBUG) $(ZFLAGS) -a -o $@ $^\n\n";
print "$(MLLIBFILES:.mllib=.cmxa): %.cmxa: | %.mllib\n\t$(CAMLOPTLINK) $(ZDEBUG) $(ZFLAGS) -a -o $@ $^\n\n";
print "$(addsuffix .d,$(MLLIBFILES)): %.mllib.d: %.mllib\n";
- print "\t$(COQDEP) $(OCAMLLIBS) \"$<\" > \"$@\" || ( RV=$$?; rm -f \"$@\"; exit $${RV} )\n\n" in
+ print "\t$(COQDEP) $(OCAMLLIBS) -c \"$<\" > \"$@\" || ( RV=$$?; rm -f \"$@\"; exit $${RV} )\n\n" in
let mlpack_rules () =
print "$(MLPACKFILES:.mlpack=.cmo): %.cmo: | %.mlpack\n\t$(CAMLLINK) $(ZDEBUG) $(ZFLAGS) -pack -o $@ $^\n\n";
print "$(MLPACKFILES:.mlpack=.cmx): %.cmx: | %.mlpack\n\t$(CAMLOPTLINK) $(ZDEBUG) $(ZFLAGS) -pack -o $@ $^\n\n";
print "$(addsuffix .d,$(MLPACKFILES)): %.mlpack.d: %.mlpack\n";
- print "\t$(COQDEP) $(OCAMLLIBS) \"$<\" > \"$@\" || ( RV=$$?; rm -f \"$@\"; exit $${RV} )\n\n";
+ print "\t$(COQDEP) $(OCAMLLIBS) -c \"$<\" > \"$@\" || ( RV=$$?; rm -f \"$@\"; exit $${RV} )\n\n";
in
let v_rules () =
print "$(VOFILES): %.vo: %.v\n\t$(COQC) $(COQDEBUG) $(COQFLAGS) $*\n\n";
@@ -496,7 +496,7 @@ endif\n";
print "\n"
let parameters () =
- print ".DEFAULT_GOAL := all\n\n# \n";
+ print ".DEFAULT_GOAL := all\n\n";
print "# This Makefile may take arguments passed as environment variables:\n";
print "# COQBIN to specify the directory where Coq binaries resides;\n";
print "# TIMECMD set a command to log .v compilation time;\n";
@@ -575,8 +575,13 @@ let main_targets vfiles (mlifiles,ml4files,mlfiles,mllibfiles,mlpackfiles) other
let decl_var var = function
|[] -> ()
|l ->
- printf "%s:=" var; print_list "\\\n " l; print "\n";
- printf "\n-include $(addsuffix .d,$(%s))\n.SECONDARY: $(addsuffix .d,$(%s))\n\n" var var
+ printf "%s:=" var; print_list "\\\n " l; print "\n\n";
+ print "ifneq ($(filter-out archclean clean cleanall printenv,$(MAKECMDGOALS)),)\n";
+ printf "-include $(addsuffix .d,$(%s))\n" var;
+ print "else\nifeq ($(MAKECMDGOALS),)\n";
+ printf "-include $(addsuffix .d,$(%s))\n" var;
+ print "endif\nendif\n\n";
+ printf ".SECONDARY: $(addsuffix .d,$(%s))\n\n" var
in
section "Files dispatching.";
decl_var "VFILES" vfiles;
@@ -764,7 +769,7 @@ let ensure_root_dir (v,(mli,ml4,ml,mllib,mlpack),_,_) ((ml_inc,i_inc,r_inc) as l
&& not_tops mllib && not_tops mlpack) then
l
else
- ((".",here)::ml_inc,(".","Top",here)::i_inc,r_inc)
+ ((".",here)::ml_inc,i_inc,(".","Top",here)::r_inc)
let warn_install_at_root_directory
(vfiles,(mlifiles,ml4files,mlfiles,mllibfiles,mlpackfiles),_,_) (inc_ml,inc_i,inc_r) =
@@ -837,11 +842,9 @@ let do_makefile args =
if not (makefile = None) then close_out !output_channel;
exit 0
-let main () =
+let _ =
let args =
if Array.length Sys.argv = 1 then usage ();
List.tl (Array.to_list Sys.argv)
in
do_makefile args
-
-let _ = Printexc.catch main ()