-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
29 lines (21 loc) · 832 Bytes
/
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
all: jq.js jq.wasm
clean:
rm -fr jq jq.*
jq/configure:
git submodule update --init
cd jq && \
git submodule update --init && \
autoreconf -fi
jq/Makefile: jq/configure
cd jq && emconfigure ./configure --disable-maintainer-mode --disable-silent-rules --with-oniguruma=builtin
jq/jq: jq/Makefile pre.js post.js extern-post.js
rm -f $@ # needed for emcc to replace existing file
cd jq && env CCFLAGS=-O2 emmake make V=1 VERBOSE=1 LDFLAGS="-all-static -s EXPORTED_RUNTIME_METHODS='[\"callMain\"]' -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s USE_PTHREADS=0 -s EXPORT_NAME=jq -s WASM=1 --pre-js ../pre.js --post-js ../post.js --extern-post-js ../extern-post.js" CCFLAGS=-O2 -j4
jq.js: jq/jq jq.wasm
cp -f jq/jq ./jq.js
jq/jq.wasm: jq/jq
jq.wasm: jq/jq jq/jq.wasm
cp -f jq/jq.wasm .
@PHONY:
test: jq.js
node test.js