aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-12 11:24:16 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-12 11:24:16 -0800
commita5bd3ed73db5f3d499eab532034bb9f6960df28f (patch)
treeaab395631955f7359389f344b75432a784886799 /emcc
parentae02feec361db8a69d51a69d51b02ea742212a94 (diff)
support for generating html in emcc, and a test for that that also tests SDL, and some fixes for SDL
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc10
1 files changed, 8 insertions, 2 deletions
diff --git a/emcc b/emcc
index 6a498c1f..6e2f95d2 100755
--- a/emcc
+++ b/emcc
@@ -290,8 +290,14 @@ elif use_compiler:
shared.Building.emscripten(target_basename + '.bc', append_ext=False)
shutil.move(target_basename + '.bc.o.js', target_basename + '.js')
- ## TODO: If we were asked to also generate HTML, do that
- #if final_suffix == 'html':
+ # If we were asked to also generate HTML, do that
+ if final_suffix == 'html':
+ shell = open(shared.path_from_root('src', 'shell.html')).read()
+ html = open(target_basename + '.html', 'w')
+ html.write(shell.replace('{{{ SCRIPT_CODE }}}', open(target_basename + '.js').read()))
+ html.close()
+ temp_files.note(target_basename + '.js')
+
finally:
temp_files.clean()