diff --git a/Makefile b/Makefile index 5ea6d2b..f7afd2c 100644 --- a/Makefile +++ b/Makefile @@ -24,4 +24,7 @@ else dialyzer --plt $(PLT) -r ebin endif +cross_compile: clean + $(REBAR_COMPILE) -C rebar.cross_compile.config + .PHONY: all compile test clean docs static diff --git a/rebar.cross_compile.config.sample b/rebar.cross_compile.config.sample new file mode 100644 index 0000000..8e35475 --- /dev/null +++ b/rebar.cross_compile.config.sample @@ -0,0 +1,13 @@ +% -*- mode: erlang -*- +{port_envs, [{"HOST", "arm-none-linux-gnueabi"}, + {"CROSS_COMPILE_ROOT", "/home/aromanov"}, + {"SQLITE_CROSS_COMPILED", "$CROSS_COMPILE_ROOT/sqlite-arm"}, + {"CROSS_COMPILE_TOOLCHAIN", "$CROSS_COMPILE_ROOT/sbctools/arm-2007q3"}, + {"OTPROOT_CROSS_COMPILED", "$CROSS_COMPILE_ROOT/otp_arm_compiled"}, + {"ERL_INTERFACE_VERSION", "3.7.1"}, + {"ERL_INTERFACE_LIB", "$OTPROOT_CROSS_COMPILED/lib/erl_interface-$ERL_INTERFACE_VERSION/lib"}, + {"CC", "$CROSS_COMPILE_TOOLCHAIN/bin/$HOST-gcc"}, + {"LD", "$CROSS_COMPILE_TOOLCHAIN/bin/$HOST-ld"}, + {"ERL_LDFLAGS", " -L$ERL_INTERFACE_LIB -lerl_interface -lei"}, + {"DRV_LDFLAGS", "$DRV_LDFLAGS -L$SQLITE_CROSS_COMPILED/usr/local/lib -lsqlite3"}, + {"DRV_CFLAGS", "$DRV_CFLAGS -I$SQLITE_CROSS_COMPILED/usr/local/include"}]}.