/Makefile

http://github.com/beamjs/erlv8 · Makefile · 66 lines · 47 code · 19 blank · 0 comment · 4 complexity · c1a89a21d68f956bc6ae3bf2a145e0ba MD5 · raw file

  1. X64=$(shell file -L `which epmd` | grep x86_64 | wc -l | xargs echo)
  2. X64L=$(shell file -L `which epmd` | grep x86-64 | wc -l | xargs echo)
  3. OSX=$(shell uname | grep Darwin | wc -l | xargs echo)
  4. LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
  5. V8ENV=GYPFLAGS="-f make"
  6. ifeq ($(X64),1)
  7. V8FLAGS=arch=x64
  8. else
  9. V8FLAGS=
  10. endif
  11. ifeq ($(X64L),1)
  12. V8FLAGS=arch=x64
  13. V8ENV=CCFLAGS=-fPIC
  14. endif
  15. ifeq ($(LINUX),1)
  16. ZMQ_FLAGS=--with-pic
  17. else
  18. ZMQ_FLAGS=
  19. endif
  20. all: compile
  21. sh:
  22. @erl -pa ebin/ deps/*/ebin/ -s reloader -eval "d:err()"
  23. deps/v8/.git/config:
  24. @git submodule init
  25. @git submodule update
  26. deps/zeromq2/.git/HEAD:
  27. @git submodule init
  28. @git submodule update
  29. deps/v8/libv8.a: deps/v8/.git/config
  30. cd deps/v8 && $(V8ENV) scons $(V8FLAGS)
  31. deps/zeromq2/src/.libs/libzmq.a: deps/zeromq2/.git/HEAD
  32. @cd deps/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
  33. dependencies: deps/v8/libv8.a deps/zeromq2/src/.libs/libzmq.a
  34. @./rebar get-deps
  35. test: compile
  36. @./rebar eunit skip_deps=true
  37. dbg-test: compile
  38. @USE_GDB=true ./rebar eunit skip_deps=true
  39. compile: dependencies fast
  40. fast:
  41. @EXTRA_CFLAGS= ./rebar compile
  42. debug: dependencies
  43. @EXTRA_CFLAGS="-g3 -O0 -DERLV8_DEBUG" ./rebar compile
  44. clean:
  45. -rm c_src/*.o
  46. analyze:
  47. clang --analyze -Xanalyzer "-Ideps/v8/include/" -Xanalyzer "-I/usr/local//Cellar/erlang/R15B/lib/erlang/usr/include" -Xanalyzer "-Ideps/zeromq2/include/" c_src/*.cc