-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (44 loc) · 1.52 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
install_path = $(shell systemd-path user-binaries)
target_bin = build/release/mime
.PHONY: default init clean build debug test testCover package install format
default: build
init:
git submodule update --init --recursive c++/vendor/*
clean:
rm -rf build
build: c++/CMakeLists.txt
mkdir -p build/release && cd build/release && cmake -DCMAKE_BUILD_TYPE=Release ../../c++ && $(MAKE) -s
debug: c++/CMakeLists.txt
mkdir -p build/debug && cd build/debug && cmake -DCMAKE_BUILD_TYPE=Debug ../../c++ && $(MAKE) -s
test: build
build/release/unittests
testCover: test
gcovr -r . -f c++/src --html --html-details -o build/coverage.html
install: test
test "$(install_path)" == "" \
&& echo -e "\nunable to get 'user-binaries' path from 'systemd-path' command\n" \
|| install $(target_bin) $(install_path)/
package:
tar -czf mime-linux-amd64.tar.gz --directory=build/release mime
tar -cJf mime-linux-amd64.tar.xz --directory=build/release mime
##
src = $(shell find c++/src c++/include c++/unittests -type f -name '*.cc' -o -name '*.hh')
format:
clang-format -i $(src)
wasm:
em++ \
-O3 \
--std=c++17 \
-I vendor/ChaiScript/include \
-I include \
-I vendor/cxxopts/include \
-I vendor/immer/ \
-s DEMANGLE_SUPPORT=1 \
-s MAIN_MODULE=1 \
-s "EXPORTED_FUNCTIONS=['_run_script']" \
-s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" \
--pre-js docs/playground/emscripten-pre.js \
-o docs/playground/mime.js \
src/cmd/chai.cc src/lib/*.cc
playground-css:
cd docs/playground && npx tailwindcss build -o tailwind.css