File: Make.ref

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 (157 lines) | stat: -rw-r--r-- 4,978 bytes parent folder | download | duplicates (2)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#
# Makefile for building the ir reference files
#

system := $(shell uname -s)
system := $(shell echo $(system) | grep MINGW > /dev/null && echo MINGW || echo $(system))
ifeq ($(system), MINGW)
 FAUST ?= ../../build/bin/faust.exe
 COMPARE := ./filesCompare.exe
else
 FAUST ?= ../../build/bin/faust
 COMPARE := ./filesCompare
endif
MAKE ?= make

refdir := reference
GCCOPTIONS := -O3 -I../../architecture -Iarchs -pthread -std=c++11
lang ?= cpp
arch ?= ./archs/impulsearch.cpp
FAUSTOPTIONS := -lang $(lang) -double -i -a $(arch)

.PHONY: test reference

dspfiles := $(wildcard dsp/*.dsp)
reffiles := $(patsubst dsp/%.dsp, $(refdir)/%.ir, $(dspfiles))

boxfiles := $(patsubst dsp/%.dsp, $(refdir)/%.box, $(dspfiles))
sigfiles := $(patsubst dsp/%.dsp, $(refdir)/%.sig, $(dspfiles))
typefiles := $(patsubst dsp/%.dsp, $(refdir)/%.type, $(dspfiles))
firfiles := $(patsubst dsp/%.dsp, $(refdir)/%.fir, $(dspfiles))
cppfiles := $(patsubst dsp/%.dsp, $(refdir)/%.cpp1, $(dspfiles))

listintermediate = $(dspfiles:dsp/%.dsp=$1/%) $(dspfiles:dsp/%.dsp=$1/%.cpp) $(dspfiles:dsp/%.dsp=$1/vec/%) $(dspfiles:dsp/%.dsp=$1/vec/%.cpp) $(dspfiles:dsp/%.dsp=$1/sched/%) $(dspfiles:dsp/%.dsp=$1/sched/%.cpp) 

.INTERMEDIATE: $(call listintermediate, $(refdir))

TOOLSOPTIONS := -std=c++11 -O3 -I../../architecture
LIB    ?= ../../build/lib/libfaust.a
SRCDIR := tools

#########################################################################
# building reference files
reference: filesCompare $(refdir)/vec $(refdir)/sched $(reffiles) 

reference-box: $(boxfiles) 

reference-signal: $(sigfiles) 

reference-type: $(typefiles)

reference-fir: $(firfiles)

reference-cpp: $(cppfiles)

help:
	@echo "-------- FAUST impulse tests --------"
	@echo "Available targets are:"
	@echo " 'reference' (default): compiles all the dsp found in the dsp folder"
	@echo "             using the $(arch) architecture in scalar, vec and sched modes,"
	@echo "             then launch the output application to generate impulse response files,"
	@echo "             which are then checked against each other using filesCompare"

test:
	@echo $(call listintermediate, $(refdir))

#########################################################################
# output directories
$(refdir)/vec:
	mkdir -p $(refdir)/vec
$(refdir)/sched:
	mkdir -p $(refdir)/sched

#########################################################################
# tools
filesCompare: $(SRCDIR)/filesCompare.cpp
	$(MAKE) filesCompare

#########################################################################
# rules for reference-box
$(refdir)/%.box: dsp/%.dsp
	$(FAUST) $(FAUSTOPTIONS) -e $< -o $@ ; echo $<
	
# rules for reference-signal
$(refdir)/%.sig: dsp/%.dsp
	$(FAUST) $(FAUSTOPTIONS) -norm1 $<  > $@ ; echo $<

# rules for reference-type
$(refdir)/%.type: dsp/%.dsp
	$(FAUST) $(FAUSTOPTIONS) -norm2 $<  > $@ ; echo $<

# rules for reference-fir
$(refdir)/%.fir: dsp/%.dsp
	$(FAUST) -lang fir $(FAUSTOPTIONS) $<  > $@ ; echo $<

# rules for reference-cpp
$(refdir)/%.cpp1: dsp/%.dsp
	$(FAUST) -lang ocpp $(FAUSTOPTIONS) $<  > $@ ; echo $<

# rules for reference
$(refdir)/%.ir: dsp/% $(refdir)/vec/%.ir $(refdir)/sched/%.ir dsp/%.dsp dsp/%.cpp 
	@[ -d $(@D) ] || mkdir -p $(@D)
	$< -n 60000 > $@
	$(COMPARE) $@ $(refdir)/vec/$(notdir $@) 
	#$(COMPARE) $@ $(refdir)/sched/$(notdir $@) 1e-02

$(refdir)/vec/%.ir: dsp/vec/% dsp/%.dsp dsp/vec/%.cpp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$< -n 60000 > $@

$(refdir)/sched/%.ir: dsp/sched/% dsp/%.dsp dsp/sched/%.cpp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$< -n 60000 > $@

# Specific rule to test 'enable/control' primitives that currently only work in scalar mode
dsp/osc_enable.cpp : dsp/osc_enable.dsp
	$(FAUST) -lang cpp -double -i -a $(arch) $<  -o $@

dsp/%.cpp : dsp/%.dsp
	$(FAUST) -double -i -a $(arch) $<  -o $@

# Specific rule to test 'enable/control' primitives that currently only work in scalar mode
dsp/vec/osc_enable.cpp : dsp/osc_enable.dsp
	$(FAUST) -lang cpp -double -i -a $(arch) $<  -o $@

dsp/vec/%.cpp : dsp/%.dsp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$(FAUST) -double -vec -i -a $(arch) $<  -o $@

# Specific rule to test 'enable/control' primitives that currently only work in scalar mode
dsp/sched/osc_enable.cpp : dsp/osc_enable.dsp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$(FAUST) -lang ocpp -double -i -a $(arch) $<  -o $@
	
# Specific rule to test 'soundfile' primitive that does not work yet in sch mode
dsp/sched/sound.cpp : dsp/sound.dsp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$(FAUST) -double -i -a $(arch) $<  -o $@

# Specific rule to test the use of 'bs' that does not work yet in sch mode
dsp/sched/bs.cpp : dsp/bs.dsp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$(FAUST) -double -i -a $(arch) $<  -o $@

dsp/sched/%.cpp : dsp/%.dsp
	@[ -d $(@D) ] || mkdir -p $(@D)
	$(FAUST) -double -sch -i -a $(arch) $<  -o $@

dsp/% : dsp/%.cpp
	$(CXX) $(GCCOPTIONS) $<  -o $@
	
dsp/vec/% : dsp/vec/%.cpp
	$(CXX) $(GCCOPTIONS) $<  -o $@
	
dsp/sched/% : dsp/sched/%.cpp
	$(CXX) $(GCCOPTIONS) $<  -o $@