Skip to content

Commit

Permalink
wasm: hello world
Browse files Browse the repository at this point in the history
  • Loading branch information
bpowers committed Oct 18, 2016
1 parent e739075 commit ba4d26c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/hello-wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/hello
/hello.js
7 changes: 7 additions & 0 deletions examples/hello-wasm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hello: hello.c
emcc -O2 -g3 -o hello hello.c -s BINARYEN=1 -s "BINARYEN_METHOD='native-wasm'"

clean:
rm -f hello hello.js

.PHONY: hello clean
7 changes: 7 additions & 0 deletions examples/hello-wasm/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

int
main() {
printf("hello from WebAssembly\n");
return 0;
}

0 comments on commit ba4d26c

Please sign in to comment.