Created
October 23, 2014 15:46
-
-
Save aidanhs/b88dae12fab1e6889414 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: clean do | |
CFLAGS=-O0 -m32 | |
EMFLAGS=\ | |
--memory-init-file 0 | |
do: clean x.o y.o z.o | |
emar rc libtest.a y.o | |
emar rc libtest.a x.o | |
emranlib libtest.a | |
EMCC_DEBUG=2 emcc -s EXPORTED_FUNCTIONS="['_aaa']" $(EMFLAGS) $(CFLAGS) -o out.html z.o libtest.a | |
clean: | |
rm -f *.o py/*.o *.a *.js *.html | |
%.o: %.c | |
emcc $(CFLAGS) -c -o $@ $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int init_weakref(int a, int b) { | |
return a + b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int init_weakref(void) { | |
return 150; | |
} | |
int testy(void) { | |
return init_weakref(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern int init_weakref(int, int); | |
extern int testy(void); | |
int aaa(void) { | |
return testy() + init_weakref(5, 6); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment