-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
67 lines (50 loc) · 2.44 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
src/sdof/_spectrum%so: src/_spectrum.c src/_integrate.c Makefile
# clang -DC11THREADS -std=c11 -O3 -o thread src/spectrum.c src/_integrate.c
gcc -std=c99 -fPIC -O3 -Wall -Wextra -pedantic \
-shared -o $@ \
src/_spectrum.c src/_integrate.c -lpthread
src/sdof/_integrate.%.so: src/_integrate.c Makefile
cc -std=c99 -pedantic -Wall -Wextra -shared -O3 src/_integrate.c -o $@ -fPIC -lm \
-fno-math-errno -fno-signaling-nans -fno-trapping-math \
-fassociative-math -ffast-math
src/sdof/_integrate.s: src/_integrate.c Makefile
cc -S -std=c99 -pedantic -Wall -Wextra -O3 src/_integrate.c -o $@ \
-fno-math-errno -fno-signaling-nans -fno-trapping-math \
-fassociative-math -ffast-math -march=native
fsdof.js:
mkdir -p dist/
emcc src/_spectrum.c src/_integrate.c -O3 -lm -o wasm/fsdof.js \
-s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s SINGLE_FILE=1 \
-s EXPORTED_FUNCTIONS="['_sdof_integrate','_sdof_spectrum','_malloc','_free']" \
-sINCOMING_MODULE_JS_API="['onRuntimeInitialized']" \
-s EXPORTED_RUNTIME_METHODS="['cwrap','getValue','setValue']"
docs/_static/js/sdof.js: src/_integrate.c src/_spectrum.c
mkdir -p dist/
emcc src/_spectrum.c src/_integrate.c -O3 -pthread -lm -o $@ \
-s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s SINGLE_FILE=1 \
-s EXPORTED_FUNCTIONS="['_sdof_integrate','_sdof_spectrum','_malloc','_free']" \
-sINCOMING_MODULE_JS_API="['onRuntimeInitialized']" \
-s EXPORTED_RUNTIME_METHODS="['cwrap','getValue','setValue']"
# src/sdof/_integrate.%.so: src/_integrate.c Makefile
# gcc -g -fsanitize=address -std=c99 -pedantic -Wall -Wextra -shared -Og src/_integrate.c -o $@ -fPIC -lm
thread: src/_spectrum.c src/_integrate.c
# clang -DC11THREADS -std=c11 -O3 -o thread src/tsdof.c src/fsdof.c
gcc -std=c11 -DHAVE_MAIN -O3 -o thread src/_spectrum.c src/_integrate.c -lpthread
#
# Documentation
#
publish:
cp -r _build/html/* site/
git add site && git commit -m'cmp - rebuild site' && git subtree push --prefix site/ brace gh-pages
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = docs
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile publish