19 |
val mkStablePath : policy -> AbsPath.t -> AbsPath.t |
val mkStablePath : policy -> AbsPath.t -> AbsPath.t |
20 |
end |
end |
21 |
|
|
22 |
structure FilenamePolicy :> FILENAMEPOLICY = struct |
functor FilenamePolicyFn (val cmdir : string |
23 |
|
val skeldir : string) :> FILENAMEPOLICY = struct |
24 |
|
|
25 |
type converter = AbsPath.t -> AbsPath.t |
type converter = AbsPath.t -> AbsPath.t |
26 |
|
|
36 |
fun mkPolicy shift { arch, os } = let |
fun mkPolicy shift { arch, os } = let |
37 |
fun cmpath d s = let |
fun cmpath d s = let |
38 |
val { dir = d0, file = f } = AbsPath.splitDirFile s |
val { dir = d0, file = f } = AbsPath.splitDirFile s |
39 |
val d1 = AbsPath.joinDirFile { dir = d0, file = "CM" } |
val d1 = AbsPath.joinDirFile { dir = d0, file = cmdir } |
40 |
val d2 = AbsPath.joinDirFile { dir = d1, file = d } |
val d2 = AbsPath.joinDirFile { dir = d1, file = d } |
41 |
in |
in |
42 |
AbsPath.joinDirFile { dir = d2, file = f } |
AbsPath.joinDirFile { dir = d2, file = f } |
44 |
val archos = concat [arch, "-", kind2name os] |
val archos = concat [arch, "-", kind2name os] |
45 |
val archosdep = cmpath archos o shift |
val archosdep = cmpath archos o shift |
46 |
in |
in |
47 |
{ skel = cmpath "SKEL", bin = archosdep, stable = archosdep } |
{ skel = cmpath skeldir, bin = archosdep, stable = archosdep } |
48 |
end |
end |
49 |
|
|
50 |
val colocate = mkPolicy (fn s => s) |
val colocate = mkPolicy (fn s => s) |
74 |
fun mkSkelPath (p: policy) s = #skel p s |
fun mkSkelPath (p: policy) s = #skel p s |
75 |
fun mkStablePath (p: policy) s = #stable p s |
fun mkStablePath (p: policy) s = #stable p s |
76 |
end |
end |
77 |
|
|
78 |
|
structure FilenamePolicy = |
79 |
|
FilenamePolicyFn (val cmdir = "NEWCM" val skeldir = "SKEL") |