| 1 |
LIB := $(shell faust --libdir) |
| 2 |
LIB_OPT := /opt/local/lib |
| 3 |
INC := $(shell faust --includedir) |
| 4 |
|
| 5 |
DESTDIR ?= |
| 6 |
PREFIX ?= /usr/local |
| 7 |
|
| 8 |
LLVM := `llvm-config --link-static --ldflags --libs all --system-libs` |
| 9 |
|
| 10 |
prefix := $(DESTDIR)$(PREFIX) |
| 11 |
|
| 12 |
|
| 13 |
all: wasm-test |
| 14 |
|
| 15 |
wasm-test: wasm-test.cpp $(LIB)/libfaust.a |
| 16 |
$(CXX) -std=c++11 -O3 wasm-test.cpp -I $(INC) -L$(LIB) -L$(LIB_OPT) $(LIB)/libfaust.a $(LIB)/libwasmtime.a $(LLVM) -o wasm-test |
| 17 |
|
| 18 |
|
| 19 |
wasm-test1: wasm-test.cpp $(LIB)/libfaust.a |
| 20 |
$(CXX) -std=c++11 -O3 wasm-test.cpp -I $(INC) -L$(LIB_OPT) $(LIB)/libfaust.a $(LIB)/libmir.a -o wasm-test1 |
| 21 |
|
| 22 |
|
| 23 |
wasm-test2: wasm-test.cpp |
| 24 |
$(CXX) -std=c++11 -O3 wasm-test.cpp -I $(INC) -L$(LIB) -lfaust -o wasm-test2 |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
foo.wasm: |
| 33 |
faust -lang wasm foo.dsp -o foo.wasm |
| 34 |
|
| 35 |
install: |
| 36 |
([ -e wasm-test ]) && cp wasm-test $(prefix)/bin |
| 37 |
([ -e wasm-machine-test ]) && cp wasm-machine-test $(prefix)/bin |
| 38 |
|
| 39 |
test: wasm-test wasm-machine-test |
| 40 |
./wasm-test foo.dsp |
| 41 |
./wasm-machine-test foo.wasm |
| 42 |
|
| 43 |
clean: |
| 44 |
rm -f wasm-test wasm-test-c wasm-machine-test foo.wasm |
| 45 |
|