cil-project / cil

C Intermediate Language
Other
348 stars 86 forks source link

Respect $MAKE environment variable in myocamlbuild.ml #43

Open madroach opened 6 years ago

madroach commented 6 years ago

Please consider the following patch for inclusion:

Index: myocamlbuild.ml
--- myocamlbuild.ml.orig
+++ myocamlbuild.ml
@@ -21,22 +21,25 @@ let cil_version =
   with Not_found -> "" ;;

 dispatch begin function
+| Before_options ->
+    Options.use_ocamlfind := true
 | After_rules ->
     (* the main CIL library *)
     ocaml_lib "src/cil";

     (* residual reliance on make to build some OCaml source files *)
     let make target =
+      let make = try Sys.getenv "MAKE" with Not_found -> "make" in
       let basename = Pathname.basename target in
       rule ("make " ^ target)
       ~dep: "Makefile"
       ~prod: basename
       (fun _ _ -> Cmd (S
-        [A "make"; A "-C"; P ".."; P ("_build" / target)]))
-      in
-      make "cilversion.ml";
-      make "feature_config.ml";
-      make "machdep.ml";
+        [A make; A "-C"; P ".."; P ("_build" / target)]))
+    in
+    make "cilversion.ml";
+    make "feature_config.ml";
+    make "machdep.ml";

     (* Build an list of files to install with ocamlfind *)
     rule "%.mllib -> %.libfiles"
pmetzger commented 6 years ago
  1. You should probably do a pull request. It makes it easier to patch things.
  2. It appears the maintainers are no longer really maintaining CIL so don't expect to hear from them any time soon.
kerneis commented 6 years ago

it appears the maintainers are no longer really maintaining CIL so don't expect to hear from them any time soon.

True. @pmetzger, I've given you write access to CIL. Sorry I didn't do that sooner, as suggested on the previous pull request. Feel free to merge in pending PR that make sense, if you can test that they compile/work.

pmetzger commented 6 years ago

@madroach If you could re-open this as a pull request, it would make potential merging easier.

pmetzger commented 6 years ago

@kerneis Just a warning, I'm not really a good custodian for the code. I'm not currently using it for my work (though I've borrowed pieces of the code). I can help a little bit, but you should perhaps ask on the CIL mailing list to find some maintainers who are more committed?