From 8432a805c3c9cac29112b0cf92cd273b7172e460 Mon Sep 17 00:00:00 2001 From: herbelin Date: Mon, 6 Feb 2006 08:48:37 +0000 Subject: Ajout de l'essai d'effacement des noms des cibles custom par la cible clean git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@7994 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/coq_makefile.ml4 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/coq_makefile.ml4 b/tools/coq_makefile.ml4 index 9951e6036a..f24813d3f5 100644 --- a/tools/coq_makefile.ml4 +++ b/tools/coq_makefile.ml4 @@ -79,7 +79,7 @@ coq_makefile [subdirectory] .... [file.v] ... [file.ml] ... [-custom [--help]: equivalent to [-h]\n"; exit 1 -let standard sds = +let standard sds sps = print "byte:\n"; print "\t$(MAKE) all \"OPT=\"\n\n"; print "opt:\n"; @@ -117,6 +117,9 @@ let standard sds = print "clean:\n"; print "\trm -f *.cmo *.cmi *.cmx *.o $(VOFILES) $(VIFILES) $(GFILES) *~\n"; print "\trm -f all.ps all-gal.ps $(HTMLFILES) $(GHTMLFILES)\n"; + List.iter + (fun (file,_,_) -> print "\t- rm -f "; print file; print "\n") + sps; List.iter (fun x -> print "\t(cd "; print x; print " ; $(MAKE) clean)\n") sds; @@ -224,17 +227,16 @@ let include_dirs l = print "OCAMLLIBS="; print_list "\\\n " i_ocaml; print "\n"; print "COQLIBS="; print_list "\\\n " i_coq; print "\n\n" -let special l = +let rec special = function + | [] -> [] + | Special (file,deps,com) :: r -> (file,deps,com) :: (special r) + | _ :: r -> special r + +let custom sps = let pr_sp (file,dependencies,com) = print file; print ": "; print dependencies; print "\n"; print "\t"; print com; print "\n\n" in - let rec sp_aux = function - | [] -> [] - | Special (file,deps,com) :: r -> (file,deps,com) :: (sp_aux r) - | _ :: r -> sp_aux r - in - let sps = sp_aux l in if sps <> [] then section "Custom targets."; List.iter pr_sp sps @@ -434,10 +436,11 @@ let do_makefile args = variables l; include_dirs l; all_target l; - special l; + let sps = special l in + custom sps; let sds = subdirs l in implicit (); - standard sds; + standard sds sps; (* TEST directories_deps l; *) warning (); if not (!output_channel == stdout) then close_out !output_channel; -- cgit v1.2.3