Packages

Interfaces Elixir with C/C++ code in a user-friendly way! Based on Erlang-ports. Provides a few Mix-tasks to kickstart the development process.

Current section

Files

Jump to
cure lib cure.make.ex
Raw

lib/cure.make.ex

defmodule Mix.Tasks.Cure.Make do
use Mix.Task
@shortdoc "Uses Makefile (in c_src dir) to compile your C-source code."
@source_dir Path.expand("../../c_src")
@opts [stderr_to_stdout: true]
def run([]) do
{output, _} = System.cmd("make", ["-C", @source_dir], @opts)
IO.puts output
end
def run([target]) do
{output, _} = System.cmd("make", [target, "-C", @source_dir], @opts)
IO.puts output
end
def run([target | rest]) do
run([target])
run(rest)
end
end