rules_ocaml icon indicating copy to clipboard operation
rules_ocaml copied to clipboard

OCaml compiler bazelization

Open mobileink opened this issue 4 years ago • 0 comments

Preprocessing

utils/config.mlp files is preprocessed with sed, using makefiles. See utils/Makefile target config.ml.

Platform-specific directories under asmcomp contain emit.mlp, e.g. asmcomp/i386/emit.mlp. These are processed by a rule in asmcomp/dune:

(rule
 (targets emit.ml)
 (mode    fallback)
 (deps    (:conf ../Makefile.config)
          amd64/emit.mlp
          arm/emit.mlp
          arm64/emit.mlp
          i386/emit.mlp
          power/emit.mlp
          riscv/emit.mlp
          s390x/emit.mlp)
 (action
   (progn
     (with-stdout-to contains-input-name
       (bash "echo `grep '^ARCH=' %{conf} | cut -d'=' -f2`/emit.mlp"))
     (with-stdout-to %{targets}
       (progn
         (bash "echo \\# 1 \\\"`cat contains-input-name`\\\"")
         (bash "%{dep:../tools/cvt_emit.exe} < `cat contains-input-name`"))))))

mobileink avatar Nov 22 '21 14:11 mobileink