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
|
#
# Makefile for testing the Faust compiler output
#
system := $(shell uname -s)
system := $(shell echo $(system) | grep MINGW > /dev/null && echo MINGW || echo $(system))
ifeq ($(system), MINGW)
FAUST ?= ../../build/bin/faust.exe
else
FAUST ?= ../../build/bin/faust
endif
MAKE ?= make
SAMPLESROOT := ../..
REGRESSION := ..
FAUSTINC ?= ../../architecture/faust
version := $(shell $(FAUST) --version | grep Version | sed -e 's/^..*Version //')
cxxfiles = $(shell find $(version) -name "*.cpp")
cfiles = $(shell find $(version) -name "*.c")
cppobj := $(cxxfiles:%.cpp=%.o)
cobj := $(cfiles:%.c=%.o)
CXX ?= g++
GCC ?= gcc
CPP_OPTIONS := -std=c++14 -Wno-unused-command-line-argument -I$(FAUSTINC)
C_OPTIONS := -Wno-unused-command-line-argument -I$(FAUSTINC)
all:
$(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -a ./min.cpp"
$(MAKE) -f Make.lang outdir=ocpp lang=ocpp ext=cpp FAUSTOPTIONS=" -a ./min.cpp"
$(MAKE) -f Make.lang outdir=c lang=c ext=c FAUSTOPTIONS=" -a ./min.c"
$(MAKE) -f Make.lang outdir=cmajor lang=cmajor ext=cmajor FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=codebox lang=codebox ext=codebox FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=dlang lang=dlang ext=dlang FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=fir lang=fir ext=fir FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=julia lang=julia ext=julia FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=jsfx lang=jsfx ext=jsfx FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=interp lang=interp ext=fbc FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=jax lang=jax ext=jax FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=llvm lang=llvm ext=bc FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=rust lang=rust ext=rs FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=wasm lang=wasm ext=wasm FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=wast lang=wast ext=wast FAUSTOPTIONS=""
$(MAKE) gcc1
$(MAKE) gcc2
check:
export FAUST_DEBUG=FIR_VAR_CHECKER; \
$(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -a ./min.cpp"
release:
$(MAKE) c
$(MAKE) os
$(MAKE) gcc1
$(MAKE) gcc2
$(MAKE) interp
$(MAKE) trace
web:
$(MAKE) -f Make.lang outdir=wasm lang=wasm ext=wasm FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=wast lang=wast ext=wast FAUSTOPTIONS=""
os:
$(MAKE) -f Make.lang outdir=cppos0 lang=cpp ext=cpp FAUSTOPTIONS=" -os -a ./min.cpp"
$(MAKE) -f Make.lang outdir=cos0 lang=c ext=c FAUSTOPTIONS="-lang c -os -a ./min.c"
c:
$(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -a ./min.cpp"
$(MAKE) -f Make.lang outdir=ocpp lang=ocpp ext=o.cpp FAUSTOPTIONS=" -a ./min.cpp"
$(MAKE) -f Make.lang outdir=c lang=c ext=c FAUSTOPTIONS=" -a ./min.c"
llvm:
$(MAKE) -f Make.lang outdir=llvm lang=llvm ext=llvm FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=llvm/vec lang=llvm ext=llvm FAUSTOPTIONS=" -vec -lv 1"
julia:
$(MAKE) -f Make.lang outdir=julia lang=julia ext=julia FAUSTOPTIONS=""
rust:
$(MAKE) -f Make.lang outdir=rust lang=rust ext=rust FAUSTOPTIONS=""
trace:
$(MAKE) -f Make.lang interp-tracer
jtrace:
$(MAKE) -f Make.lang julia-tracer
cmajor:
$(MAKE) -f Make.lang cmajor
rnbo:
$(MAKE) -f Make.lang rnbo
doc:
$(MAKE) -f Make.lang doc
me:
$(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -me -a ./min.cpp"
#########################################################################
# interp lang has a special status since the corresponding backend may not
# be available due to gcc specific extensions
interp:
$(MAKE) -f Make.lang outdir=interp lang=interp ext=fbc FAUSTOPTIONS=""
$(MAKE) -f Make.lang outdir=interp/vec lang=interp ext=fbc FAUSTOPTIONS=" -vec -lv 1"
help:
@echo "-------- FAUST compilation tests --------"
@echo "Available targets are:"
@echo " 'all' (default): compiles all the dsp found in the examples and regression"
@echo " folders using all backends (apart the interp backend)"
@echo " C and C++ output are also compile using $(GCC) and $(CXX)"
@echo " Output is located in a folder named using faust version ($(version))"
@echo " 'release' to test C++, C backend, 'os', 'interp' and 'trace' specific targets"
@echo "Specific targets:"
@echo " 'gcc1' : compiles the C and C++ output of the 'cpp' and 'ocpp' backends"
@echo " 'gcc2' : compiles the C and C++ output of the 'c' backend"
@echo " 'c' : compiles using the 'cpp', 'ocpp' and 'c' backends"
@echo " 'os' : compiles using the 'cpp' and 'c' backends in -osX mode"
@echo " 'llvm' : compiles using the LLVM backend"
@echo " 'interp' : compiles using the interpreter backend"
@echo " 'julia' : compiles using the Julia backend"
@echo " 'rust' : compiles using the Rust backend"
@echo " 'web' : compiles using the wast/wasm backends"
@echo " 'cmajor' : compiles using faust2cmajor"
@echo " 'rnbo' : compiles using faust2rnbo"
@echo " 'trace' : compiles using the interp-tracer application"
@echo " 'jtrace' : compiles using Julia minimal-control architecture"
@echo " 'me' : compiles using the C++ backend with -me option"
@echo " 'check' : compiles using the C++ backend and FAUST_DEBUG=FIR_VAR_CHECKER"
@echo " 'doc' : test the -mdoc, -svg options"
@echo " 'clean' : to remove the folder named using faust version"
@echo "Using a specific version of Faust libraries:"
@echo " 'make FAUSTLIBS=/path/to/libraries'"
gcc1: $(cppobj)
gcc2: $(cobj)
clean:
rm -rf $(version)
#########################################################################
# rules for c/c++ compilation
%.o: %.cpp
$(eval tmp1 := $(patsubst $(version)/cpp/%, $(SAMPLESROOT)/%, $(<D)))
$(eval tmp := $(patsubst $(version)/ocpp/%, $(REGRESSION)/%, $(tmp1)))
$(CXX) -c $(CPP_OPTIONS) -I$(tmp) $< -o $@
%.o: %.c
$(eval tmp := $(patsubst $(version)/c/%, $(SAMPLESROOT)/%, $(<D)))
$(GCC) -c $(C_OPTIONS) -I$(tmp) $< -o $@
|