Index: compile |
=================================================================== |
--- a/compile |
+++ b/compile |
@@ -1,26 +1,27 @@ |
#!/usr/bin/env python |
import os |
import re |
import subprocess |
-EMSCRIPTEN_PATH = '../emscripten' |
-SOURCE_DIR = './compiled' |
+BASE_DIR = os.path.dirname(__file__) |
+EMSCRIPTEN_PATH = os.path.join(BASE_DIR, '..', 'emscripten') |
+SOURCE_DIR = os.path.join(BASE_DIR, 'compiled') |
SOURCE_FILES = [ |
os.path.join(path, f) |
for (path, dirs, files) in os.walk(SOURCE_DIR) |
for f in files |
if f.endswith('.cpp') |
] |
BINDINGS_FILE = os.path.join(SOURCE_DIR, 'bindings.cpp') |
BINDINGS_GENERATOR = os.path.join(SOURCE_DIR, 'bindings.cpp.js') |
BINDINGS_OUTPUT = os.path.join(SOURCE_DIR, 'bindings.js') |
-COMPILER_OUTPUT = './lib/compiled.js' |
+COMPILER_OUTPUT = os.path.join(BASE_DIR, 'lib', 'compiled.js') |
GENERATION_PARAMS = { |
'SHELL_FILE': "'{}'".format(os.path.abspath(os.path.join(SOURCE_DIR, |
'shell.js'))), |
'ASM_JS': 2, # "almost asm" |
'TOTAL_MEMORY': 16*1024*1024, |
'TOTAL_STACK': 1*1024*1024, |
'ALLOW_MEMORY_GROWTH': 1, |
'NO_EXIT_RUNTIME': 1, |