-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
75 lines (64 loc) · 1.75 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
CFLAGS := \
-O2 \
-D__ANSI__ \
-DDISABLE_PERF_MEASUREMENT \
-Ijxrlib/jxrgluelib \
-Ijxrlib/common/include \
-Ijxrlib/image/sys \
-Wno-constant-conversion \
-Wno-unused-const-variable \
-Wno-deprecated-declarations \
-Wno-comment \
-Wno-unused-value \
-Wno-unused-function \
-Wno-unknown-pragmas \
-Wno-extra-tokens \
-Wno-missing-field-initializers \
-Wno-shift-negative-value \
-Wno-dangling-else \
-Wno-sign-compare
LINK_FLAGS := \
-s SUPPORT_BIG_ENDIAN=1 \
-s MODULARIZE=1 \
-s EXPORT_NAME=jpegxr \
-s SINGLE_FILE=1 \
--no-entry \
--post-js=wasm/wasm_api.js \
-s EXPORTED_FUNCTIONS='["_malloc","_free"]' \
-s ALLOW_MEMORY_GROWTH=1
SOURCES := \
jxrlib/image/sys/adapthuff.c \
jxrlib/image/sys/image.c \
jxrlib/image/sys/strcodec.c \
jxrlib/image/sys/strPredQuant.c \
jxrlib/image/sys/strTransform.c \
jxrlib/image/sys/perfTimerANSI.c \
jxrlib/image/decode/decode.c \
jxrlib/image/decode/postprocess.c \
jxrlib/image/decode/segdec.c \
jxrlib/image/decode/strdec.c \
jxrlib/image/decode/strInvTransform.c \
jxrlib/image/decode/strPredQuantDec.c \
jxrlib/image/decode/JXRTranscode.c \
jxrlib/image/encode/encode.c \
jxrlib/image/encode/segenc.c \
jxrlib/image/encode/strenc.c \
jxrlib/image/encode/strFwdTransform.c \
jxrlib/image/encode/strPredQuantEnc.c \
jxrlib/jxrgluelib/JXRGlue.c \
jxrlib/jxrgluelib/JXRGlueJxr.c \
jxrlib/jxrgluelib/JXRGluePFC.c \
jxrlib/jxrgluelib/JXRMeta.c \
wasm/wasm_api.c
OBJECTS := ${SOURCES:.c=.o}
OUTPUT := wasm/jpegxr.js
.PHONY: all clean
all: ${OUTPUT} ${DIS}
clean:
rm -f ${OBJECTS} ${OUTPUT}
test: ${OUTPUT}
node wasm/test.js
${OUTPUT} : ${OBJECTS} Makefile
emcc ${CFLAGS} ${LINK_FLAGS} -o ${OUTPUT} ${OBJECTS}
%.o : %.c Makefile
emcc ${CFLAGS} -o $@ -c $<