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
|
#
# 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))
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)
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
$(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 'control' primitive that currently uses the -lang ocpp backend
dsp/control.cpp : dsp/control.dsp
$(FAUST) -lang ocpp -double -i -a $(arch) $< -o $@
dsp/%.cpp : dsp/%.dsp
$(FAUST) -double -i -a $(arch) $< -o $@
# Specific rule to test 'control' primitive that currently uses the -lang ocpp backend (still compiling in scalar mode...)
dsp/vec/control.cpp : dsp/control.dsp
$(FAUST) -lang ocpp -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 'control' primitive that currently uses the -lang ocpp backend (still compiling in scalar mode...)
dsp/sched/control.cpp : dsp/control.dsp
@[ -d $(@D) ] || mkdir -p $(@D)
$(FAUST) -lang ocpp -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 $@
|