File: Makefile

package info (click to toggle)
faust 2.79.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 397,496 kB
  • sloc: cpp: 278,433; ansic: 116,164; javascript: 18,529; vhdl: 14,052; sh: 13,884; java: 5,900; objc: 3,852; python: 3,222; makefile: 2,655; cs: 1,672; lisp: 1,146; ruby: 954; yacc: 586; xml: 471; lex: 247; awk: 110; tcl: 26
file content (81 lines) | stat: -rw-r--r-- 3,449 bytes parent folder | download
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
LIB := $(shell faust --libdir)
LIB_OPT := /opt/local/lib
INC := $(shell faust --includedir)
system := $(shell uname -s)

DESTDIR ?=
PREFIX ?= /usr/local
LIB_OPT1 ?=

ifeq ($(system), Darwin)
LIB_OPT1=-framework CoreFoundation
INC_OPT=/opt/local/include
else ifeq ($(system), Linux)
LDFLAGS=-Wl,--export-dynamic
endif

MACOSLIBS := -framework CoreAudio -framework AudioUnit -framework CoreServices -framework CoreMIDI -framework CoreFoundation

LLVM := `llvm-config --link-static --ldflags --libs all --system-libs`

prefix := $(DESTDIR)$(PREFIX)

all: llvm-test llvm-algebra-test llvm-test-c faust-dynamic-engine-test

faust-dynamic-engine-test: faust-dynamic-engine-test.cpp $(LIB)/libfaust.a
	$(CXX) -std=c++11 -O3 faust-dynamic-engine-test.cpp /usr/local/include/faust/dsp/faust-dynamic-engine.cpp -DLLVM_DSP -DJACK_DRIVER -DPORTAUDIO_DRIVER -DRTAUDIO_DRIVER -DSOUNDFILE -I$(INC) -I$(INC_OPT) -lsndfile -ljack -lportaudio -lrtaudio -L$(LIB) -L$(LIB_OPT) $(LIB_OPT1) $(LIB)/libfaust.a -lpthread `llvm-config --ldflags --libs all --system-libs` -o faust-dynamic-engine-test

llvm-test: llvm-test.cpp $(LIB)/libfaust.a
	$(CXX) -std=c++11 -O3 llvm-test.cpp -I$(INC) -L$(LIB) -L$(LIB_OPT) $(LIB)/libfaust.a -lpthread $(LLVM) $(LDFLAGS) -o llvm-test

llvm-test-poly: llvm-test-poly.cpp $(LIB)/libfaust.a
	$(CXX) -std=c++11 -O3 llvm-test-poly.cpp -I$(INC) -L$(LIB) -L$(LIB_OPT) $(LIB)/libfaust.a `pkg-config --cflags --libs jack gtk+-2.0` -lpthread $(LLVM) $(LDFLAGS) -o llvm-test-poly

llvm-apiui-test: llvm-apiui-test.cpp $(LIB)/libfaust.a
	$(CXX) -std=c++11 -O3 llvm-apiui-test.cpp -I$(INC) -L$(LIB) -L$(LIB_OPT) $(LIB)/libfaust.a -lpthread $(LLVM) $(LDFLAGS) -o llvm-apiui-test

# To test the LLVM backend with dynamic libfaust on Apple M1 and Rosetta
llvm-test-x86: llvm-test.cpp 
	$(CXX) -arch x86_64 -std=c++11 -O3 llvm-test.cpp -I$(INC) -L$(LIB) -L$(LIB_OPT) -lfaust -lpthread -DJIT_TARGET="\"x86_64-apple-darwin\"" -o llvm-test

# To test the LLVM backend with dynamic libfaust on Apple M1
llvm-test-arm: llvm-test.cpp 
	$(CXX) -std=c++11 -O3 llvm-test.cpp -I$(INC) -L$(LIB) -L$(LIB_OPT) -lfaust -lpthread  -o llvm-test

llvm-test-c: llvm-test.c $(LIB)/libfaust.a
	$(CXX) llvm-test.c -O3 -I $(INC) -L$(LIB_OPT) $(LIB)/libfaust.a -lpthread $(LLVM) -o llvm-test-c

llvm-algebra-test: llvm-algebra-test.cpp $(LIB)/libfaust.a
	$(CXX) -std=c++11 -O3 llvm-algebra-test.cpp -I$(INC) -L$(LIB) -L$(LIB_OPT) $(LIB)/libfaust.a -lpthread $(LLVM) `pkg-config --cflags --libs gtk+-2.0` -o llvm-algebra-test

test-signal: test-signal.cpp $(LIB)/libfaust.a
	c++ -std=c++11 test-signal.cpp $(LIB)/libfaust.a $(LLVM) -L$(LIB_OPT) `pkg-config --cflags --libs gtk+-2.0` `pkg-config --cflags` $(MACOSLIBS) -o test-signal

install: 
	([ -e llvm-test ]) && cp llvm-test $(prefix)/bin

# Testing

test: llvm-test
	./llvm-test foo.dsp

test-c: llvm-test-c
	./llvm-test-c foo.dsp

test-algebra :llvm-algebra-test
	./llvm-algebra-test

test-poly: llvm-test-poly
	./llvm-test-poly organ.dsp
	./llvm-test-poly organ-effect.dsp

clean:
	rm -f llvm-test llvm-test-poly llvm-test-c llvm-algebra-test faust-dynamic-engine-test
	
help:
	@echo "Available targets:"
	@echo "  test-algebra - test the DSP algebra API"
	@echo "  test         - test the factory/instance API"
	@echo "  test-c       - test the factory/instance API in C"
	@echo "  test-poly    - test the polyphonic factory/instance API, then with a gloabl effect"
	@echo "  help         - Display this help message"