1# 2# Makefile for testing the Faust compiler output 3# 4system := $(shell uname -s) 5system := $(shell echo $(system) | grep MINGW > /dev/null && echo MINGW || echo $(system)) 6ifeq ($(system), MINGW) 7 FAUST ?= ../../build/bin/faust.exe 8else 9 FAUST ?= ../../build/bin/faust 10endif 11MAKE ?= make 12 13SAMPLESROOT := ../.. 14REGRESSION := .. 15FAUSTINC ?= ../../architecture/faust 16 17version := $(shell $(FAUST) --version | grep Version | sed -e 's/^..*Version //') 18 19cxxfiles = $(shell find $(version) -name "*.cpp") 20cfiles = $(shell find $(version) -name "*.c") 21gccobj := $(cxxfiles:%.cpp=%.o) $(cfiles:%.c=%.o) 22 23CXX ?= g++ 24GCC ?= gcc 25 26OPTIONS := -Wno-unused-command-line-argument -I$(FAUSTINC) 27 28all: 29 $(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -a ./min.cpp" 30 $(MAKE) -f Make.lang outdir=ocpp lang=ocpp ext=o.cpp FAUSTOPTIONS=" -a ./min.cpp" 31 $(MAKE) -f Make.lang outdir=c lang=c ext=c FAUSTOPTIONS=" -a ./min.c" 32 $(MAKE) -f Make.lang outdir=wasm lang=wasm ext=wasm FAUSTOPTIONS="" 33 $(MAKE) -f Make.lang outdir=wast lang=wast ext=wast FAUSTOPTIONS="" 34 #$(MAKE) -f Make.lang outdir=java lang=java ext=java FAUSTOPTIONS="" 35 $(MAKE) -f Make.lang outdir=fir lang=fir ext=fir FAUSTOPTIONS="" 36 $(MAKE) -f Make.lang outdir=rust lang=rust ext=rust FAUSTOPTIONS="" 37 $(MAKE) -f Make.lang outdir=llvm lang=llvm ext=llvm FAUSTOPTIONS="" 38 $(MAKE) -f Make.lang outdir=soul lang=soul ext=soul FAUSTOPTIONS="" 39 $(MAKE) gcc 40 41web: 42 $(MAKE) -f Make.lang outdir=wasm lang=wasm ext=wasm FAUSTOPTIONS="" 43 $(MAKE) -f Make.lang outdir=wast lang=wast ext=wast FAUSTOPTIONS="" 44 45c: 46 $(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -a ./min.cpp" 47 $(MAKE) -f Make.lang outdir=ocpp lang=ocpp ext=o.cpp FAUSTOPTIONS=" -a ./min.cpp" 48 $(MAKE) -f Make.lang outdir=c lang=c ext=c FAUSTOPTIONS=" -a ./min.c" 49 50soul: 51 $(MAKE) -f Make.lang outdir=soul lang=soul ext=soul FAUSTOPTIONS="" 52 53trace: 54 $(MAKE) -f Make.lang interp-tracer 55 56jtrace: 57 $(MAKE) -f Make.lang julia-tracer 58 59me: 60 $(MAKE) -f Make.lang outdir=cpp lang=cpp ext=cpp FAUSTOPTIONS=" -me -a ./min.cpp" 61 62######################################################################### 63# interp lang has a special status since the corresponding backend may not 64# be available due to gcc specific extensions 65interp: 66 $(MAKE) -f Make.lang outdir=interp lang=interp ext=fbc FAUSTOPTIONS="" 67 68help: 69 @echo "-------- FAUST compilation tests --------" 70 @echo "Available targets are:" 71 @echo " 'all' (default): compiles all the dsp found in the examples and regression" 72 @echo " folders using all backends (apart the interp backend)" 73 @echo " C and C++ output are also compile using $(GCC) and $(CXX)" 74 @echo " Output is located in a folder named using faust version ($(version))" 75 @echo "Specific targets:" 76 @echo " 'gcc' : compiles the C and C++ output of the 'cpp', 'ocpp' and 'c' backends" 77 @echo " 'soul' : compiles using the SOUL backend" 78 @echo " 'interp' : compiles using the interpreter backend" 79 @echo " 'web' : compiles using the wast/wasm backends" 80 @echo " 'trace' : compiles using the interp-tracer application" 81 @echo " 'jtrace' : compiles using Julia minimal-control architecture" 82 @echo " 'me' : compiles using the C++ backend with -me option" 83 @echo "Using a specific version of Faust libraries:" 84 @echo " 'make FAUSTLIBS=/path/to/libraries'" 85 86gcc: $(gccobj) 87 88######################################################################### 89# rules for c/c++ compilation 90%.o: %.cpp 91 $(eval tmp1 := $(patsubst $(version)/cpp/%, $(SAMPLESROOT)/%, $(<D))) 92 $(eval tmp := $(patsubst $(version)/ocpp/%, $(REGRESSION)/%, $(tmp1))) 93 $(CXX) -c $(OPTIONS) -I$(tmp) $< -o $@ 94 95%.o: %.c 96 $(eval tmp := $(patsubst $(version)/c/%, $(SAMPLESROOT)/%, $(<D))) 97 $(GCC) -c $(OPTIONS) -I$(tmp) $< -o $@ 98