Skip to content

Commit

Permalink
Build plugins after install
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorNicollet committed Aug 27, 2012
1 parent 178b944 commit 85f5182
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ let project, name =

let path seq = List.fold_left Filename.concat project seq

let readdir p =
let path = path p in
try Array.to_list (Sys.readdir path)
with exn -> error "Could not read directory %S : %s" path (Printexc.to_string exn)

module Install = struct

let prefix = ref ""
Expand Down Expand Up @@ -105,7 +110,13 @@ module Install = struct

let touch p =
run "touch %s" (Filename.quote (path p))


let make_plugin plugin =
let p = [ ".ohm" ; "Ohm-Plugins" ; plugin ; "tool" ] in
let exists = try Sys.is_directory (path p) with _ -> false in
if exists then
run "make -C %s" (Filename.quote (path p))

end

(* Fresh install means there have been no directories or files
Expand Down Expand Up @@ -141,6 +152,10 @@ let () = List.iter (fun (path,src) -> Install.clone path src) [

let () = Install.run "make --quiet -C %s" (Filename.quote (path [".ohm" ; "Ohm"]))

(* Build the plugins that need building. *)

let () = List.iter Install.make_plugin (readdir [".ohm" ; "Ohm-Plugins"])

(* Create the relevant symlinks *)

let () = List.iter (fun (src,dest) -> Install.symlink src dest) [
Expand Down

0 comments on commit 85f5182

Please sign in to comment.