erlang-native-compiler
erlang-native-compiler copied to clipboard
A standalone executable for compiling native code for Erlang.
trafficstars
Erlang Native Compiler
Since rebar3 refuses to add support for NIFs I've created this self contained escript to compile native code. This is based on rebar2 by removing everything unrelated to the port compiler.
Usage
- Clone this repository
- Run
makein this directory - Copy
encto your project and commit it - Add these (or similar) hooks to your rebar.config:
{pre_hooks, [{"", compile, "./enc compile"}]}.
{post_hooks, [{"", clean, "./enc clean"}]}.
After that enc should read your old rebar.config port\_specs and port\_env settings as expected (it is rebar2's port compiler after all...).
Compatibility Note
Remember that you'll want to make sure and build enc with the oldest Erlang VM you want to support.