Manuel Schölling / manuel.schoelling@gmx.de - github.com/manuels
>github.com/ma
m
unrealengine.com/html5
git clone https://github.com/kripken/emscripten.git
git checkout incoming
int main() {
char msg[] = "Hello World!";
printf("%s\n", msg);
return 0;
}
$ gcc test.c
$ ls -l a.out
-rwxr-xr-x 1 manuel manuel 7387 Okt 29 18:02 a.out
$ emcc test.c
$ ls -l a.out.js
-rw-r--r-- 1 manuel manuel 173828 Okt 29 18:03 a.out.js
$ emcc -O3 test.c
-rw-r--r-- 1 manuel manuel 43465 Okt 29 18:08 a.out.js
STATIC_BASE = 8;
STATICTOP = STATIC_BASE + 24;
allocate([72,101,108,108,111,32,87,111,114,108,100,33,0,0,0,0,
37,115,10,0,0,0,0,0], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE)
function _main() {
var label = 0;
var tempVarArgs = 0;
var sp = STACKTOP; STACKTOP = (STACKTOP + 16)|0;
(assert((STACKTOP|0) < (STACK_MAX|0))|0);
var $1;
var $msg=sp;
$1=0;
var $2=$msg;
assert(13 % 1 === 0);(_memcpy($2, ((8)|0), 13)|0);
var $3=(($msg)|0);
var $4=_printf(((24)|0), (tempVarArgs=STACKTOP,STACKTOP =
(STACKTOP + 8)|0,(assert((STACKTOP|0) < (STACK_MAX|0))|0),
HEAP32[((tempVarArgs)>>2)]=$3,tempVarArgs));
STACKTOP=tempVarArgs;
STACKTOP = sp;
return 0;
}
The native way
$ ./configure
$ make
$ make install
The Emscripten way
$ emconfigure ./configure
$ emmake make
var home = FS.createFolder('/', 'home', true, false);
FS.createFolder(home, 'user', true, true);
FS.createDataFile('/', 'text.txt', 'Hello World', true, false);
/* FS.createLazyFile('/', 'site.html',
'other/page.htm', true, false); */
FS.createDevice('/dev', 'random', function() {
return Math.floor(Math.random() * 256);
});
./src/library.js
./tests/runner.py
EMCC_DEBUG=2 emmake make
FS.createLazyFile()
uses sync XMLHttpRequestWeb 2.0
Unhosted