Implementation of a restricted execution engine to safely process untrusted code. Implemented in C to sandbox LUA scripts. Described in deliverable 3.3

Makefile 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. pwd := $(shell pwd)
  2. luasand := ${pwd}/build/lua_sandbox
  3. musl := ${pwd}/build/musl
  4. musl-gcc := ${musl}/obj/musl-gcc
  5. test-exec := ${pwd}/src/decode-exec -c ${pwd}/test/decode-test.conf
  6. all: bootstrap-check patches luasandbox luanacha
  7. make -C src
  8. bootstrap-check:
  9. @if ! [ -r ${musl-gcc} ]; then echo "\nRun 'make bootstrap' first to build the compiler.\n" && exit 1; fi
  10. patches:
  11. ./build/apply-patches
  12. bootstrap:
  13. if ! [ -r ${musl-gcc} ]; then mkdir -p ${musl} && cd ${musl} && ${pwd}/lib/musl/configure; fi
  14. make -j2 -C ${musl}
  15. luasandbox:
  16. if ! [ -r ${luasand}/CMakeCache.txt ]; then mkdir -p ${luasand} && cd ${luasand} && CC=${musl-gcc} cmake ${pwd}/lib/lua_sandbox -DCMAKE_C_FLAGS="-static -Os" ; fi
  17. make -C ${luasand} luasandbox
  18. luanacha:
  19. make -C ${pwd}/build/luanacha
  20. # needed for yices2, in case useful (WIP)
  21. # gmp:
  22. # if ! [ -r lib/gmp/Makefile ]; then cd lib/gmp && CC=${musl-gcc} ./configure --disable-shared --enable-static; fi
  23. # make -C lib/gmp -j2
  24. check:
  25. ${test-exec} test/vararg.lua
  26. ${test-exec} test/pm.lua
  27. ${test-exec} test/nextvar.lua
  28. ${test-exec} test/locals.lua
  29. ${test-exec} test/constructs.lua
  30. ${test-exec} test/test_luanacha.lua
  31. @echo "----------------"
  32. @echo "All tests passed"
  33. @echo "----------------"
  34. clean:
  35. rm -rf ${luasand}
  36. make -C src clean
  37. make -C ${pwd}/build/luanacha clean
  38. distclean:
  39. rm -rf ${musl}