forked from google/leveldb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (36 loc) · 1.26 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.PHONY: all
all: build/index.html
build/libleveldb.a:
mkdir -p build
cd build && emconfigure cmake -D WASM=1 -D LEVELDB_BUILD_TESTS=OFF ../
cd build && emmake make -s WASM=1
build/api.js: src/ts/leveldb-functions.ts
tsc
build/libleveldb.js: build/libleveldb.a build/api.js src/leveldb_worker.js src/benchmark.js ../emfs/library_chromefs.js ../emfs/library_iofs.js ../emfs/library_nativeiofs.js
emcc $< -o $@ \
-s EXPORTED_FUNCTIONS=@exported_functions.json \
-s EXTRA_EXPORTED_RUNTIME_METHODS="['ccall', 'lengthBytesUTF8']" \
-s FORCE_FILESYSTEM=1 \
-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE='["$$CHROMEFS", "$$NATIVEIOFS"]' \
-lnodefs.js \
--js-library ../emfs/library_chromefs.js \
--js-library ../emfs/library_nativeiofs.js \
-s USE_PTHREADS=1 \
--post-js build/api.js \
--post-js src/leveldb_worker.js \
--post-js src/benchmark.js
build/leveldb_client.js: src/leveldb_client.js build/libleveldb.js
cp $< $@
build/index.html: src/index.html build/leveldb_client.js
cp $< $@
build/db_bench_client.js: src/db_bench_client.js build/libleveldb.js
cp $< $@
build/db_bench.html: src/db_bench.html build/db_bench_client.js
cp $< $@
run: build/index.html
emrun --no_browser $<
.PHONY: run-bench
run-bench: build/db_bench.html
emrun --no_browser $<
clean:
rm -rf build/