forked from lucianodato/noise-repellent
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
40 lines (33 loc) · 1.21 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
include Makefile.share
EFLAGS=\
--memory-init-file 0 --post-js post.js \
-s "EXPORT_NAME='NoiseRepellentFactory'" \
-s "[email protected]" \
-s "EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap']" \
-s MODULARIZE=1
all: noise-repellent-m.asm.js noise-repellent-m.wasm.js
noise-repellent-m.asm.js: src/libnoise-repellent.a post.js
$(CC) $(CFLAGS) $(EFLAGS) -s WASM=0 \
$< $(FFTW3) -o $@
cat license.js $@ > [email protected]
mv [email protected] $@
noise-repellent-m.wasm.js: src/libnoise-repellent.a post.js
$(CC) $(CFLAGS) $(EFLAGS) \
$< $(FFTW3) -o $@
cat license.js $@ > [email protected]
mv [email protected] $@
$(FFTW3):
test -e fftw-$(FFTW3_VERSION).tar.gz || wget http://www.fftw.org/fftw-$(FFTW3_VERSION).tar.gz
test -e fftw-$(FFTW3_VERSION)/configure || tar zxf fftw-$(FFTW3_VERSION).tar.gz
test -e fftw-$(FFTW3_VERSION)/build/Makefile || ( \
mkdir -p fftw-$(FFTW3_VERSION)/build ; \
cd fftw-$(FFTW3_VERSION)/build ; \
emconfigure ../configure --prefix=/usr --enable-float CFLAGS=-Oz \
)
cd fftw-$(FFTW3_VERSION)/build ; $(MAKE)
src/libnoise-repellent.a: $(FFTW3) src/*.c
cd src ; $(MAKE)
clean:
rm -rf fftw-$(FFTW3_VERSION)
cd src ; $(MAKE) clean
rm -f noise-repellent.asm.js noise-repellent.wasm.js noise-repellent.wasm.wasm