<commit_before>EMCC=`which emcc`

nodesockets:
	$(EMCC) test.c -lenet -L../libs -I../include -o index.js \
        --js-library ../src/library_node_sockets.js --js-library ../src/library_inet.js -O2 -s ASM_JS=1 --closure 1

inet_ntop.o: ../src/inet_ntop.c
	$(EMCC) ../src/inet_ntop.c -o ../libs/inet_ntop.o

inet_pton.o: ../src/inet_pton.c
	$(EMCC) ../src/inet_pton.c -o ../libs/inet_pton.o

test_inet1: test_inet4.c test_inet6.c ../src/library_inet.js
	$(EMCC) test_inet6.c -o test_inet6.js --js-library ../src/library_inet.js -O2 -s ASM_JS=1 --closure 1
	$(EMCC) test_inet4.c -o test_inet4.js --js-library ../src/library_inet.js -O2 -s ASM_JS=1 --closure 1

test_inet2: test_inet6.c test_inet4.c inet_ntop.o inet_pton.o
	$(EMCC) test_inet6.c ../libs/inet_ntop.o ../libs/inet_pton.o -o test_inet6.js -O2 -s ASM_JS=1 --closure 1
	$(EMCC) test_inet4.c ../libs/inet_ntop.o ../libs/inet_pton.o -o test_inet4.js -O2 -s ASM_JS=1 --closure 1

chrome-ext:
	mkdir -p chrome/
	$(EMCC) test.c -lenet -L../libs -I../include -o chrome/index.js \
        --js-library ../src/library_node_sockets.js --js-library ../src/library_inet.js \
        -s CHROME_SOCKETS=1  -O2 -s ASM_JS=1 --closure 1 -s SOCKET_DEBUG=0<commit_msg>dont't use closure for chrome extension<commit_after>EMCC=`which emcc`

nodesockets:
	$(EMCC) test.c -lenet -L../libs -I../include -o index.js \
        --js-library ../src/library_node_sockets.js --js-library ../src/library_inet.js -O2 -s ASM_JS=1 --closure 1

inet_ntop.o: ../src/inet_ntop.c
	$(EMCC) ../src/inet_ntop.c -o ../libs/inet_ntop.o

inet_pton.o: ../src/inet_pton.c
	$(EMCC) ../src/inet_pton.c -o ../libs/inet_pton.o

test_inet1: test_inet4.c test_inet6.c ../src/library_inet.js
	$(EMCC) test_inet6.c -o test_inet6.js --js-library ../src/library_inet.js -O2 -s ASM_JS=1 --closure 1
	$(EMCC) test_inet4.c -o test_inet4.js --js-library ../src/library_inet.js -O2 -s ASM_JS=1 --closure 1

test_inet2: test_inet6.c test_inet4.c inet_ntop.o inet_pton.o
	$(EMCC) test_inet6.c ../libs/inet_ntop.o ../libs/inet_pton.o -o test_inet6.js -O2 -s ASM_JS=1 --closure 1
	$(EMCC) test_inet4.c ../libs/inet_ntop.o ../libs/inet_pton.o -o test_inet4.js -O2 -s ASM_JS=1 --closure 1

#Chrome Extension CSP doesn't allow use of eval() which is being used in code generated by closure compiler
chrome-ext:
	mkdir -p chrome/
	$(EMCC) test.c -lenet -L../libs -I../include -o chrome/index.js \
        --js-library ../src/library_node_sockets.js --js-library ../src/library_inet.js \
        -s CHROME_SOCKETS=1  -O2 -s ASM_JS=1 --closure 0 -s SOCKET_DEBUG=0
{'fraction_non_alphanumeric': 0.17893500391542677, 'fraction_numerical': 0.02662490211433046, 'mean_word_length': 2.7136627906976742, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7268592', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1097, 'n_words': 238}