-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (65 loc) · 1.86 KB
/
Makefile
File metadata and controls
84 lines (65 loc) · 1.86 KB
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
76
77
78
79
80
81
82
83
84
MAKEFLAGS += -s
CXX = em++
COMMON_CXXFLAGS = \
-std=c++11 \
-fno-exceptions \
-fno-rtti \
-fno-threadsafe-statics \
-fvisibility-inlines-hidden \
-Oz \
-I. \
-DHB_TINY \
-DHB_USE_INTERNAL_QSORT \
-DHB_EXPERIMENTAL_API
HB_CXXFLAGS = \
$(COMMON_CXXFLAGS) \
-flto \
-DHB_CONFIG_OVERRIDE_H=\"config-override.h\"
HB_LDFLAGS = \
--no-entry \
-s MODULARIZE \
-s EXPORT_ES6 \
-s EXPORT_NAME=createHarfBuzz \
-s EXPORTED_FUNCTIONS=@harfbuzz.symbols \
-s EXPORTED_RUNTIME_METHODS=@em.runtime \
-s INITIAL_MEMORY=256KB \
-s ALLOW_MEMORY_GROWTH \
-s ALLOW_TABLE_GROWTH \
-lexports.js
HB_SRCS = harfbuzz/src/harfbuzz.cc
HB_DEPS = config-override.h harfbuzz.symbols em.runtime
HB_TARGET = harfbuzz.js
HB_SUBSET_CXXFLAGS = \
$(COMMON_CXXFLAGS) \
-DHB_CONFIG_OVERRIDE_LAST_H=\"config-override-subset.h\"
HB_SUBSET_LDFLAGS = \
--no-entry \
-s EXPORTED_FUNCTIONS=@harfbuzz-subset.symbols \
-s INITIAL_MEMORY=65MB
HB_SUBSET_SRCS = harfbuzz/src/harfbuzz-subset.cc
HB_SUBSET_DEPS = config-override-subset.h harfbuzz-subset.symbols
HB_SUBSET_TARGET = harfbuzz-subset.wasm
.PHONY: all clean hb hb-subset test typecheck doc
all: hb hb-subset node_modules
npx tsdown
hb: $(HB_TARGET)
hb-subset: $(HB_SUBSET_TARGET)
$(HB_TARGET): $(HB_SRCS) $(HB_DEPS)
echo " CXX $@"
$(CXX) $(HB_CXXFLAGS) $(HB_LDFLAGS) -o $@ $(HB_SRCS)
$(HB_SUBSET_TARGET): $(HB_SUBSET_SRCS) $(HB_SUBSET_DEPS)
echo " CXX $@"
$(CXX) $(HB_SUBSET_CXXFLAGS) $(HB_SUBSET_LDFLAGS) -o $@ $(HB_SUBSET_SRCS)
node_modules: package.json
npm install --ignore-scripts
touch $@
typecheck: all
npx tsc --noEmit
test: all typecheck
npx vitest run --dir test
node examples/harfbuzz.example.node.js
node examples/harfbuzz-subset.example.node.js
doc: node_modules
npx typedoc src/index.ts --headings.readme false --treatWarningsAsErrors --out docs
clean:
rm -f $(HB_TARGET) $(HB_SUBSET_TARGET) harfbuzz.wasm