-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
206 lines (164 loc) · 5.2 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
UID=${shell id -u}
GID=${shell id -g}
LIB_SOURCE_DIR="${ROOT_DIR}/packages/sqlynx-core"
LIB_DEBUG_DIR="${LIB_SOURCE_DIR}/build/native/o0"
LIB_RELWITHDEBINFO_DIR="${LIB_SOURCE_DIR}/build/native/o2"
LIB_RELEASE_DIR="${LIB_SOURCE_DIR}/build/native/o3"
LIB_COVERAGE_DIR="${LIB_SOURCE_DIR}/build/coverage"
CORES=$(shell grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
LLVM_PROFDATA=llvm-profdata
LLVM_COV=llvm-cov
OS := $(shell uname)
ifeq ($(OS),Darwin)
LLVM_PROFDATA=/opt/homebrew/opt/llvm/bin/llvm-profdata
LLVM_COV=/opt/homebrew/opt/llvm/bin/llvm-cov
endif
# ---------------------------------------------------------------------------
# Parser
.PHONY: infra_linux
infra_linux:
./scripts/install_infra.sh linux
rustup target add x86_64-unknown-linux-gnu
.PHONY: infra_macos
infra_macos:
./scripts/install_infra.sh macos
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
.PHONY: flatbuf
flatbuf:
./scripts/generate_flatbuf.sh
.PHONY: protobuf
protobuf:
node ./node_modules/.bin/buf generate && yarn workspace @ankoh/sqlynx-protobuf build
.PHONY: core_native_o0
core_native_o0:
mkdir -p ${LIB_DEBUG_DIR}
cmake -S ${LIB_SOURCE_DIR} -B ${LIB_DEBUG_DIR} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
ln -sf ${LIB_DEBUG_DIR}/compile_commands.json ${LIB_SOURCE_DIR}/compile_commands.json
cmake --build ${LIB_DEBUG_DIR} --parallel ${CORES}
.PHONY: core_native_o0_yydebug
core_native_o0_yydebug:
mkdir -p ${LIB_DEBUG_DIR}
cmake -S ${LIB_SOURCE_DIR} -B ${LIB_DEBUG_DIR} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
-DYYDEBUG=1
ln -sf ${LIB_DEBUG_DIR}/compile_commands.json ${LIB_SOURCE_DIR}/compile_commands.json
cmake --build ${LIB_DEBUG_DIR} --parallel ${CORES}
.PHONY: core_native_o0_cov
core_native_o0_cov:
mkdir -p ${LIB_DEBUG_DIR}
cmake -S ${LIB_SOURCE_DIR} -B ${LIB_DEBUG_DIR} \
-DCODE_COVERAGE=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
ln -sf ${LIB_DEBUG_DIR}/compile_commands.json ${LIB_SOURCE_DIR}/compile_commands.json
cmake --build ${LIB_DEBUG_DIR} --parallel ${CORES}
.PHONY: core_native_o2
core_native_o2:
mkdir -p ${LIB_RELWITHDEBINFO_DIR}
cmake -S ${LIB_SOURCE_DIR} -B ${LIB_RELWITHDEBINFO_DIR} -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build ${LIB_RELWITHDEBINFO_DIR} --parallel ${CORES}
.PHONY: core_native_o3
core_native_o3:
mkdir -p ${LIB_RELEASE_DIR}
cmake -S ${LIB_SOURCE_DIR} -B ${LIB_RELEASE_DIR} -DCMAKE_BUILD_TYPE=Release
cmake --build ${LIB_RELEASE_DIR} --parallel ${CORES}
.PHONY: core_native_tests
core_native_tests:
${LIB_DEBUG_DIR}/tester --source_dir . --gtest_filter="-*Rope*"
.PHONY: core_native_tests_slow
core_native_tests_slow:
${LIB_DEBUG_DIR}/tester --source_dir .
.PHONY: core_native_coverage
core_native_coverage:
${LLVM_PROFDATA} merge -output=default.prof -instr default.profraw
${LLVM_COV} show \
--instr-profile default.prof \
--format html \
--ignore-filename-regex='.*/build/native/Debug/.*' \
--ignore-filename-regex='.*/utf8proc/.*' \
--ignore-filename-regex='.*/proto/proto_generated.h' \
--ignore-filename-regex='.*/.*\.list' \
-o ${LIB_COVERAGE_DIR} \
${LIB_DEBUG_DIR}/tester
.PHONY: benchmark_pipeline
benchmark_pipeline:
${LIB_RELWITHDEBINFO_DIR}/benchmark_pipeline
.PHONY: core_wasm_o0
core_wasm_o0:
./scripts/build_parser_wasm.sh o0
.PHONY: core_wasm_o2
core_wasm_o2:
./scripts/build_parser_wasm.sh o2
.PHONY: core_wasm_o3
core_wasm_o3:
./scripts/build_parser_wasm.sh o3
.PHONY: core_js_o0
core_js_o0:
yarn workspace @ankoh/sqlynx-core build:o0
.PHONY: core_js_o2
core_js_o2:
yarn workspace @ankoh/sqlynx-core build:o2
.PHONY: core_js_o3
core_js_o3:
yarn workspace @ankoh/sqlynx-core build:o3
.PHONY: core_js_tests
core_js_tests:
yarn workspace @ankoh/sqlynx-core test
.PHONY: core_js_debug
core_js_tests_debug:
yarn workspace @ankoh/sqlynx-core test:debug
.PHONY: compute_wasm_o0
compute_wasm_o0:
yarn run compute:wasm:o0
.PHONY: compute_wasm_o3
compute_wasm_o3:
yarn run compute:wasm:o3
.PHONY: pwa_pages
pwa_pages:
yarn workspace @ankoh/sqlynx-app build:pages
.PHONY: pwa_reloc
pwa_reloc:
yarn workspace @ankoh/sqlynx-app build:reloc
.PHONY: pwa_dev
pwa_dev:
yarn workspace @ankoh/sqlynx-app serve:dev
.PHONY: pwa_dev_trace
pwa_dev_trace:
SQLYNX_LOG_LEVEL=trace yarn workspace @ankoh/sqlynx-app serve:dev
# Run specific pwa tests with:
# yarn workspace @ankoh/sqlynx-app test random_data.test.ts
.PHONY: pwa_tests
pwa_tests:
yarn workspace @ankoh/sqlynx-app test
.PHONY: pwa_tests_verbose
pwa_tests_verbose:
yarn workspace @ankoh/sqlynx-app test --verbose=true
.PHONY: lint
lint:
DEBUG=eslint:cli-engine yarn run eslint
.PHONY: native_mac_dev
native_mac_dev:
yarn run tauri dev
.PHONY: native_mac_o0
native_mac_o0:
yarn run tauri build --ci --bundles dmg --debug --verbose
.PHONY: native_mac
native_mac_universal:
yarn run tauri build --ci --target universal-apple-darwin --bundles dmg
.PHONY: native_mac_updates
native_mac_updates:
yarn run tauri build --ci --bundles updater,app
.PHONY: native_tests
native_tests:
cargo test
.PHONY: svg_symbols
svg_symbols:
python3 ./scripts/generate_svg_symbols.py
.PHONY: snapshots
snapshots:
${LIB_DEBUG_DIR}/snapshotter --source_dir .