1

I have a library that has some C stubs which needs to be linked against some other C code that I need to compile directly with gcc.

I'm trying to do it like this, but the rule that calls gcc doesn't seem to be executing:

(rule
    (targets libart.o)
    (deps (:c art.c) (:h art.h))
    (action 
        (run gcc -c -std=c99 -D_GNU_SOURCE -Wall -Werror -O3 -g %{c} -o %{targets})))

(library
    (name art)
    (preprocessor_deps libart.o)
    (c_flags -I lib/)
    (c_library_flags ./lib/libart.o)
    (c_names art_stubs))
bobpoekert
  • 934
  • 1
  • 11
  • 26
  • 1
    I don't know dune very well, but I would be surprised if there wasn't a built-in way to compile C extensions. – Richard-Degenne May 17 '19 at 12:38
  • If your question is still relevant and you still need an answer, I suggest you go to the [OCaml Discourse forum](https://discuss.ocaml.org/), you'll likely find an answer there. :) – Richard-Degenne May 24 '19 at 08:24

0 Answers0