aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorbarras2006-10-25 13:00:22 +0000
committerbarras2006-10-25 13:00:22 +0000
commit8b4637c2a5ff1b6774be4f40665ccc03b687a47e (patch)
tree49a2539ca11f0689a1a1a60423518ee2be894401 /tools
parent297dbafac27875160c9485651f3f1b537da25aa0 (diff)
coqdep -slash
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9276 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tools')
-rw-r--r--tools/coqdep.ml20
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/coqdep.ml b/tools/coqdep.ml
index a3089f7136..423035fabb 100644
--- a/tools/coqdep.ml
+++ b/tools/coqdep.ml
@@ -12,12 +12,6 @@ open Printf
open Coqdep_lexer
open Unix
-let (/) = Filename.concat
-
-let file_concat l =
- if l=[] then "<empty>" else
- List.fold_left (/) (List.hd l) (List.tl l)
-
let stderr = Pervasives.stderr
let stdout = Pervasives.stdout
@@ -28,12 +22,23 @@ let option_D = ref false
let option_w = ref false
let option_i = ref false
let option_sort = ref false
+let option_slash = ref false
let suffixe = ref ".vo"
let suffixe_spec = ref ".vi"
type dir = string option
+(* filename for printing *)
+let (//) s1 s2 =
+ if !option_slash then s1^"/"^s2 else Filename.concat s1 s2
+
+let (/) = Filename.concat
+
+let file_concat l =
+ if l=[] then "<empty>" else
+ List.fold_left (//) (List.hd l) (List.tl l)
+
(* Files specified on the command line *)
let mlAccu = ref ([] : (string * string * dir) list)
and mliAccu = ref ([] : (string * string * dir) list)
@@ -148,7 +153,7 @@ let cut_prefix p s =
if ls >= lp && String.sub s 0 lp = p then String.sub s lp (ls - lp) else s
let canonize f = match Sys.os_type with
- | "Win32" -> cut_prefix ".\\" f
+ | "Win32" when not !option_slash -> cut_prefix ".\\" f
| _ -> cut_prefix "./" f
let sort () =
@@ -517,6 +522,7 @@ let coqdep () =
| "-coqlib" :: [] -> usage ()
| "-suffix" :: (s :: ll) -> suffixe := s ; suffixe_spec := s; parse ll
| "-suffix" :: [] -> usage ()
+ | "-slash" :: ll -> option_slash := true; parse ll
| f :: ll -> treat None f; parse ll
| [] -> ()
in